]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r341433: Move inclusion of src.opts.mk later.
Kyle Evans [Thu, 24 Oct 2019 02:25:30 +0000 (02:25 +0000)]
MFC r341433: Move inclusion of src.opts.mk later.

src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD
depending on the MK_CTF value. We then set MK_CTF to no, which has no
real effect. The solution is to set all the MK_foo values before
including src.opts.mk.

This should stop the cdboot binary from exploding in size for releases built
WITH_CTF=yes in src.conf.

4 years agoMFC r339796: Simplify the EFI delay() function by calling BS->Stall()
Kyle Evans [Thu, 24 Oct 2019 02:22:52 +0000 (02:22 +0000)]
MFC r339796: Simplify the EFI delay() function by calling BS->Stall()

4 years agoMFC r353680: vt: remove comment that is not true since r259680
Ed Maste [Wed, 23 Oct 2019 14:15:16 +0000 (14:15 +0000)]
MFC r353680: vt: remove comment that is not true since r259680

r259680 added support to vt(4) for printing double-width characters.
Remove the comment that claims no support.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r352623:
Mark Johnston [Wed, 23 Oct 2019 13:41:58 +0000 (13:41 +0000)]
MFC r352623:
Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations.

4 years agoMFC r353671:
Mark Johnston [Wed, 23 Oct 2019 13:41:44 +0000 (13:41 +0000)]
MFC r353671:
Use KOBJMETHOD_END in the kernel linker.

4 years agoMFC r353650:
Mark Johnston [Wed, 23 Oct 2019 13:41:26 +0000 (13:41 +0000)]
MFC r353650:
Clear PGA_WRITEABLE in moea_pvo_remove().

4 years agoMFC r352622:
Mark Johnston [Wed, 23 Oct 2019 13:40:39 +0000 (13:40 +0000)]
MFC r352622:
Set NX in mappings created by pmap_kenter() and pmap_kenter_attr().

4 years agoMFC r353569:
Brooks Davis [Tue, 22 Oct 2019 21:24:48 +0000 (21:24 +0000)]
MFC r353569:

rpcgen: make compiler arglist allocation dynamic

Limit argmax to an absurdly large value prevent overflow (no overflow
possible on FreeBSD due to ARG_MAX).

In CheriBSD we exceed the 19 non-NULL arguments in the static array.  Add
a simple size doubling allocator and increase the default to 32.

GC remnants of support for fixed arguments.

Reviewed by: archardson (prior version), James Clarke (prior version)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21971

4 years agoMFC r353458, r353460:
Mark Johnston [Tue, 22 Oct 2019 14:11:22 +0000 (14:11 +0000)]
MFC r353458, r353460:
Add a missing include of opt_sctp.h.

4 years agoMFC r353734:
Mark Johnston [Tue, 22 Oct 2019 14:10:31 +0000 (14:10 +0000)]
MFC r353734:
Further constrain the use of per-CPU caches for free pages.

PR: 241048

4 years agoMFC r353457:
Mark Johnston [Tue, 22 Oct 2019 14:06:42 +0000 (14:06 +0000)]
MFC r353457:
Add a missing include of opt_sctp.h.

4 years agoMFC r353477:
Mark Johnston [Tue, 22 Oct 2019 14:06:12 +0000 (14:06 +0000)]
MFC r353477:
Move SCTP DTrace probe definitions into a .c file.

4 years agoMFC r353167,r353270: ZFS: add emulation of atomic_swap_64 and atomic_load_64
Andriy Gapon [Tue, 22 Oct 2019 09:06:59 +0000 (09:06 +0000)]
MFC r353167,r353270: ZFS: add emulation of atomic_swap_64 and atomic_load_64

4 years agoMFC r353301: i386: hide more of atomic 64-bit definitions under _KERNEL
Andriy Gapon [Tue, 22 Oct 2019 08:56:45 +0000 (08:56 +0000)]
MFC r353301: i386: hide more of atomic 64-bit definitions under _KERNEL

4 years agoMFC r353624: MFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)
Andriy Gapon [Tue, 22 Oct 2019 08:52:21 +0000 (08:52 +0000)]
MFC r353624: MFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)

4 years agoMFC r339524 (by imp):
Dimitry Andric [Mon, 21 Oct 2019 17:45:00 +0000 (17:45 +0000)]
MFC r339524 (by imp):

Add missing options.

WITHOUT_LOADER_LUA is only needed since we turned it off by default on
powerpc and sparc64 in r338203. Same with
WITHOUT_LOADER_GEIL. WITH_NVME, WITHOUT_NVME, WITH_LOADER_FORCE_LE
have been needed since they were added.

MFC r353737:

Provide a src.conf(5) description for the new WITHOUT_CAROOT option, and
rename the WITH_LOADER_VERIEXEC_PASS_MANFIEST description to its correct
name.  Also correct a bunch of spelling errors in that description.

4 years agoMFC r352929: Add a top-level makeman target
Kyle Evans [Mon, 21 Oct 2019 01:27:01 +0000 (01:27 +0000)]
MFC r352929: Add a top-level makeman target

Abstracting away the details of how src.conf(5) is generated is arguably a
good thing; do so with a top-level makeman target.

4 years agoMFC r352711-r352712: Address posix_spawn(3) signal issues
Kyle Evans [Mon, 21 Oct 2019 01:24:21 +0000 (01:24 +0000)]
MFC r352711-r352712: Address posix_spawn(3) signal issues

r352711:
rfork(2): add RFSPAWN flag

When RFSPAWN is passed, rfork exhibits vfork(2) semantics but also resets
signal handlers in the child during creation to avoid a point of corruption
of parent state from the child.

This flag will be used by posix_spawn(3) to handle potential signal issues.

Reviewed by: jilles, kib
Differential Revision: https://reviews.freebsd.org/D19058

r352712:
posix_spawn(3): handle potential signal issues with vfork

Described in [1], signal handlers running in a vfork child have
opportunities to corrupt the parent's state. Address this by adding a new
rfork(2) flag, RFSPAWN, that has vfork(2) semantics but also resets signal
handlers in the child during creation.

x86 uses rfork_thread(3) instead of a direct rfork(2) because rfork with
RFMEM/RFSPAWN cannot work when the return address is stored on the stack --
further information about this problem is described under RFMEM in the
rfork(2) man page.

Addressing this has been identified as a prerequisite to using posix_spawn
in subprocess on FreeBSD [2].

[1] https://ewontfix.com/7/
[2] https://bugs.python.org/issue35823

4 years agoMFC r351650, r351795-r351796: writemapping accounting for posixshm
Kyle Evans [Mon, 21 Oct 2019 00:08:34 +0000 (00:08 +0000)]
MFC r351650, r351795-r351796: writemapping accounting for posixshm

r351650:
posixshm: switch to OBJT_SWAP in advance of other changes

Future changes to posixshm will start tracking writeable mappings in order
to support file sealing. Tracking writeable mappings for an OBJT_DEFAULT
object is complicated as it may be swapped out and converted to an
OBJT_SWAP. One may generically add this tracking for vm_object, but this is
difficult to do without increasing memory footprint of vm_object and blowing
up memory usage by a significant amount.

On the other hand, the swap pager can be expanded to track writeable
mappings without increasing vm_object size. This change is currently in
D21456. Switch over to OBJT_SWAP in advance of the other changes to the
swap pager and posixshm.

r351795:
vm pager: writemapping accounting for OBJT_SWAP

Currently writemapping accounting is only done for vnode_pager which does
some accounting on the underlying vnode.

Extend this to allow accounting to be possible for any of the pager types.
New pageops are added to update/release writecount that need to be
implemented for any pager wishing to do said accounting, and we implement
these methods now for both vnode_pager (unchanged) and swap_pager.

The primary motivation for this is to allow other systems with OBJT_SWAP
objects to check if their objects have any write mappings and reject
operations with EBUSY if so. posixshm will be the first to do so in order to
reject adding write seals to the shmfd if any writable mappings exist.

r351796:
posixshm: start counting writeable mappings

r351650 switched posixshm to using OBJT_SWAP for shm_object

r351795 added support to the swap_pager for tracking writeable mappings

Take advantage of this and start tracking writeable mappings; fd sealing
will use this to reject a seal on writing with EBUSY if any such mapping
exist.

4 years agoMFC r353644, r353646, r353663: bectl(8) origin auto-destroy
Kyle Evans [Sun, 20 Oct 2019 22:05:57 +0000 (22:05 +0000)]
MFC r353644, r353646, r353663: bectl(8) origin auto-destroy

r353644:
libbe(3): add needed bits for be_destroy to auto-destroy some origins

New BEs can be created from either an existing snapshot or an existing BE.
If an existing BE is chosen (either implicitly via 'bectl create' or
explicitly via 'bectl create -e foo bar', for instance), then bectl will
create a snapshot of the current BE or "foo" with be_snapshot, with a name
formatted like: strftime("%F-%T") and a serial added to it.

This commit adds the needed bits for libbe or consumers to determine if a
snapshot names matches one of these auto-created snapshots (with some light
validation of the date/time/serial), and also a be_destroy flag to specify
that the origin should be automatically destroyed if possible.

A future commit to bectl will specify BE_DESTROY_AUTOORIGIN by default so we
clean up the origin in the most common case, non-user-managed snapshots.

r353646:
bectl(8): destroy: use BE_DESTROY_AUTOORIGIN if -o is not specified

-o will force the origin to be destroyed unconditionally.
BE_DESTROY_AUTOORIGIN, on the other hand, will only destroy the origin if it
matches the format used by be_snapshot. This lets us clean up the snapshots
that are clearly not user-managed (because we're creating them) while
leaving user-created snapshots in place and warning that they're still
around when the BE created goes away.

r353663:
libbe(3): Fix destroy of imported BE w/ AUTOORIGIN

Imported BE, much like the activated BE, will not have an origin that we can
fetch/examine for destruction. be_destroy should not return BE_ERR_NOORIGIN
for failure to get the origin property for BE_DESTROY_AUTOORIGIN, because
we don't really know going into it that there's even an origin to be
destroyed.

BE_DESTROY_NEEDORIGIN has been renamed to BE_DESTROY_WANTORIGIN because only
a subset of it *needs* the origin, so 'need' is too strong of verbiage.

This was caught by jenkins and the bectl tests, but kevans failed to run the
bectl tests prior to commit.

4 years agoMFC r353128-r353129: fully initialize cloned devices w/ make_dev_args
Kyle Evans [Sun, 20 Oct 2019 22:01:35 +0000 (22:01 +0000)]
MFC r353128-r353129: fully initialize cloned devices w/ make_dev_args

r353128:
kern_conf: fully initialize cloned devices with make_dev_args, too

Attempting to initialize si_drv{1,2} with mda_si_drv{1,2} does not work if
you are operating on cloned devices.

clone_create must be called prior to the make_dev* family to create/return
the device on the clonelist as needed. This device is later returned early
in newdev(), prior to si_drv{0,1,2} initialization.

This patch simply breaks out of the loop if we've found a device and
finishes init.

r353129:
Remove the remnants of SI_CHEAPCLONE

SI_CHEAPCLONE was introduced in r66067 for use with cloned bpfs. It was
later also used in tty, tun, tap at points. The rough timeline for being
removed in each of these is as follows:

- r181690: bpf switched to use cdevpriv API by ed@
- r181905: ed@ rewrote the TTY later to be mpsafe
- r204464: kib@ removes it from tun/tap, declaring it unused

I've not yet been able to dig up any other consumers in the intervening 9
years. It is no longer set on any devices in the tree and leaves an
interesting situation in make_dev_sv where we're ok with the device already
being set SI_NAMED.

4 years agoFollow up on r351916 by also bumping the version suffix to 12.1 in
Dimitry Andric [Sun, 20 Oct 2019 14:45:19 +0000 (14:45 +0000)]
Follow up on r351916 by also bumping the version suffix to 12.1 in
Makefile.libcompat.

Reported by: Jeremy Cox <jeremy.m.cox@gmail.com>

4 years agoMFC r353655:
Dimitry Andric [Sat, 19 Oct 2019 15:58:20 +0000 (15:58 +0000)]
MFC r353655:

Ensure lld respects the WITH/WITHOUT_SHARED_TOOLCHAIN option

Traditionally, toolchain components such as cc, as, and ld have been
built as static executables.  The WITH_SHARED_TOOLCHAIN option from
src.conf(5) is meant to link these as regular executables, e.g. using
shared libraries.

The build of ld.lld did not yet check this option.  Fix the Makefile so
it will do so now.

Reported by: Mike Cui <cuicui@gmail.com>
PR: 241257

4 years agoMFC r353166: add atomic_load_64 for mipsn32
Andriy Gapon [Sat, 19 Oct 2019 08:22:51 +0000 (08:22 +0000)]
MFC r353166: add atomic_load_64 for mipsn32

4 years agoMFC r353037: ZFS: add bookmark renaming
Andriy Gapon [Sat, 19 Oct 2019 08:19:31 +0000 (08:19 +0000)]
MFC r353037: ZFS: add bookmark renaming

4 years agoMFC r353343: zfs: remove gratuitous divergence from other openzfs flavours
Andriy Gapon [Sat, 19 Oct 2019 07:51:49 +0000 (07:51 +0000)]
MFC r353343: zfs: remove gratuitous divergence from other openzfs flavours

4 years agoMFC r353341,r353342: zfs: document large_dnode feature
Andriy Gapon [Sat, 19 Oct 2019 07:47:28 +0000 (07:47 +0000)]
MFC r353341,r353342: zfs: document large_dnode feature

4 years agoMFC r353434: man4/Makefile: fix sorting for some entries starting with 'v'
Andriy Gapon [Sat, 19 Oct 2019 07:41:22 +0000 (07:41 +0000)]
MFC r353434: man4/Makefile: fix sorting for some entries starting with 'v'

4 years agoMFC r353649: fix section number in zfs-program.8
Andriy Gapon [Sat, 19 Oct 2019 07:37:18 +0000 (07:37 +0000)]
MFC r353649: fix section number in zfs-program.8

4 years agoMFC r353444:
Mark Johnston [Fri, 18 Oct 2019 13:41:08 +0000 (13:41 +0000)]
MFC r353444:
Remove an unneeded include of opt_sctp.h.

4 years agoMFC r353545:
Andrey V. Elsukov [Fri, 18 Oct 2019 09:09:32 +0000 (09:09 +0000)]
MFC r353545:
  Explicitly initialize the memory buffer to store O_ICMP6TYPE opcode.

  By default next_cmd() initializes only first u32 of opcode. O_ICMP6TYPE
  opcode has array of bit masks to store corresponding ICMPv6 types.
  An opcode that precedes O_ICMP6TYPE, e.g. O_IP6_DST, can have variable
  length and during opcode filling it can modify memory that will be used
  by O_ICMP6TYPE opcode. Without explicit initialization this leads to
  creation of wrong opcode.

  Reported by: Boris N. Lytochkin
  Obtained from: Yandex LLC

4 years agoMFC r353447:
Konstantin Belousov [Fri, 18 Oct 2019 08:36:08 +0000 (08:36 +0000)]
MFC r353447:
devfs_vptocnp(): correct the component name when node is not at top.

4 years agoMFC r353446:
Konstantin Belousov [Fri, 18 Oct 2019 08:34:52 +0000 (08:34 +0000)]
MFC r353446:
Plug the rest of undef behavior places that were missed in r337456.

4 years agoMFC r353443
Kristof Provost [Fri, 18 Oct 2019 03:38:01 +0000 (03:38 +0000)]
MFC r353443

mountroot: run statfs after mounting devfs

The usual flow for mounting a file system is to VFS_MOUNT() and then
immediately VFS_STATFS().

That's not done in vfs_mountroot_devfs(), which means the
mp->mnt_stat.f_iosize field is not correctly populated, which in turn
causes us to mark valid aio operations as unsafe (because the io size is
set to 0), ultimately causing the aio_test:md_waitcomplete test to fail.

Sponsored by: Axiado

4 years agoMFC 348472: Whitespace cleanups, no functional change.
John Baldwin [Thu, 17 Oct 2019 23:48:29 +0000 (23:48 +0000)]
MFC 348472: Whitespace cleanups, no functional change.

4 years agoMFC 348779:
John Baldwin [Thu, 17 Oct 2019 23:29:52 +0000 (23:29 +0000)]
MFC 348779:
Keep the shadow PCIR_COMMAND synced with the real one for pass through.

This ensures that bhyve properly recognizes when decoding is disabled
for BARs on passthru devices.  To properly handle writes to the
register, export a pci_emul_cmd_changed function from pci_emul.c that
the pass through device model invokes for config writes that change
PCIR_COMMAND.

4 years agoMFC 348778,348998: Enable memory and I/O decoding in PCI devices on demand.
John Baldwin [Thu, 17 Oct 2019 23:26:39 +0000 (23:26 +0000)]
MFC 348778,348998: Enable memory and I/O decoding in PCI devices on demand.

348778:
Enable memory and I/O decoding in PCI devices on demand.

Rather than uncoditionally setting the MEMEN and PORTEN bits in
PCIR_COMMAND for PCI devices, set the respective bit when the first
BAR of a given type is added to the device.  This more closely matches
what firmware does on bare metal.

BUSMASTEREN is still set unconditionally.  Eventually this bit should
move into the device models as not all device models need this set.

348998:
Remove a spurious break when setting up a 64-bit memory BAR.

This was causing 'enbit' to not be initialized in this case.

4 years agoMFC 348253: Add initial support for 'qSupported' to the debug server.
John Baldwin [Thu, 17 Oct 2019 23:22:00 +0000 (23:22 +0000)]
MFC 348253: Add initial support for 'qSupported' to the debug server.

This doesn't recognize any features yet, but does parse the features
string.  It advertises an arbitrary packet size of 4k.

4 years agoMFC 348212,348712: Add support for writing to guest memory in the debug server.
John Baldwin [Thu, 17 Oct 2019 23:17:56 +0000 (23:17 +0000)]
MFC 348212,348712: Add support for writing to guest memory in the debug server.

348212:
Add support for writing to guest memory in the debug server.

- Add a write_mem counterpart to read_mem to handle writes to MMIO.
- Add support for the GDB 'M' packet to write bytes to the guest's
  memory.  For MMIO writes, attempt to batch writes up into words.
  This is imprecise, but if you write a single 2 or 4-byte aligned
  word, it should be treated as a single MMIO write operation.
- While here, tidy up the parsing of the 'm' command used for reading
  memory to match 'M'.

348712:
Use parse_integer to avoid sign extension.

Coverity warned about gdb_write_mem sign extending the result of
parse_byte shifted left by 24 bits when generating a 32-bit memory
write value for MMIO.  Simplify the code by using parse_integer
instead of unrolled parse_byte calls.

4 years agoMFC r353651-r353652
Ian Lepore [Thu, 17 Oct 2019 01:30:37 +0000 (01:30 +0000)]
MFC r353651-r353652

r353651:
Relax the sdhci(4) check that filters out the 1.8v voltage option unless
the slot is flagged as 'embedded'.

The features related to embedded and shared slots were added in v3.0 of
the sdhci spec.  Hardware prior to v3 sometimes supported 1.8v on non-
removable devices in embedded systems, but had no way to indicate that
via the standard sdhci registers (instead they use out of band metadata
such as FDT data).

This change adds the controller specification version to the check for
whether to filter out the 1.8v selection.  On older hardware, the 1.8v
option is allowed to remain.  On 3.0 or later it still requires the
embedded-slot flag to remain.

This is part of the fix for PR 241301 (eMMC not detected on Beaglebone).
Changes to the sdhci_ti driver are also needed for a full fix.

PR: 241301

r353652:
Revert r351218 (by manu).  While the changes in r351218 appear to be (and
should be) correct, they lead to the eMMC on a Beaglebone failing to work
in some situations.

The TI sdhci hardware is kind of strange.  The first device inherently
supports 1.8v and 3.3v and the abililty to switch between them, and the
other two devices must be set to 1.8v in the sdhci power control register to
operate correctly, but doing so actually makes them run at 3.3v (unless an
external level-shifter is present in the signal path).  Even the 1.8v on the
first device may actually be 3.3v (or any other value), depending on what
voltage is fed to the VDDS1-VDDS7 power supply pins on the am335x chip.

Another strange quirk is that the convention for am335x sdhci drivers in
linux and uboot and the am335x boot ROM seems to be to set the voltage in
the sdhci capabilities register to 3.0v even though the actual voltage is
3.3v.  Why this is done is a complete mystery to me, but it seems to be
required for correct operation.

If we had complete modern support for the am335x chip we could get the
actual voltages from the FDT data and the regulator framework.  But our
am335x code currently doesn't have any regulator framework support.
Reverting to the prior code will get the popular Beaglebone boards working
again.

This is part of the fix for PR 241301, but also requires r353651 for a
complete fix.

PR: 241301
Discussed with: manu

Approved by: re(gjb) for MFC without 3-day wait

4 years agoMFC r353599
Eric Joyner [Wed, 16 Oct 2019 17:26:24 +0000 (17:26 +0000)]
MFC r353599

MFCs ixgbe: Disable EEE for backplane X550EM_X

This prevents a possible kernel panic on X552 backplane devices.

Sponsored by: Intel Corporation

4 years agoMFC r353463:
Konstantin Belousov [Wed, 16 Oct 2019 07:04:01 +0000 (07:04 +0000)]
MFC r353463:
Restore nofaulting operations after r352807.

4 years agoMFC r353329:
Brooks Davis [Tue, 15 Oct 2019 20:08:19 +0000 (20:08 +0000)]
MFC r353329:

msun: Silence new harmless -Wimplicit-int-float-conversion warnings

Clang from trunk recently added a warning for when implicit int-to-float
conversions cause a loss of precision. The code in question is designed
to be able to handle that, so add explicit casts to silence this.

Submitted by: James Clarke <jrtc27@jrtc27.com>
Reviewed by: dim
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21913

4 years agoMFC r352743: Add kern.cam.da.X.quirks tunable, similar existing for ada.
Alexander Motin [Tue, 15 Oct 2019 18:47:06 +0000 (18:47 +0000)]
MFC r352743: Add kern.cam.da.X.quirks tunable, similar existing for ada.

Submitted by: Michael Lass
Differential Revision: https://reviews.freebsd.org/D20677

4 years agoMFC r352939: Improve latency of synchronous 128KB writes.
Alexander Motin [Tue, 15 Oct 2019 18:44:28 +0000 (18:44 +0000)]
MFC r352939: Improve latency of synchronous 128KB writes.

Before my ZIL space optimization few years ago 128KB writes were logged
as two 64KB+ records in two 128KB log blocks.  After that change it became
~124KB+/4KB+ in two 128KB log blocks to free space in the second block
for another record.  Unfortunately in case of 128KB only writes, when space
in the second block remained unused, that change increased write latency by
imbalancing checksum computation time between parallel threads.

This change introduces new 68KB log block size, used for both writes below
67KB and 128KB-sharp writes.  Writes of 68-127KB are still using one 128KB
block to not increase processing overhead.  Writes above 131KB are still
using full 128KB blocks, since possible saving there is small.  Mixed loads
will likely also fall back to previous 128KB, since code uses maximum of
the last 10 requested block sizes.

On a simple 128KB write test with queue depth of 1 this change demonstrates
~15-20% performance improvement.

4 years agoMFC r352787: Replace argument checks with assertions.
Alexander Motin [Tue, 15 Oct 2019 18:39:32 +0000 (18:39 +0000)]
MFC r352787: Replace argument checks with assertions.

Those functions are used by kernel, and we can't check all possible argument
errors in production kernel.  Plus according to docs many of those errors
are checked by hardware.  Assertions should just help with code debugging.

4 years agoMFC r353326:
Brooks Davis [Tue, 15 Oct 2019 17:30:12 +0000 (17:30 +0000)]
MFC r353326:

Fix various -Wpointer-compare warnings

This warning (comparing a pointer against a zero character literal
rather than NULL) has existed since GCC 7.1.0, and was recently added to
Clang trunk.

Almost all of these are harmless, except for fwcontrol's str2node, which
needs to both guard against dereferencing a NULL pointer (though in
practice it appears none of the callers will ever pass one in), as well
as ensure it doesn't parse the empty string as node 0 due to strtol's
awkward interface.

Submitted by: James Clarke <jtrc27@jrtc27.com>
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21914

4 years agoMFC r353333:
Mark Johnston [Tue, 15 Oct 2019 14:51:22 +0000 (14:51 +0000)]
MFC r353333:
Fix a bug in r353332 that snuck in with a last-minute adjustment.

4 years agoMFC r353452:
Michael Tuexen [Tue, 15 Oct 2019 14:48:00 +0000 (14:48 +0000)]
MFC r353452:

Ensure that local variables are reset to their initial value when
dealing with error cases in a loop over all remote addresses.
This issue was found and reported by OSS_Fuzz in:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18080
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18086
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18121
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18163

4 years agoRevert r353552 for now.
Mark Johnston [Tue, 15 Oct 2019 14:29:30 +0000 (14:29 +0000)]
Revert r353552 for now.

ip6_ctloutput() is missing some requisite changes.

Reported by: Jenkins

4 years agoMFC r353294:
Mark Johnston [Tue, 15 Oct 2019 14:23:16 +0000 (14:23 +0000)]
MFC r353294:
Assert that the PGA_{WRITEABLE,EXECUTABLE} flags do not leak.

4 years agoMFC r353332:
Mark Johnston [Tue, 15 Oct 2019 14:19:44 +0000 (14:19 +0000)]
MFC r353332:
Add a regression test for r353331.

4 years agoMFC r353331:
Mark Johnston [Tue, 15 Oct 2019 14:19:14 +0000 (14:19 +0000)]
MFC r353331:
Fix handling of empty SCM_RIGHTS messages.

4 years agoMFC r353306:
Mark Johnston [Tue, 15 Oct 2019 14:18:40 +0000 (14:18 +0000)]
MFC r353306:
Clear PGA_WRITEABLE in riscv's pmap_remove_l3().

4 years agoMFC r353295:
Mark Johnston [Tue, 15 Oct 2019 14:18:01 +0000 (14:18 +0000)]
MFC r353295:
Improve locking in the IPV6_V6ONLY socket option handler.

4 years agoloader.efi: Block IO should honor align_io
Toomas Soome [Mon, 14 Oct 2019 19:17:00 +0000 (19:17 +0000)]
loader.efi: Block IO should honor align_io

MFC: r347195, r350654, r350655, r350656, r351274, r351630, r351637
r352421, r352439, r352443, r352444, r352445, r352446, r352451

We need to bring in a bit more than just align_io change.

4 years agoMFC r352829:
Mark Johnston [Sun, 13 Oct 2019 16:21:48 +0000 (16:21 +0000)]
MFC r352829:
Fix some problems with the SPARSE_MAPPING option in the kernel linker.

4 years agoMFC r352908:
Mark Johnston [Sun, 13 Oct 2019 15:57:09 +0000 (15:57 +0000)]
MFC r352908:
nm: Adjust argc and argv in get_opt().

4 years agoMFC r353308:
Mark Johnston [Sun, 13 Oct 2019 15:54:22 +0000 (15:54 +0000)]
MFC r353308:
Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().

4 years agoMFC r353413:
Konstantin Belousov [Sun, 13 Oct 2019 06:58:39 +0000 (06:58 +0000)]
MFC r353413:
Typo out->in.

4 years agoMFC r353348:
Glen Barber [Sat, 12 Oct 2019 01:02:45 +0000 (01:02 +0000)]
MFC r353348:
 Connect the libucl(3) manual page to the build.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMFC r353320:
Glen Barber [Thu, 10 Oct 2019 17:29:47 +0000 (17:29 +0000)]
MFC r353320:
 Rework the logic for installing the pkg(8) configuration.

 'quarterly' package sets do not exist for head, so explicitly
 install the 'latest' configuration file there.  Otherwise,
 fall back to the original conditional evaluation to determine
 if the 'latest' or 'quarterly' configuration file should be
 installed.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMFC r353321:
Hans Petter Selasky [Thu, 10 Oct 2019 15:36:45 +0000 (15:36 +0000)]
MFC r353321:
Fix regression issue after r352989:

As noted by the commit message, callouts are now persistant
and should not be in the auto-zero section of the RQ's and SQ's.
This fixes an assert when using the TX completion event
factor feature with mlx5en(4).

Found by: gallatin@
Sponsored by: Mellanox Technologies

4 years agoMFC r353303:
Michael Tuexen [Thu, 10 Oct 2019 14:56:29 +0000 (14:56 +0000)]
MFC r353303:

Validate length before use it, not vice versa.
r353060 should have contained this...
This fixes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18070

4 years agoMFC r353290:
Michael Tuexen [Thu, 10 Oct 2019 14:54:22 +0000 (14:54 +0000)]
MFC r353290:

In r343587 a simple port filter as sysctl tunable was added to siftr.
The new sysctl was not added to the siftr.4 man page at the time.
This updates the man page, and removes one left over trailing whitespace.

Submitted by: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D21619

4 years agoMFC r353145:
Michael Tuexen [Thu, 10 Oct 2019 14:52:48 +0000 (14:52 +0000)]
MFC r353145:

Plumb an mbuf leak in a code path that should not be taken. Also avoid
that this path is taken by setting the tail pointer correctly.
There is still bug related to handling unordered unfragmented messages
which were delayed in deferred handling.
This issue was found by OSS-Fuzz testing the usrsctp stack and reported
in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17794

4 years agoMFC r353123:
Michael Tuexen [Thu, 10 Oct 2019 14:51:38 +0000 (14:51 +0000)]
MFC r353123:

Fix a use after free bug when removing remote addresses.
This bug was found by OSS-Fuzz and reported in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18004

4 years agoMFC r353122:
Michael Tuexen [Thu, 10 Oct 2019 14:50:44 +0000 (14:50 +0000)]
MFC r353122:

Plumb an mbuf leak found by Mark Wodrich from Google by fuzz testing the
userland stack and reporting it in:
https://github.com/sctplab/usrsctp/issues/396

4 years agoMFC r353119:
Michael Tuexen [Thu, 10 Oct 2019 14:49:49 +0000 (14:49 +0000)]
MFC r353119:

Fix the adding of padding to COOKIE-ECHO chunks.

Thanks to Mark Wodrich who found this issue while fuzz testing the
usrsctp stack and reported the issue in
https://github.com/sctplab/usrsctp/issues/382

4 years agoMFC r353071:
Michael Tuexen [Thu, 10 Oct 2019 14:48:48 +0000 (14:48 +0000)]
MFC r353071:

When skipping the address parameter, take the padding into account.

4 years agoMFC r353069:
Michael Tuexen [Thu, 10 Oct 2019 14:47:39 +0000 (14:47 +0000)]
MFC r353069:

Cleanup sctp_asconf_error_response() and ensure that the parameter
is padded as required. This fixes the followig bug reported by
OSS-Fuzz for the usersctp stack:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17790

4 years agoMFC r353060:
Michael Tuexen [Thu, 10 Oct 2019 14:45:59 +0000 (14:45 +0000)]
MFC r353060:

Add missing input validation. This could result in reading from
uninitialized memory.
The issue was found by OSS-Fuzz for usrsctp  and reported in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17780

4 years agoMFC r353065:
Konstantin Belousov [Thu, 10 Oct 2019 08:33:14 +0000 (08:33 +0000)]
MFC r353065:
tmpfs_readdir(): unlock the locked node.

4 years agoMFC r353064:
Konstantin Belousov [Thu, 10 Oct 2019 08:30:50 +0000 (08:30 +0000)]
MFC r353064:
tmpfs_rename: style.

4 years agoMFC r353033:
Konstantin Belousov [Thu, 10 Oct 2019 08:28:34 +0000 (08:28 +0000)]
MFC r353033:
Remove unnecessary vm/vm_page.h and vm/vm_pager.h includes from
tmpfs/tmpfs_vnops.c.

4 years agoMFC r352732:
Martin Matuska [Wed, 9 Oct 2019 22:18:01 +0000 (22:18 +0000)]
MFC r352732:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1237: Fix integer overflow in archive_read_support_filter_lz4.c
  PR #1249: Correct some typographical and grammatical errors.
  PR #1250: Minor corrections to the formatting of manual pages

4 years agoMFC r353021: simplify path handling in sysctl_try_reclaim_vnode
Ed Maste [Wed, 9 Oct 2019 14:35:09 +0000 (14:35 +0000)]
MFC r353021: simplify path handling in sysctl_try_reclaim_vnode

MAXPATHLEN / PATH_MAX includes space for the terminating NUL, and namei
verifies the presence of the NUL.  Thus there is no need to increase the
buffer size here.

The sysctl passes the string excluding the NUL, so req->newlen equal to
PATH_MAX is too long.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r353013:
Mark Johnston [Wed, 9 Oct 2019 14:09:57 +0000 (14:09 +0000)]
MFC r353013:
Harmonize the hptmv blob's build rule with that of other hpt* drivers.

4 years agoMFC r353014:
Mark Johnston [Wed, 9 Oct 2019 14:09:25 +0000 (14:09 +0000)]
MFC r353014:
Use OBJT_PHYS VM objects for kernel modules.

4 years agoMFC r352591: MFZoL: Retire send space estimation via ZFS_IOC_SEND
Andriy Gapon [Wed, 9 Oct 2019 09:40:03 +0000 (09:40 +0000)]
MFC r352591: MFZoL: Retire send space estimation via ZFS_IOC_SEND

Add a small wrapper around libzfs_core's lzc_send_space() to libzfs so
that every legacy ZFS_IOC_SEND consumer, along with their userland
counterpart estimate_ioctl(), can leverage ZFS_IOC_SEND_SPACE to
request send space estimation.

The legacy functionality in zfs_ioc_send() is left untouched for
compatibility purposes.

Obtained from: ZoL
Obtained from: zfsonlinux/zfs@cf7684bc8d57
Author: loli10K <ezomori.nozomu@gmail.com>

4 years agoNeed to use ${${_${group}DIR_${file}}} for STAGE_DIR
Simon J. Gerraty [Tue, 8 Oct 2019 20:14:33 +0000 (20:14 +0000)]
Need to use ${${_${group}DIR_${file}}} for STAGE_DIR

STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
${STAGE_OBJTOP}BINDIR rather than
${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR

MFC of r352942

Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D21858

4 years agoMFC r352919:
Brooks Davis [Tue, 8 Oct 2019 18:06:02 +0000 (18:06 +0000)]
MFC r352919:

Update cloudabi(32|64) sysents with "make sysent".

4 years agoMFC r352618:
Tijl Coosemans [Tue, 8 Oct 2019 10:24:48 +0000 (10:24 +0000)]
MFC r352618:

Create a "drm" subdirectory for drm devices in linsysfs.  Recent versions of
linux libdrm check for the existence of this directory:

https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d

4 years agoMFC 351557: Adjust the deprecated warnings for /dev/crypto to be less noisy.
John Baldwin [Mon, 7 Oct 2019 20:41:55 +0000 (20:41 +0000)]
MFC 351557: Adjust the deprecated warnings for /dev/crypto to be less noisy.

Warn when actual operations are performed instead of when sessions are
created.  The /dev/crypto engine in OpenSSL 1.0.x tries to create
sessions for all possible algorithms each time it is initialized
resulting in spurious warnings.

4 years agoMFC r353010:
Mark Johnston [Mon, 7 Oct 2019 14:46:23 +0000 (14:46 +0000)]
MFC r353010:
Disallow fcntl(F_READAHEAD) when the vnode is not a regular file.

4 years agoMFC r352998:
Hans Petter Selasky [Mon, 7 Oct 2019 10:32:23 +0000 (10:32 +0000)]
MFC r352998:
Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352997:
Hans Petter Selasky [Mon, 7 Oct 2019 10:30:49 +0000 (10:30 +0000)]
MFC r352997:
Print numeric error_type and module_status in mlx5core
in case the strings are not available.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352996:
Hans Petter Selasky [Mon, 7 Oct 2019 10:29:30 +0000 (10:29 +0000)]
MFC r352996:
Add print to show user a reason for rejecting buffer size change in mlx5en(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352995:
Hans Petter Selasky [Mon, 7 Oct 2019 10:27:50 +0000 (10:27 +0000)]
MFC r352995:
Only update lossy buffers config when manual PFC configuration was done
in mlx5en(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352994:
Hans Petter Selasky [Mon, 7 Oct 2019 10:26:23 +0000 (10:26 +0000)]
MFC r352994:
Improve mlx5_fwdump_prep logging in mlx5core.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352993:
Hans Petter Selasky [Mon, 7 Oct 2019 10:25:08 +0000 (10:25 +0000)]
MFC r352993:
Randomize the delay when waiting for VSC flag in mlx5core.

The PRM suggests random 0 - 10ms to prevent multiple waiters on the same
interval in order to avoid starvation.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352992:
Hans Petter Selasky [Mon, 7 Oct 2019 10:23:27 +0000 (10:23 +0000)]
MFC r352992:
Use size_t for byte_to_write variable when comparing to eeprom_info_out_len
which is also size_t in mlx5tool(8).

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352991 and 353000:
Hans Petter Selasky [Mon, 7 Oct 2019 10:20:23 +0000 (10:20 +0000)]
MFC r352991 and 353000:
Wait for FW readiness before initializing command interface in mlx5core.

Before attempting to initialize the command interface we must wait till
the fw_initializing bit is clear.

If we fail to meet this condition the hardware will drop our
configuration, specifically the descriptors page address.  This scenario
can happen when the firmware is still executing an FLR flow and did not
finish yet so the driver needs to wait for that to finish.

Linux commits:
6c780a0267b8
b8a92577f4be.

Sponsored by: Mellanox Technologies

4 years agoMFC r352989:
Hans Petter Selasky [Mon, 7 Oct 2019 10:09:26 +0000 (10:09 +0000)]
MFC r352989:
Seal transmit path with regards to using destroyed mutex in mlx5en(4).

It may happen during link down that the running state may be observed
non-zero in the transmit routine, right before the running state is
cleared. This may end up using a destroyed mutex.

Make all channel mutexes and callouts persistant.

Preserve receive and send queue statistics during link toggle.

Sponsored by: Mellanox Technologies

4 years agoMFC r352988:
Hans Petter Selasky [Mon, 7 Oct 2019 09:57:57 +0000 (09:57 +0000)]
MFC r352988:
Remove unused cpu field from channel structure in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352987:
Hans Petter Selasky [Mon, 7 Oct 2019 09:55:13 +0000 (09:55 +0000)]
MFC r352987:
Remove mkey_be from channel structure in mlx5en(4).
Use value from priv structure instead.
This saves some space in the channel structure.

Sponsored by: Mellanox Technologies

4 years agoMFC r352986:
Hans Petter Selasky [Mon, 7 Oct 2019 09:53:12 +0000 (09:53 +0000)]
MFC r352986:
Return an error from ioctl(MLX5_FW_RESET) if reset was rejected in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352985:
Hans Petter Selasky [Mon, 7 Oct 2019 09:51:03 +0000 (09:51 +0000)]
MFC r352985:
Add sysctl(8) to get and set forward error correction, FEC, configuration
in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352984:
Hans Petter Selasky [Mon, 7 Oct 2019 09:48:20 +0000 (09:48 +0000)]
MFC r352984:
Add the ability to query the EEPROM information in mlx5tool(8).

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352983 and r353001:
Hans Petter Selasky [Mon, 7 Oct 2019 09:45:20 +0000 (09:45 +0000)]
MFC r352983 and r353001:
Move EEPROM information query from a sysctl in mlx5en(4) to an ioctl
in mlx5core. The EEPROM information is not only a property of the
mlx5en(4) driver.

Submitted by: slavash@
Sponsored by: Mellanox Technologies