]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoReplace rdma_is_upper_dev_rcu() with rdma_vlan_dev_real_dev() in ibcore.
hselasky [Wed, 16 Oct 2019 08:55:29 +0000 (08:55 +0000)]
Replace rdma_is_upper_dev_rcu() with rdma_vlan_dev_real_dev() in ibcore.
This reduces the number of references to VLAN_TRUNKDEV() in ibcore.
Currently only VLAN is supported as a child interface in FreeBSD.
Remove superfluous RCU locking.

Sponsored by: Mellanox Technologies

4 years agoVLAN_DEVAT() requires epochification in ipoib after r353292.
hselasky [Wed, 16 Oct 2019 08:40:58 +0000 (08:40 +0000)]
VLAN_DEVAT() requires epochification in ipoib after r353292.

Sponsored by: Mellanox Technologies

4 years agoMFV r353628:
avg [Wed, 16 Oct 2019 07:57:58 +0000 (07:57 +0000)]
MFV r353628:

10842 Mutex leak in dsl_dataset_hold_obj()

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

https://www.illumos.org/issues/10842
  ZoL d10b2f1d35b Mutex leak in dsl_dataset_hold_obj()

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Author: Jorgen Lundman <lundman@lundman.net>
Obtained from: illumos, ZoL
MFC after: 15 days

4 years agofix wording / typos in r353625
avg [Wed, 16 Oct 2019 07:53:47 +0000 (07:53 +0000)]
fix wording / typos in r353625

Reported by: kib
MFC after: 4 weeks
X-MFC with: r353625, r353618

4 years agozfs: add a lame emulation of cv_wait_sig(9) in userland to fix r353618
avg [Wed, 16 Oct 2019 07:41:33 +0000 (07:41 +0000)]
zfs: add a lame emulation of cv_wait_sig(9) in userland to fix r353618

Not sure if we need anything better.
Maybe we should try to port illumos libfakekernel or provide something
similar natively.

MFC after: 4 weeks
X-MFC with: r353618

4 years agoMFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)
avg [Wed, 16 Oct 2019 07:20:59 +0000 (07:20 +0000)]
MFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)

illumos/illumos-gate@736e6700391d17ab1494985a80076fc185722699
https://github.com/illumos/illumos-gate/commit/736e6700391d17ab1494985a80076fc185722699

https://www.illumos.org/issues/10473

Author: Jason King <jason.king@joyent.com>
Obtained from: illumos
MFC after: 6 days

4 years agoFix assert in PowerPC pmaps after introduction of object busy.
kib [Wed, 16 Oct 2019 07:09:15 +0000 (07:09 +0000)]
Fix assert in PowerPC pmaps after introduction of object busy.

The VM_PAGE_OBJECT_BUSY_ASSERT() in pmap_enter() implementation should
be only asserted when the code is executed as result of pmap_enter(),
not when the same code is entered from e.g. pmap_enter_quick().  This
is relevant for all PowerPC pmap variants, because mmu_*_enter() is
used as the backend, and assert is located there.

Add a PowerPC private pmap_enter() PMAP_ENTER_QUICK_LOCKED flag to
indicate that the call is not from pmap_enter().  For non-quick-locked
calls, assert that the object is locked.

Reported and tested by: bdragon
Reviewed by: alc, bdragon, markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D22041

4 years agoMFV r353619: 9691 fat zap should prefetch when iterating
avg [Wed, 16 Oct 2019 07:09:00 +0000 (07:09 +0000)]
MFV r353619: 9691 fat zap should prefetch when iterating

illumos/illumos-gate@52abb70e073c2a88808c0d66fd810ba8c5080572
https://github.com/illumos/illumos-gate/commit/52abb70e073c2a88808c0d66fd810ba8c5080572

https://www.illumos.org/issues/9691
  When iterating over a ZAP object, we're almost always certain to
  iterate over the entire object. If there are multiple leaf blocks, we
  can realize a performance win by issuing reads for all the leaf blocks
  in parallel when the iteration begins.
  For example, if we have 10,000 snapshots, "zfs destroy -nv
  pool/fs@1%9999" can take 30 minutes when the cache is cold. This
  change provides a >3x performance improvement, by issuing the reads
  for all ~64 blocks of each ZAP object in parallel.

Author: Matthew Ahrens <mahrens@delphix.com>
Obtained from: illumos
MFC after: 2 weeks

4 years agoMFV r353617: 9425 allow channel programs to be stopped via signals
avg [Wed, 16 Oct 2019 07:00:18 +0000 (07:00 +0000)]
MFV r353617: 9425 allow channel programs to be stopped via signals

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

https://www.illumos.org/issues/9425
  Problem Statement
  ZFS Channel program scripts currently require a timeout, so that hung
  or long-running scripts return a timeout error instead of causing ZFS
  to get wedged.  This limit can currently be set up to 100 million Lua
  instructions. Even with a limit in place, it would be desirable to
  have a sys admin (support engineer) be able to cancel a script that is
  taking a long time.

  Proposed Solution
  Make it possible to abort a channel program by sending an interrupt
  signal.In the underlying txg_wait_sync function, switch the cv_wait to
  a cv_wait_sig to catch the signal. Once a signal is encountered, the
  dsl_sync_task function can install a Lua hook that will get called
  before the Lua interpreter executes a new line of code. The
  dsl_sync_task can resume with a standard txg_wait_sync call and wait
  for the txg to complete. Meanwhile, the hook will abort the script and
  indicate that the channel program was canceled. The kernel returns a
  EINTR to indicate that the channel program run was canceled.

FreeBSD note: the return value of cv_wait_sig() has inverted meaning
between us and illumos.

Author: Don Brady <don.brady@delphix.com>
Obtained from: illumos
MFC after: 4 weeks

4 years agoMFV r353615: 9485 Optimize possible split block search space
avg [Wed, 16 Oct 2019 06:43:22 +0000 (06:43 +0000)]
MFV r353615: 9485 Optimize possible split block search space

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

https://www.illumos.org/issues/9485
  Port this commit from ZoL:
  https://github.com/zfsonlinux/zfs/commit/4589f3ae4c1bb435777da8640eb915f3c713b14d

Author: Brian Behlendorf <behlendorf1@llnl.gov>
Obtained from: illumos, ZoL
MFC after: 3 weeks

4 years agoMFV r353613: 10731 zfs: NULL pointer errors
avg [Wed, 16 Oct 2019 06:38:05 +0000 (06:38 +0000)]
MFV r353613: 10731 zfs: NULL pointer errors

FreeBSD already had these changes locally.
This commit removes a small formatting difference.

MFC after: 1 week

4 years agoMFC r353611: 10330 merge recent ZoL vdev and metaslab changes
avg [Wed, 16 Oct 2019 06:26:51 +0000 (06:26 +0000)]
MFC r353611: 10330 merge recent ZoL vdev and metaslab changes

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

https://www.illumos.org/issues/10330
  3 recent ZoL changes in the vdev and metaslab code which we can pull over:
  PR 8324 c853f382db 8324 Change target size of metaslabs from 256GB to 16GB
  PR 8290 b194fab0fb 8290 Factor metaslab_load_wait() in metaslab_load()
  PR 8286 419ba59145 8286 Update vdev_is_spacemap_addressable() for new spacemap
  encoding

Author: Serapheim Dimitropoulos <serapheimd@gmail.com>
Obtained from: illumos, ZoL
MFC after: 2 weeks

4 years agoMFV r353608: 10165 libzpool: passing argument 1 to restrict-qualified parameter
avg [Wed, 16 Oct 2019 06:09:00 +0000 (06:09 +0000)]
MFV r353608: 10165 libzpool: passing argument 1 to restrict-qualified parameter

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

https://www.illumos.org/issues/10165

Author: Toomas Soome <tsoome@me.com>
MFC after: 10 days

4 years agoMFV r353606: 10067 Miscellaneous man page typos
avg [Wed, 16 Oct 2019 06:05:18 +0000 (06:05 +0000)]
MFV r353606: 10067 Miscellaneous man page typos

https://www.illumos.org/issues/10067
  fileystem - man1m/zfs.1m man1m/boot.1m

Author: Peter Tribble <peter.tribble@gmail.com>
Obtained from: illumos
MFC after: 1 week

4 years agopowerpc/mpc85xx: Fix function type for fsl_pcib_error_intr()
jhibbits [Wed, 16 Oct 2019 03:03:59 +0000 (03:03 +0000)]
powerpc/mpc85xx: Fix function type for fsl_pcib_error_intr()

Since it's only called as an interrupt handler, fsl_pcib_eror_intr() should just
match the driver_intr_t type.

Reported by: bdragon

4 years agopowerpc: Add AmigaOne platform, a subclass of MPC85xx
jhibbits [Wed, 16 Oct 2019 00:38:50 +0000 (00:38 +0000)]
powerpc: Add AmigaOne platform, a subclass of MPC85xx

Summary:
The AmigaOne platform, encompassing the X5000 and A1222 at this time, is
based on the mpc85xx platform, but includes some things not listed in
the device tree.  Some custom devices, like CPLD, could be added to the
device tree with an overlay, or other means.  However, some cannot
easily be done, such as the power button interrupt.

The directory will also become a location to add AmigaOne platform drivers,
such as the aforementioned CPLD, and its children.

Reviewed by: bdragon
Differential Revision: https://reviews.freebsd.org/D21829

4 years agoFix including bsd.compat.mk outside Makefile.libcompat on mips64.
brooks [Tue, 15 Oct 2019 23:54:51 +0000 (23:54 +0000)]
Fix including bsd.compat.mk outside Makefile.libcompat on mips64.

Reported by: jhb, jenkins

4 years agoGeneralize ARM specific comments in devmap
kp [Tue, 15 Oct 2019 23:21:52 +0000 (23:21 +0000)]
Generalize ARM specific comments in devmap

The comments in devmap are very ARM specific, this generalizes them for other
architectures.

Submitted by: Nicholas O'Brien <nickisobrien_gmail.com>
Reviewed by: manu, philip
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D22035

4 years agoixgbe: Disable EEE for backplane X550EM_X
erj [Tue, 15 Oct 2019 21:56:19 +0000 (21:56 +0000)]
ixgbe: Disable EEE for backplane X550EM_X

From Zach:
Intel documentation indicates that backplane X550EM_X KR devices do not
support Energy Efficient Ethernet. Prior to this patch, X552 devices
(device ID 0x15AB) will crash the system when transitioning EEE state
via sysctl.

Signed-off-by: Zach Vargas <zvargas@xes-inc.com>
PR: 240320
Submitted by: Zach Vargas <zvargas@xes-inc.com>
Reviewed by: erj@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21673

4 years agoMissing from r353596.
glebius [Tue, 15 Oct 2019 21:32:38 +0000 (21:32 +0000)]
Missing from r353596.

4 years agoAdd the ability to link programs against a compat ABI.
brooks [Tue, 15 Oct 2019 21:27:06 +0000 (21:27 +0000)]
Add the ability to link programs against a compat ABI.

Linkage is controlled by two make knobs:
WANT_COMPAT - Prefer to link against the compat ABI.
NEED_COMPAT - Link against the compat ABI or fail to build.

Supported values are "32", "soft", and "any".  The latter meaning pick
the first[0] supported compat ABI.

This can be used to provide test binaries for compat ABIs or to link
ABI-specific programs.

[0] We currently support only one compat ABI at a time, but this may
change in the future and some code in this commit is structured to ease
that change.

Reviewed by: bdrewery, jhb
Obtained from: CheriBSD (in concept)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22023

4 years agoWhen assertion for a thread not being in an epoch fails also print all
glebius [Tue, 15 Oct 2019 21:24:25 +0000 (21:24 +0000)]
When assertion for a thread not being in an epoch fails also print all
entered epochs. Works with EPOCH_TRACE only.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D22017

4 years agoBuild compat libraries before "everything".
brooks [Tue, 15 Oct 2019 21:22:13 +0000 (21:22 +0000)]
Build compat libraries before "everything".

This is required for us to link programs against compat versions of
libraries.

Reviewed by: bdrewery, jhb
Sponsored by: DARPA, AFRL

4 years agoAllow OBJDIR to be overridden for LIB*DIR variables.
brooks [Tue, 15 Oct 2019 21:15:03 +0000 (21:15 +0000)]
Allow OBJDIR to be overridden for LIB*DIR variables.

This will allow us to link against internal libraries when building
programs for the system's LIBCOMPAT ABI.

Reviewed by: bdrewery
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

4 years agoRename top-level LIBCOMPAT to _LIBCOMPAT.
brooks [Tue, 15 Oct 2019 21:11:22 +0000 (21:11 +0000)]
Rename top-level LIBCOMPAT to _LIBCOMPAT.

This avoids a conflict with LIBCOMPAT defined in bsd.libnames.mk.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL

4 years agoMove the per-ARCH definitions to bsd.compat.mk.
brooks [Tue, 15 Oct 2019 21:08:49 +0000 (21:08 +0000)]
Move the per-ARCH definitions to bsd.compat.mk.

This is the first step if refactoring the definitions to allow programs
to be selectively linked against libcompat libraries.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL

4 years agoAdd copyrights that I forgot to add when splitting arb.h off from tree.h.
trasz [Tue, 15 Oct 2019 19:44:43 +0000 (19:44 +0000)]
Add copyrights that I forgot to add when splitting arb.h off from tree.h.
While here clean up the RCS tags.

Suggested by: lstewart
MFC after: 2 weeks
Sponsored by: Klara Inc, Netflix

4 years agoInstall an ACPI PCI bus notify handler.
jhb [Tue, 15 Oct 2019 19:12:09 +0000 (19:12 +0000)]
Install an ACPI PCI bus notify handler.

Rescan a PCI bus when the ACPI_NOTIFY_BUS_CHECK event is posted to a
PCI bus.

Reviewed by: scottl
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21948

4 years agoSupport hot insertion and removal of PCI devices on EC2.
jhb [Tue, 15 Oct 2019 19:04:39 +0000 (19:04 +0000)]
Support hot insertion and removal of PCI devices on EC2.

Install ACPI notify handlers on PCI devices with an _EJ0 method.  This
handler is invoked when devices are added or removed.

- When an ACPI_NOTIFY_DEVICE_CHECK event posts, rescan the parent bus
  device.  Note that strictly speaking we only need to rescan the
  specified device, but BUS_RESCAN is what is available, so we rescan
  the entire bus.
- When an ACPI_NOTIFY_EJECT_REQUEST event posts, detach the device
  associated with the ACPI handle, invoke the _EJ0 method, and then
  delete the device.

Eventually this might be changed to vector notify events to devd in
userspace where devctl can be used instead to permit more complex
actions such as graceful unmounting of filesystems.

Tested by: cperciva
Reviewed by: cperciva, imp, scottl
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21948

4 years agoExport pci_attach() and pci_detach().
jhb [Tue, 15 Oct 2019 18:58:01 +0000 (18:58 +0000)]
Export pci_attach() and pci_detach().

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21948

4 years agoUse __FreeBSD_version to determine if gets() has been removed.
jhb [Tue, 15 Oct 2019 18:16:10 +0000 (18:16 +0000)]
Use __FreeBSD_version to determine if gets() has been removed.

GCC compilers set __FreeBSD__ statically to a build-time determined
targeted version (which in ports always matches the build host's
version).  This means that when building any version (12 or 13, etc.)
of riscv or some other architecture via GCC on a 12.x host,
__FreeBSD__ will always be set to 12.  As a result, __FreeBSD__ cannot
be used to reliably detect the target FreeBSD version being built.
Instead, __FreeBSD_version from either <sys/param.h> (in the kernel)
or <osreldate.h> (in userland) should be used.

This changes the gets() test in libc++ to use __FreeBSD_version from
<osreldate.h>.

Reported by: jenkins (riscv64 and amd64-gcc)
Reviewed by: dim, imp
Differential Revision: https://reviews.freebsd.org/D22034

4 years agocxgbe(4): An EQ update can be requested in a TX_PKTS2 work request.
np [Tue, 15 Oct 2019 17:35:39 +0000 (17:35 +0000)]
cxgbe(4): An EQ update can be requested in a TX_PKTS2 work request.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoUse -march=octeon+ for OCTEON1.
jhb [Tue, 15 Oct 2019 17:28:26 +0000 (17:28 +0000)]
Use -march=octeon+ for OCTEON1.

External binutils requires octeon+ for saa.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D22033

4 years agoFix dwmmc(4) driver attachment when ext_resources are not present.
br [Tue, 15 Oct 2019 17:24:21 +0000 (17:24 +0000)]
Fix dwmmc(4) driver attachment when ext_resources are not present.

Ignore only ENOENT (no DTS properties found) and ENODEV (driver not
present) non-zero return values from ext_resources.

Reviewed by: manu
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22043

4 years agoFix a write-only variable warning from external GCC.
jhb [Tue, 15 Oct 2019 17:17:16 +0000 (17:17 +0000)]
Fix a write-only variable warning from external GCC.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D22032

4 years agoDon't set the OUTPUT_FORMAT explicitly but let ld derive it.
jhb [Tue, 15 Oct 2019 17:14:30 +0000 (17:14 +0000)]
Don't set the OUTPUT_FORMAT explicitly but let ld derive it.

This fixes an error with modern ld.bfd and is inline with the changes in
r215251 and r217612.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D22031

4 years agoUpdate MIPS kernel builds to work with mips-gcc.
jhb [Tue, 15 Oct 2019 17:11:42 +0000 (17:11 +0000)]
Update MIPS kernel builds to work with mips-gcc.

- Use a default -march of mips64 on N64 and N32 kernels.
- Set the endianness (via MIPS_ENDIAN) and ABI (via MIPS_ABI) in
  CFLAGS from MACHINE_ARCH.  ARCH_FLAGS now only sets a different
  -march value if needed.
- TRAMP_ARCH_FLAGS inherits MIPS_ENDIAN from MACHINE_ARCH but does
  not set the ABI since XLPN32 needs an N64 ABI for the trampoline
  loader.  When TRAMP_ARCH_FLAGS is used it must set both -march
  and -mabi.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D22030

4 years agorpcgen: make compiler arglist allocation dynamic
brooks [Tue, 15 Oct 2019 16:05:17 +0000 (16:05 +0000)]
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)
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21971

4 years agofix up r353565, somehow a few files did not get committed
avg [Tue, 15 Oct 2019 15:52:01 +0000 (15:52 +0000)]
fix up r353565, somehow a few files did not get committed

MFC after: 3 weeks
X-MFC with: r353565

4 years agoRemove pfctlinput2(). It came from KAME and had never ever been in use.
glebius [Tue, 15 Oct 2019 15:40:03 +0000 (15:40 +0000)]
Remove pfctlinput2(). It came from KAME and had never ever been in use.

4 years agoMFV r353561: 10343 ZoL: Prefix all refcount functions with zfs_
avg [Tue, 15 Oct 2019 15:09:36 +0000 (15:09 +0000)]
MFV r353561: 10343 ZoL: Prefix all refcount functions with zfs_

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

https://www.illumos.org/issues/10343
  On the openzfs feature/porting matrix, this is listed as:
  prefix to refcount funcs/types
  Having these changes will make it easier to share other work across the
  different ZFS operating systems.
  PR 7963 424fd7c3e Prefix all refcount functions with zfs_
  PR 7885 & 7932 c13060e47 Linux 4.19-rc3+ compat: Remove refcount_t compat
  PR 5823 & 5842 4859fe796 Linux 4.11 compat: avoid refcount_t name conflict

Author: Tim Schumacher <timschumi@gmx.de>
Obtained from: illumos, ZoL
MFC after: 3 weeks

4 years agoMFV r353558: 10572 10579 Fix race in dnode_check_slots_free()
avg [Tue, 15 Oct 2019 14:29:18 +0000 (14:29 +0000)]
MFV r353558: 10572 10579 Fix race in dnode_check_slots_free()

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

10572 Fix race in dnode_check_slots_free()
https://www.illumos.org/issues/10572
  The Fix from ZoL:
  Currently, dnode_check_slots_free() works by checking dn->dn_type
  in the dnode to determine if the dnode is reclaimable. However,
  there is a small window of time between dnode_free_sync() in the
  first call to dsl_dataset_sync() and when the useraccounting code
  is run when the type is set DMU_OT_NONE, but the dnode is not yet
  evictable, leading to crashes. This patch adds the ability for
  dnodes to track which txg they were last dirtied in and adds a
  check for this before performing the reclaim.

  This patch also corrects several instances when dn_dirty_link was
  treated as a list_node_t when it is technically a multilist_node_t.

10579 Don't allow dnode allocation if dn_holds != 0
https://www.illumos.org/issues/10579
  The fix from ZoL:
  This patch simply fixes a small bug where dnode_hold_impl() could
  attempt to allocate a dnode that was in the process of being freed,
  but which still had active references. This patch simply adds the
  required check.

Author: Tom Caputi <tcaputi@datto.com>
Reported by: delphij
MFC after: 2 weeks
X-MFC with: r353176

4 years agoMFV r353551: 10452 ZoL: merge in large dnode feature fixes
avg [Tue, 15 Oct 2019 14:20:11 +0000 (14:20 +0000)]
MFV r353551: 10452 ZoL: merge in large dnode feature fixes

illumos/illumos-gate@946342a260bbae359b48bf142ec1fe40792ee862
https://github.com/illumos/illumos-gate/commit/946342a260bbae359b48bf142ec1fe40792ee862

https://www.illumos.org/issues/10452
  illumos is missing a few small follow up ZoL bug fixes for the large dnode
  feature. We should pull those in.
  Those commits are in the ZoL tree as (newest to oldest):
  PR 8435 - 75d6b7ddca269542279975f716a343bb40a79baf - Add missing copyright
  notice to large_dnode tests
  PR 7433 - e14a32b1c844d924b9f093375c0badcf10f61741 - Fix object reclaim when
  using large dnodes
  PR 6616 - 48fbb9ddbf2281911560dfbc2821aa8b74127315 - Free objects when
  receiving full stream as clone
  PR 6695 - 39f56627ae988d09b4e3803c01c22b2026b2310e - receive_freeobjects()
  skips freeing some object

Portions contributed by: Ned Bass <bass6@llnl.gov>
Portions contributed by: Tom Caputi <tcaputi@datto.com>
Author: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Obtained from: illumos, ZoL
MFC after: 2 weeks
X-MFC with: r353176

4 years agoThe two functions ifnet_byindex() and ifnet_byindex_locked() are exactly the
hselasky [Tue, 15 Oct 2019 12:08:09 +0000 (12:08 +0000)]
The two functions ifnet_byindex() and ifnet_byindex_locked() are exactly the
same after the network stack was epochified. Merge the two into one function
and cleanup all uses of ifnet_byindex_locked().

While at it:
- Add branch prediction macros.
- Make sure the ifnet pointer is only deferred once,
  also when code optimisation is disabled.

Sponsored by: Mellanox Technologies

4 years agoExclude the network link eventhandler from epochification after r353292.
hselasky [Tue, 15 Oct 2019 11:20:16 +0000 (11:20 +0000)]
Exclude the network link eventhandler from epochification after r353292.

This fixes the following assert when "options RATELIMIT" is used:
panic()
malloc()
sysctl_add_oid()
tcp_rl_ifnet_link()
do_link_state_change()
taskqueue_run_locked()

Sponsored by: Mellanox Technologies

4 years agoFix missing epochification of the LinuxKPI after r353292.
hselasky [Tue, 15 Oct 2019 11:14:14 +0000 (11:14 +0000)]
Fix missing epochification of the LinuxKPI after r353292.

Sponsored by: Mellanox Technologies

4 years agoFix missing epochification of the ibcore code after r353292.
hselasky [Tue, 15 Oct 2019 11:12:31 +0000 (11:12 +0000)]
Fix missing epochification of the ibcore code after r353292.

Sponsored by: Mellanox Technologies

4 years agoFix missing epochification of the ipoib code after r353292.
hselasky [Tue, 15 Oct 2019 11:11:21 +0000 (11:11 +0000)]
Fix missing epochification of the ipoib code after r353292.

Sponsored by: Mellanox Technologies

4 years agoExplicitly initialize the memory buffer to store O_ICMP6TYPE opcode.
ae [Tue, 15 Oct 2019 09:50:02 +0000 (09:50 +0000)]
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
MFC after: 3 days

4 years agoboot1.efi: provide generic exit() and stub getchar()
tsoome [Tue, 15 Oct 2019 08:33:05 +0000 (08:33 +0000)]
boot1.efi: provide generic exit() and stub getchar()

panic() is expecting us to have exit and getchar, lets provide those.

4 years agotests: basic VLAN test
kp [Tue, 15 Oct 2019 04:50:08 +0000 (04:50 +0000)]
tests: basic VLAN test

Set up two jails connected by an epair. Create VLAN interfaces in both
jails and check connectivity.

This is a very basic test, but exposed panics during the network stack
epoch work, so this is worth testing.

4 years ago(6/6) Convert pmap to expect busy in write related operations now that all
jeff [Tue, 15 Oct 2019 03:51:46 +0000 (03:51 +0000)]
(6/6) Convert pmap to expect busy in write related operations now that all
callers hold it.

This simplifies pmap code and removes a dependency on the object lock.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21596

4 years ago(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the
jeff [Tue, 15 Oct 2019 03:48:22 +0000 (03:48 +0000)]
(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the
object lock in vm_page_set_validclean().

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21595

4 years ago(4/6) Protect page valid with the busy lock.
jeff [Tue, 15 Oct 2019 03:45:41 +0000 (03:45 +0000)]
(4/6) Protect page valid with the busy lock.

Atomics are used for page busy and valid state when the shared busy is
held.  The details of the locking protocol and valid and dirty
synchronization are in the updated vm_page.h comments.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision:        https://reviews.freebsd.org/D21594

4 years ago(3/6) Add a shared object busy synchronization mechanism that blocks new page
jeff [Tue, 15 Oct 2019 03:41:36 +0000 (03:41 +0000)]
(3/6) Add a shared object busy synchronization mechanism that blocks new page
busy acquires while held.

This allows code that would need to acquire and release a very large number
of page busy locks to use the old mechanism where busy is only checked and
not held.  This comes at the cost of false positives but never false
negatives which the single consumer, vm_fault_soft_fast(), handles.

Reviewed by:    kib
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21592

4 years ago(2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep().
jeff [Tue, 15 Oct 2019 03:38:02 +0000 (03:38 +0000)]
(2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep().

This persists busy state across operations like rename and replace.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision:  https://reviews.freebsd.org/D21549

4 years agopowerpc/atomic: Fix atomic_cmpset_rel()
jhibbits [Tue, 15 Oct 2019 03:37:21 +0000 (03:37 +0000)]
powerpc/atomic: Fix atomic_cmpset_rel()

Need a release barrier, not an acquire barrier, else bad things happen.

4 years ago(1/6) Replace busy checks with acquires where it is trival to do so.
jeff [Tue, 15 Oct 2019 03:35:11 +0000 (03:35 +0000)]
(1/6) Replace busy checks with acquires where it is trival to do so.

This is the first in a series of patches that promotes the page busy field
to a first class lock that no longer requires the object lock for
consistency.

Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21548

4 years agoarm: allwinner: Add np and nmm clock file to the build
manu [Mon, 14 Oct 2019 22:29:20 +0000 (22:29 +0000)]
arm: allwinner: Add np and nmm clock file to the build

MFC after: 1 month

4 years agoarm64: Add Synopsys DWC3 driver
manu [Mon, 14 Oct 2019 22:27:33 +0000 (22:27 +0000)]
arm64: Add Synopsys DWC3 driver

This add a driver for the Synopsys DWC3 driver found on multiple SoCs.
It only supports host mode for now.

MFC after: 1 month

4 years agoarm64: allwinner: Add aw_dwc3 driver
manu [Mon, 14 Oct 2019 22:22:19 +0000 (22:22 +0000)]
arm64: allwinner: Add aw_dwc3 driver

This is a simplebus like driver that just deal with clocks and resets
and attach the dwc3 child node.

MFC after: 1 month

4 years agoarm64: allwinner: Add support for the usb3 phy
manu [Mon, 14 Oct 2019 21:58:46 +0000 (21:58 +0000)]
arm64: allwinner: Add support for the usb3 phy

The usb 3 controller in the H6 SoC have a dedicated phy.
Add support for it.
Mostly imported from NetBSD

MFC after: 1 month

4 years agoarm64: allwinner: aw_usbphy: Add support for H6 PHY
manu [Mon, 14 Oct 2019 21:56:41 +0000 (21:56 +0000)]
arm64: allwinner: aw_usbphy: Add support for H6 PHY

MFC after: 1 month

4 years agoarm64: allwinner: Add H6 GPIO/Pinctrl driver
manu [Mon, 14 Oct 2019 21:55:45 +0000 (21:55 +0000)]
arm64: allwinner: Add H6 GPIO/Pinctrl driver

This adds support for Allwinner H6 GPIO and pinctrl driver for
both the main pinctrl unit and the 'r_' one.

MFC after: 1 month

4 years agoarm64: allwinner: Add Allwinner H6 Support
manu [Mon, 14 Oct 2019 21:53:53 +0000 (21:53 +0000)]
arm64: allwinner: Add Allwinner H6 Support

This adds support for H6 SoC.
Add a CCU driver for H6 that support all PLLs and most of the clocks
that we are intersted in for now (i2c, mmc, usb, etc ...)

MFC after: 1 month

4 years agoarm: allwinner: Disable the clock before changing it's freq
manu [Mon, 14 Oct 2019 21:50:44 +0000 (21:50 +0000)]
arm: allwinner: Disable the clock before changing it's freq

You aren't supposed to changing the freq of a clock when it is
enable so disable the clock before changing the freq and then
re-enable it.

MFC after: 1 month

4 years agoarm64: allwinner: Add aw_clk_nmm clock
manu [Mon, 14 Oct 2019 21:49:07 +0000 (21:49 +0000)]
arm64: allwinner: Add aw_clk_nmm clock

This is a clock type present on Allwinner H6 where the formula is :
f = fparent * n / m0 / m1

MFC after: 1 month

4 years agoarm64: allwinner: Add new clock aw_clk_np
manu [Mon, 14 Oct 2019 21:47:20 +0000 (21:47 +0000)]
arm64: allwinner: Add new clock aw_clk_np

This is a clock type present in Allwinner H6 where the formula is :
f = fparent * N / P

MFC after: 1 month

4 years agoaw_ccung: Add more debug printfs
manu [Mon, 14 Oct 2019 21:45:15 +0000 (21:45 +0000)]
aw_ccung: Add more debug printfs

No functional changes

MFC after: 1 month

4 years agoDisconnect powerpc from the default tinderbox for now.
jhb [Mon, 14 Oct 2019 21:22:42 +0000 (21:22 +0000)]
Disconnect powerpc from the default tinderbox for now.

The wrong toolchain was set in MAKE_PARAMS_powerpc, however, there are
some other issues preventing powerpc from building in tinderbox:

1) There is no powerpc-gcc and powerpc-xtoolchain-gcc port that
   provides an external 32-bit powerpc GCC toolchain.

2) On other targets, the same toolchain can build all of the
   architectures for a given target.  MIPS achieves this by always
   setting -mabi and -EB/-EL explicitly instead of relying on the
   compiler's default architecture.  PowerPC might be able to do the
   same thing, but as of today, powerpc-gcc would be required for
   powerpc and powerpcspe and powerpc64-gcc would be required for
   powerpc64.  Our existing logic for make universe does not permit
   per-MACHINE_ARCH toolchains.

I tried hacking TARGETS_powerpc to only include powerpc64 when
powerpc64-gcc was present, and while that skipped the 32-bit worlds,
it tried to build all the kernels.

Reported by: jeff
Discussed with: imp

4 years agoif_delmulti() is never called without ifp argument, assert this instead
glebius [Mon, 14 Oct 2019 21:18:37 +0000 (21:18 +0000)]
if_delmulti() is never called without ifp argument, assert this instead
of doing a useless search through interfaces.

4 years agox86: Use canonical spelling of MOVDIR64B feature/instruction
cem [Mon, 14 Oct 2019 20:55:01 +0000 (20:55 +0000)]
x86: Use canonical spelling of MOVDIR64B feature/instruction

The former spelling probably confused MOVDIR64B with MOVDIRI64.

MOVDIR_64B is the 64-*byte* direct store instruction; MOVDIR_I64 is the
64-*bit* direct store instruction (underscores added here for clarity; they are
not part of the canonical instruction name).

No functional change.

Sponsored by: Dell EMC Isilon

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:33:14 +0000 (20:33 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: philip

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:32:28 +0000 (20:32 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoSeparate out SCTP related dtrace code.
tuexen [Mon, 14 Oct 2019 20:32:11 +0000 (20:32 +0000)]
Separate out SCTP related dtrace code.
This is based on work done by markj@.

Discussed with: markj@
MFC after: 3 days

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:32:08 +0000 (20:32 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:31:57 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:31:43 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:31:28 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:30:44 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:30:30 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:30:06 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:29:50 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:29:32 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:29:14 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:26:53 +0000 (20:26 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:26:17 +0000 (20:26 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:23:16 +0000 (20:23 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:22:25 +0000 (20:22 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:21:02 +0000 (20:21 +0000)]
Convert if_foreach_llmaddr() KPI.

Reviewed by: erj

4 years agoConvert to if_foreach_llmaddr() KPI.
glebius [Mon, 14 Oct 2019 20:18:36 +0000 (20:18 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: gallatin

4 years agoFix powerpc/powerpcspe builds
luporl [Mon, 14 Oct 2019 19:06:17 +0000 (19:06 +0000)]
Fix powerpc/powerpcspe builds

Revision 353489 introduced some new function calls in common powerpc code,
but these must be called only on powerpc64.

4 years agoRemove the aarch64 libclang_rt.profile library from llvm 8.0.1.
jhb [Mon, 14 Oct 2019 18:31:11 +0000 (18:31 +0000)]
Remove the aarch64 libclang_rt.profile library from llvm 8.0.1.

Reported by: np

4 years agoRemove an unused parameter from get_new_keyid().
jhb [Mon, 14 Oct 2019 18:02:56 +0000 (18:02 +0000)]
Remove an unused parameter from get_new_keyid().

4 years agoCorrect a transcription error that broke GENERIC introduced in r353496.
dougm [Mon, 14 Oct 2019 17:51:57 +0000 (17:51 +0000)]
Correct a transcription error that broke GENERIC introduced in r353496.

4 years agoMove the definition of _vm_map_assert_consistent so that it can use
dougm [Mon, 14 Oct 2019 17:15:42 +0000 (17:15 +0000)]
Move the definition of _vm_map_assert_consistent so that it can use
vm_map_free_{left,right} rather than re-implementing them.  Use the
VM_MAP_FOREACH macro where applicable.  Fix some indentation.

Suggested by: kib (in a comment on D21964)
Tested by: pho (as part of D21964)
Differential Revision: https://reviews.freebsd.org/D22011

4 years agoUse epoch(9) directly instead of obsoleted KPI.
glebius [Mon, 14 Oct 2019 16:37:41 +0000 (16:37 +0000)]
Use epoch(9) directly instead of obsoleted KPI.

4 years agoipfw(4) rule matching always happens in network epoch.
glebius [Mon, 14 Oct 2019 16:37:00 +0000 (16:37 +0000)]
ipfw(4) rule matching always happens in network epoch.

4 years agoFix the driver attachment in cases when the external resource devices
br [Mon, 14 Oct 2019 15:52:59 +0000 (15:52 +0000)]
Fix the driver attachment in cases when the external resource devices
(resets, regulators, clocks) are not available.

Rely on a system initialization done by a bootloader in that cases.

This fixes operation on Terasic DE10-Pro (an Intel Stratix 10
development kit).

Sponsored by: DARPA, AFRL

4 years agoin6ifa_llaonifp() is never called from fast path, so do not require
glebius [Mon, 14 Oct 2019 15:33:53 +0000 (15:33 +0000)]
in6ifa_llaonifp() is never called from fast path, so do not require
epoch being entered.