]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agonetmap: pkt-gen: fix compilation issue
Vincenzo Maffione [Tue, 15 Jun 2021 21:33:07 +0000 (21:33 +0000)]
netmap: pkt-gen: fix compilation issue

Remove stray characters preventing the source code from being
compiled.

Fixes: 20d684ecc9d7 ("pkt-gen: Allow limiting received packets").
Submitted by: ar_semihalf.com
Reviewed by: vmaffione
Differential Revision: <https://reviews.freebsd.org/D###>

3 years agofusefs: delete dead code
Alan Somers [Tue, 15 Jun 2021 19:34:01 +0000 (13:34 -0600)]
fusefs: delete dead code

Delete two fields in the per-mountpoint struct that have never been
used.

MFC after: 2 weeks
Sponsored by: Axcient

3 years agou3g: Note range of GOBI devices
Warner Losh [Tue, 15 Jun 2021 16:15:16 +0000 (10:15 -0600)]
u3g: Note range of GOBI devices

Qualcomm makes the GOBI devices, and gobi_loader port supports all the
Qualcomm GOBI 1000 and 2000 devices with the MDM1000 and MDM2000
chipsets. And likely the 3000 as well, though that's not been tested
on FreeBSD.

Submitted by: zarychtam@plan-b.pwste.edu.pl
Sponsored by: Netflix

3 years agoid: sanitize arguments better
Alan Somers [Fri, 11 Jun 2021 16:38:07 +0000 (10:38 -0600)]
id: sanitize arguments better

The -[AMc] flags ignore the user argument.  Better if id rejects
invocations that include a user argument along with any of those flags.

PR: 256554
MFC after: 2 weeks
Reviewed by: trasz
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D30734

3 years agocrypt_r(3): fix reentrancy problems with DES
Edward Tomasz Napierala [Tue, 15 Jun 2021 10:04:11 +0000 (11:04 +0100)]
crypt_r(3): fix reentrancy problems with DES

This code was originally written for non-reentrant crypt(3).
In 5f521d7ba72, a thread-safe crypt_r(3) was introduced.  However,
it looks like the DES implementation is still not re-entrant;
routines like setup_salt() or des_setkey() still use global
variables.

Instead of something drastic, eg removing DES support altogether,
just mark those variables as thread-local.  This adds about 30kB
of data per thread.

Given that this only applies to DES, I think the impact is minimal.

Reviewed By: markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30674

3 years agolinux: improve reporting for unsupported syscall flags
Edward Tomasz Napierala [Tue, 15 Jun 2021 09:18:04 +0000 (10:18 +0100)]
linux: improve reporting for unsupported syscall flags

Filter out the flags we do support; previously we would print
out the flag value verbatim.

Reviewed By: dchagin
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30693

3 years agostress2: Added a new verified syzkaller reproducer, update the exclude list and remov...
Peter Holm [Tue, 15 Jun 2021 05:33:58 +0000 (07:33 +0200)]
stress2: Added a new verified syzkaller reproducer, update the exclude list and remove a few syscalls from the ignore list

3 years agospl: Unbreak crossbuild after f20893853e8e
Jessica Clarke [Tue, 15 Jun 2021 00:23:04 +0000 (01:23 +0100)]
spl: Unbreak crossbuild after f20893853e8e

Summary:
f20893853e8e made getexecname no longer guarded by BOOTSTRAPPING, but it
does not build on non-FreeBSD as it tries to use KERN_PROC_PATHNAME and
related constants.

Reviewers: mm, imp

Reviewed By: imp

Subscribers: imp

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

3 years agoriscv: Add an hw.ncpu tunable to limit the number of cores
Jessica Clarke [Tue, 15 Jun 2021 00:21:38 +0000 (01:21 +0100)]
riscv: Add an hw.ncpu tunable to limit the number of cores

Based on a similar change to arm64 in 01a8235ea61c.

Reviewed by: mhorne
MRC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30655

3 years agomakefs: Cast daddr_t to off_t before multiplication
Nathaniel Filardo [Tue, 15 Jun 2021 00:18:36 +0000 (01:18 +0100)]
makefs: Cast daddr_t to off_t before multiplication

Apparently some large-file systems out there, such as my powerpc64le
Linux box, define daddr_t as a 32-bit type, which is sad and stymies
cross-building disk images.  Cast daddr_t to off_t before doing
arithmetic that overflows.

Reviewed by: arichardson, jrtc27, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27458

3 years agorelnotes: fix wording for gconcat entry.
Warner Losh [Mon, 14 Jun 2021 23:52:47 +0000 (17:52 -0600)]
relnotes: fix wording for gconcat entry.

3 years agobsd.cpu.mk: Correct MACHINE_CPU for Intel Alder Lake
Jung-uk Kim [Mon, 14 Jun 2021 23:06:03 +0000 (19:06 -0400)]
bsd.cpu.mk: Correct MACHINE_CPU for Intel Alder Lake

Apparently Intel Alder Lake lacks AVX-512 instructions.

Fixes: 09e7341c5ea4 "Catch up with Clang 12"

3 years agoCatch up with Clang 12.
Jung-uk Kim [Mon, 14 Jun 2021 22:42:59 +0000 (18:42 -0400)]
Catch up with Clang 12.

Add "znver3" for AMD and "alderlake" and "sapphirerapids" for Intel.

3 years agocpucontrol: fix extended signature matching code to avoid fallthough
Dan Nelson [Mon, 14 Jun 2021 19:28:16 +0000 (15:28 -0400)]
cpucontrol: fix extended signature matching code to avoid fallthough

PR: 256502
MFC after: 1 week

3 years agoConsistently use the SOCKBUF_MTX() and SOCK_MTX() macros
Mark Johnston [Mon, 14 Jun 2021 21:32:32 +0000 (17:32 -0400)]
Consistently use the SOCKBUF_MTX() and SOCK_MTX() macros

This makes it easier to change the socket locking protocols.  No
functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoConsistently use the SOLISTENING() macro
Mark Johnston [Mon, 14 Jun 2021 21:32:27 +0000 (17:32 -0400)]
Consistently use the SOLISTENING() macro

Some code was using it already, but in many places we were testing
SO_ACCEPTCONN directly.  As a small step towards fixing some bugs
involving synchronization with listen(2), make the kernel consistently
use SOLISTENING().  No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoamd64: Fix propagation of LDT updates
Mark Johnston [Mon, 14 Jun 2021 21:32:18 +0000 (17:32 -0400)]
amd64: Fix propagation of LDT updates

When a process has used sysarch(2) to specify descriptors for its
private LDT, upon rfork(RFMEM) descriptors are copied into the new child
process.  Any updates to the descriptors are thus reflected to all other
processes sharing the vmspace.  However, this is incorrect in the rather
obscure case where the child process was created before the LDT was
modified.  Fix this by only modifying other processes which already
share the LDT.

Reported by: syzkaller
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agogconcat: Add some simple regression tests for the new append verb
Mark Johnston [Mon, 14 Jun 2021 19:18:49 +0000 (15:18 -0400)]
gconcat: Add some simple regression tests for the new append verb

Sponsored by: The FreeBSD Foundation

3 years agoExport various 128 bit long double functions from libgcc_s.so.1
Dimitry Andric [Mon, 14 Jun 2021 19:17:05 +0000 (21:17 +0200)]
Export various 128 bit long double functions from libgcc_s.so.1

These were already compiled for some time on aarch64 and riscv, by
including lib/libcompiler_rt/Makefile.inc, but never exported in the
shared library. Since gcc exports these under version GCC_4.6.0, we do
the same.

This review should replace D11482 for now. For e.g. amd64 more work is
still to be done, as compiler-rt does not seem to support 128 bit long
double math for that architecture.

Reviewed by: cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28690

3 years agoarm: allwinner: Add mmc_pwrseq support
Emmanuel Vadot [Wed, 26 May 2021 11:13:33 +0000 (13:13 +0200)]
arm: allwinner: Add mmc_pwrseq support

If a pwrseq is found, set power accordingly.

Sponsored by: Diablotin Systems

3 years agoarm: allwinner: dtb: Add overlays to disable SD/MMC node
Emmanuel Vadot [Wed, 26 May 2021 10:58:50 +0000 (12:58 +0200)]
arm: allwinner: dtb: Add overlays to disable SD/MMC node

Useful for dev

Sponsored by: Diablotin Systems

3 years agoApply upstream libc++ fix to allow building with devel/xxx-xtoolchain-gcc
Dimitry Andric [Mon, 14 Jun 2021 18:44:09 +0000 (20:44 +0200)]
Apply upstream libc++ fix to allow building with devel/xxx-xtoolchain-gcc

Merge commit 52e9d80d5db2 from llvm git (by Jason Liu):

  [libc++] add `inline` for __open's definition in ifstream and ofstream

  Summary:

  When building with gcc on AIX, it seems that gcc does not like the
  `always_inline` without the `inline` keyword.
  So adding the inline keywords in for __open in ifstream and ofstream.
  That will also make it consistent with __open in basic_filebuf
  (it seems we added `inline` there before for gcc build as well).

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

PR: 255570
MFC after: 6 weeks

3 years agogconcat append: should be in release notes
Warner Losh [Mon, 14 Jun 2021 17:45:11 +0000 (11:45 -0600)]
gconcat append: should be in release notes

Note that d575e81fbcfa should be in the release notes. First cut at some
useable text.

3 years agogconcat: Implement new online append feature
Noah Bergbauer [Sun, 27 Dec 2020 21:09:38 +0000 (22:09 +0100)]
gconcat: Implement new online append feature

Implement the "gconcat append" command which can be used
to append a disk to the end of an existing gconcat device
without unmounting.

If the gconcat device is using the "automatic" method, i.e.,
stores metadata on the devices, new metadata is written
to all existing components, as well as to the newly added one.

Pull Request: https://github.com/freebsd/freebsd-src/pull/472
Reviewed by: imp@

3 years agoDisable strict-fp for powerpcspe, as it does not work properly yet
Dimitry Andric [Mon, 14 Jun 2021 13:47:53 +0000 (15:47 +0200)]
Disable strict-fp for powerpcspe, as it does not work properly yet

Merge commit 5c18d1136665 from llvm git (by Qiu Chaofan)

  [SPE] Disable strict-fp for SPE by default

  As discussed in PR50385, strict-fp on PowerPC SPE has not been
  handled well. This patch disables it by default for SPE.

  Reviewed By: nemanjai, vit9696, jhibbits

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

PR: 255570
MFC after: 6 weeks

3 years agoReduce code duplication in machine/_types.h
Alex Richardson [Mon, 14 Jun 2021 10:18:51 +0000 (10:18 +0000)]
Reduce code duplication in machine/_types.h

Many of these typedefs are the same across all architectures or can
be set based on an architecture-independent compiler-provided macro
(e.g. __SIZEOF_SIZE_T__). These macros have been available since GCC 4.6
and Clang sometime before 3.0 (godbolt.org does not have any older clang
versions installed).

I originally considered using the compiler-provided `__FOO_TYPE__` directly.
However, in order to do so we have to check that those match the previous
typedef exactly (not just that they have the same size) since any change
would be an ABI break. For example, changing `long` to `long long` results
in different C++ name mangling. Additionally, Clang and GCC disagree on
the underlying type for some of (u)int*_fast_t types, so this change
only moves the definitions that are identical across all architectures
and does not touch those types.

This de-deduplication will allow us to have a smaller diff downstream in
CheriBSD: we only have to only change the (u)intptr_t definition in
sys/_types.h in CheriBSD instead of having to change machine/_types.h for
all CHERI-enabled architectures (currently RISC-V, AArch64 and MIPS).

Reviewed By: imp, kib
Differential Revision: https://reviews.freebsd.org/D29895

3 years agoAdd more GIC and GICv3 registers
Andrew Turner [Mon, 14 Jun 2021 12:48:53 +0000 (12:48 +0000)]
Add more GIC and GICv3 registers

These aren't used by either driver, however they will be needed by
bhyve on arm64 to emulate a GICv3 interrupt controller.

Sponsored by: Innovate UK

3 years agoUse the correct length when copying arm64 vfp registers
Andrew Turner [Mon, 14 Jun 2021 11:01:46 +0000 (11:01 +0000)]
Use the correct length when copying arm64 vfp registers

We passed the wrong length into memcpy in the arm64 get_fpcontext and
set_fpcontext. This caused us to copy two status registers we didn't
expect to copy.

These are safe as they exist in both the source and destination, although
in a different order, and we copy the correct values after the memcpy.

Obtained from: CheriBSD
Sponsored by: Innovate UK

3 years agoktls: Fix interaction with RATELIMIT
Andrew Gallatin [Mon, 14 Jun 2021 14:46:13 +0000 (10:46 -0400)]
ktls: Fix interaction with RATELIMIT

uipc_ktls.c was missing opt_ratelimit.h, so it was
never noticing that RATELIMIT was enabled.  Once it was
enabled, it failed to compile as  ktls_modify_txrtlmt()
had accrued a compilation error when it was not being
compiled in.

Sponsored by: Netflix

3 years agonetgraph/bridge: malloc without flags
Lutz Donnerhacke [Sun, 13 Jun 2021 22:00:35 +0000 (00:00 +0200)]
netgraph/bridge: malloc without flags

During tests an assert was triggered and pointed to missing flags in
the newlink function of ng_bridge(4).

Reported by: markj
Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30759

3 years agopf: store L4 headers in pf_pdesc
Kristof Provost [Fri, 4 Jun 2021 08:52:07 +0000 (10:52 +0200)]
pf: store L4 headers in pf_pdesc

Rather than pointers to the headers store full copies. This brings us
slightly closer to what OpenBSD does, and also makes more sense than
storing pointers to stack variable copies of the headers.

Reviewed by: donner, scottl
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30719

3 years agopf: don't hold a lock during copyout()
Kristof Provost [Mon, 14 Jun 2021 12:04:02 +0000 (14:04 +0200)]
pf: don't hold a lock during copyout()

copyout() can trigger page faults, so it may potentially sleep.

Reported by: avg
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agomake.conf: DOC_LANG and PRINTERDEVICE clarifications in man and example
Ceri Davies [Mon, 14 Jun 2021 08:53:34 +0000 (09:53 +0100)]
make.conf: DOC_LANG and PRINTERDEVICE clarifications in man and example

3 years agoarm: TI am335x ehrpwm fix bitmask
Oskar Holmlund [Mon, 14 Jun 2021 08:38:06 +0000 (10:38 +0200)]
arm: TI am335x ehrpwm fix bitmask

Bitfield HSPCLKDIV and CLKDIV are 3 bit wide.
Chapter 15.2.4.1 https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf

Approved by: manu (mentor)
Reported by: Stefan Forsberg
Differential revision: https://reviews.freebsd.org/D30746

3 years agowpa: The ap library is not needed by wpa_supplicant or wpa_cli
Cy Schubert [Sat, 12 Jun 2021 23:51:51 +0000 (16:51 -0700)]
wpa: The ap library is not needed by wpa_supplicant or wpa_cli

The ap library is not needed by wpa_supplicant or wpa_cli. It is only
used by hostapd.

MFC after: 2 months

3 years agou3g: Add reference to gobi_loader port
Warner Losh [Mon, 14 Jun 2021 04:18:07 +0000 (22:18 -0600)]
u3g: Add reference to gobi_loader port

The gobi_loader port has been committed. Add a reference to it instead
of the upstream project since the port has changes needed to run on
FreeBSD that aren't yet part of upstream.

Sponsored by: Netflix

3 years agobhyve: enhance debug info for memory range clash
Robert Crowston [Sat, 10 Apr 2021 19:16:02 +0000 (20:16 +0100)]
bhyve: enhance debug info for memory range clash

Explain what the two clashing regions are.

Reivewed by: grehan, jhb
Differential Revision: https://reviews.freebsd.org/D29696
Pull Request: https://github.com/freebsd/freebsd-src/pull/463

3 years agotests/netgraph: Check for PR241954
Lutz Donnerhacke [Thu, 10 Jun 2021 09:54:31 +0000 (11:54 +0200)]
tests/netgraph: Check for PR241954

Add tests to check for renaming issues reported in PR241954 and solved
in D30110.

MFC: Together with D30629
Differential Revision: https://reviews.freebsd.org/D30713

3 years agotests/netgraph: Missed fixup after D30699
Lutz Donnerhacke [Thu, 10 Jun 2021 10:21:14 +0000 (12:21 +0200)]
tests/netgraph: Missed fixup after D30699

During D30699 the existing basic tests were missed.  Furthermore
debugging output was still in the code, which is removed now.

MFC: together with D30699
Differential Revision: https://reviews.freebsd.org/D30714

3 years agoMerge llvm-project 12.0.0 release
Dimitry Andric [Mon, 26 Apr 2021 11:23:24 +0000 (13:23 +0200)]
Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR: 255570
MFC after: 6 weeks

3 years agoMerge llvm-project main llvmorg-12-init-17869-g8e464dd76bef
Dimitry Andric [Sun, 13 Jun 2021 19:31:46 +0000 (21:31 +0200)]
Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR: 255570
MFC after: 6 weeks

3 years agou3g: Document Panasonic CF-F9 GOBI support
Warner Losh [Sun, 13 Jun 2021 16:14:54 +0000 (10:14 -0600)]
u3g: Document Panasonic CF-F9 GOBI support

Document that the u3g driver supports the Panasonic CF-F9 GOBI. Note
that gobi_loader is needed and give URL for that. There is a separate
review for during a related version into a port at D22938, but it seems
stalled. I'll update the docs when it arrives in ports.

Sponsored by: Netflix

3 years agoUSB/U3G: Added Panasonic CF-F9 GOBI 3G modem to U3G module.
CeDeROM Tomasz CEDRO [Sun, 13 Jun 2021 16:08:42 +0000 (10:08 -0600)]
USB/U3G: Added Panasonic CF-F9 GOBI 3G modem to U3G module.

Add kernel support for the Panasonic GOBI 3g modem.

Note: GOBI modems require QDL firmware to be uploaded with gobi_loader:
https://github.com/cederom/gobi_loader.

Signed-off-by: CeDeROM Tomasz CEDRO <tomek@cedro.info>
Pull Request: https://github.com/freebsd/freebsd-src/pull/115
Reviewed by: imp (split off kernel bits from original)

3 years agosg: get rid of unused include.
Dmitry Chagin [Sun, 13 Jun 2021 08:30:49 +0000 (11:30 +0300)]
sg: get rid of unused include.

sg driver does not depends on the Linuxulator any more.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D30750
MFC after: 2 weeks

3 years agosyslogd: fix WITHOUT_INET builds
Artem Khramov [Sat, 12 Jun 2021 17:21:13 +0000 (20:21 +0300)]
syslogd: fix WITHOUT_INET builds

Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or
`WITHOUT_INET6` build variables set, because `iovlist_truncate` is not
defined but used.

This change wraps the problematic `iovlist_truncate` call within ifdef
directive.  It's compiled out in this situation...

Pull Request: https://github.com/freebsd/freebsd-src/pull/475
Reviewed by: imp@ (commit message slightly tweaked)

3 years agoupdating: note recent removals
Warner Losh [Sun, 13 Jun 2021 04:21:28 +0000 (22:21 -0600)]
updating: note recent removals

3 years agozfs: change zstream -> zstreamdump link into a symlink
Martin Matuska [Sun, 13 Jun 2021 03:17:15 +0000 (05:17 +0200)]
zfs: change zstream -> zstreamdump link into a symlink

3 years agozfs: fix invalid entries in ObsoleteFiles.inc added in 3ff01b231
Martin Matuska [Sun, 13 Jun 2021 03:17:15 +0000 (05:17 +0200)]
zfs: fix invalid entries in ObsoleteFiles.inc added in 3ff01b231

3 years agozfs: merge openzfs/zfs@afa7b3484 (master) into main
Martin Matuska [Sun, 13 Jun 2021 02:03:58 +0000 (04:03 +0200)]
zfs: merge openzfs/zfs@afa7b3484 (master) into main

Notable upstream pull request merges:
  #12149: Multiple man-pages: Move to appropriate section
  #12158: Re-embed multilist_t storage
  #12191: Convert non-libzpool libraries to -fvisibility=hidden
  #12196: Unify manpage makefiles, move pages to better sexions, ...
  #12210: libzutil: import filtering optimisation
  #12212: Remove pool io kstats

Obtained from: OpenZFS
OpenZFS commit: afa7b3484556d3ae610a34582ce5ebd2c3e27bba

3 years agoRemove an(4) leftover from conf/NOTES
Mateusz Guzik [Sat, 12 Jun 2021 08:48:41 +0000 (08:48 +0000)]
Remove an(4) leftover from conf/NOTES

Unbreaks LINT kernels.

3 years agoarm: ti am335x ehrpwm add support for flags (PWM_POLARITY_INVERTED)
Oskar Holmlund [Sat, 12 Jun 2021 08:54:31 +0000 (10:54 +0200)]
arm: ti am335x ehrpwm add support for flags (PWM_POLARITY_INVERTED)

Add support for invert the polarity of the PWM signal.
Cleanup and add comments in the initialization code.
Add and fix register defines.

Approved by: manu (mentor)
Differential revision: https://reviews.freebsd.org/D29547

3 years agoarm: ti am335x ehrpwm remove sysctl interface
Oskar Holmlund [Sat, 12 Jun 2021 08:24:55 +0000 (10:24 +0200)]
arm: ti am335x ehrpwm remove sysctl interface

To minimize the maintenance time of this driver when new features
are added the legacy sysctl interface has to go.

Approved by: manu (mentor)
Reviewed by: Dr. Rolf Jansen (freebsd-rj_obsigna.com)
Differential revision: https://reviews.freebsd.org/D29546

3 years agoUPDATING: Add entry for __FreeBSD_version bump to 1400022
Rick Macklem [Sat, 12 Jun 2021 01:59:36 +0000 (18:59 -0700)]
UPDATING: Add entry for __FreeBSD_version bump to 1400022

3 years agoparam.h: Bump __FreeBSD_version to 1400022
Rick Macklem [Sat, 12 Jun 2021 01:53:02 +0000 (18:53 -0700)]
param.h: Bump __FreeBSD_version to 1400022

Commit e1a907a25cfa changed the internal KAPI between the krpc
and nfsserver.  As such, both modules must be rebuilt from
sources.  Bump __FreeBSD_version to 1400022.

3 years agobhyve vtblk: Inform guests of disk resize events.
John Baldwin [Sat, 12 Jun 2021 00:59:46 +0000 (17:59 -0700)]
bhyve vtblk: Inform guests of disk resize events.

Register a resize callback with the blockif interface.  When the
callback fires, update the size of the disk and notify the guest via a
configuration change interrupt.

Reviewed by: grehan, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30506

3 years agobhyve: Split out a lower-level helper for VirtIO interrupts.
John Baldwin [Sat, 12 Jun 2021 00:59:35 +0000 (17:59 -0700)]
bhyve: Split out a lower-level helper for VirtIO interrupts.

This allows device models to assert VirtIO interrupts for reasons
other than publishing changes to a VirtIO ring such as configuration
changes.

Reviewed by: grehan, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30505

3 years agobhyve: Add support for handling disk resize events to block_if.
John Baldwin [Sat, 12 Jun 2021 00:59:25 +0000 (17:59 -0700)]
bhyve: Add support for handling disk resize events to block_if.

Allow clients of blockif to register a resize callback handler.  When
a callback is registered, register an EVFILT_VNODE kevent watching the
backing store for a change in the file's attributes.  If the size has
changed when the kevent fires, invoke the clients' callback.

Currently resize detection is limited to backing stores that support
EVFILT_VNODE kevents such as regular files.

Reviewed by: grehan, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30504

3 years agobhyve: Add support for EVFILT_VNODE mevents.
John Baldwin [Sat, 12 Jun 2021 00:59:13 +0000 (17:59 -0700)]
bhyve: Add support for EVFILT_VNODE mevents.

This allows registering an event to watch for changes to a file's
attributes.  This is a bit imperfect as it would be nice to have a way
to determine if an fd can use EVFILT_VNODE successfully.  mevent's
current structure does not permit that and a failure to register a
single kevent impacts several other kevents.

Reviewed by: grehan, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30503

3 years agobhyve: Register new kevents synchronously.
John Baldwin [Sat, 12 Jun 2021 00:58:54 +0000 (17:58 -0700)]
bhyve: Register new kevents synchronously.

Change mevent_add*() to synchronously add the new kevent.  This
permits reporting event registration failures to the caller and avoids
failing the registration of other, unrelated events queued up in the
same batch.

Reviewed by: grehan, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30502

3 years agoDo not hash unlinked inodes
Paul Zuchowski [Sat, 12 Jun 2021 00:00:33 +0000 (20:00 -0400)]
Do not hash unlinked inodes

In zfs_znode_alloc we always hash inodes.  If the
znode is unlinked, we do not need to hash it.  This
fixes the problem where zfs_suspend_fs is doing zrele
(iput) in an async fashion, and zfs_resume_fs unlinked
drain processing will try to hash an inode that could
still be hashed, resulting in a panic.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #9741
Closes #11223
Closes #11648
Closes #12210

3 years agokrpc: Acquire ref count of CLIENT for backchannel use
Rick Macklem [Fri, 11 Jun 2021 23:57:14 +0000 (16:57 -0700)]
krpc: Acquire ref count of CLIENT for backchannel use

Michael Dexter <editor@callfortesting.org> reported
a crash in FreeNAS, where the first argument to
clnt_bck_svccall() was no longer valid.
This argument is a pointer to the callback CLIENT
structure, which is free'd when the associated
NFSv4 ClientID is free'd.

This appears to have occurred because a callback
reply was still in the socket receive queue when
the CLIENT structure was free'd.

This patch acquires a reference count on the CLIENT
that is not CLNT_RELEASE()'d until the socket structure
is destroyed. This should guarantee that the CLIENT
structure is still valid when clnt_bck_svccall() is called.
It also adds a check for closed or closing to
clnt_bck_svccall() so that it will not process the callback
RPC reply message after the ClientID is free'd.

Comments by: mav
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30153

3 years agoan: Remove driver
Olivier Houchard [Fri, 11 Jun 2021 23:08:54 +0000 (01:08 +0200)]
an: Remove driver

Now that an(4) is gone, remove it from GENERIC kernel config files.

Reported by: flo

3 years agosrc.conf.5: Regen for svnlite removal.
John Baldwin [Fri, 11 Jun 2021 21:57:51 +0000 (14:57 -0700)]
src.conf.5: Regen for svnlite removal.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30738

3 years agoRemove svnlite.
John Baldwin [Fri, 11 Jun 2021 21:56:41 +0000 (14:56 -0700)]
Remove svnlite.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30737

3 years agoRemove 'make update'.
John Baldwin [Fri, 11 Jun 2021 21:56:28 +0000 (14:56 -0700)]
Remove 'make update'.

In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts.  With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'.  With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30736

3 years agoRemove an manpage
Warner Losh [Fri, 11 Jun 2021 20:40:13 +0000 (14:40 -0600)]
Remove an manpage

3 years agomtk: Add printing of CPU model
Warner Losh [Fri, 11 Jun 2021 20:13:31 +0000 (14:13 -0600)]
mtk: Add printing of CPU model

Add the line that's in other foo_machdep.c file where the CPU model is
reported.

This was part of github pull request 459, but in a different way. The
rest of that pull request was either committed or not relevant. I did it
in a more correct way.

Submitted by: Priit Trees
Sponsored by: Netflix

3 years agomtk: Initialize mask correctly.
Priit Trees [Fri, 11 Jun 2021 20:12:08 +0000 (14:12 -0600)]
mtk: Initialize mask correctly.

Initialization of mask is missing. Fixes a compile issue.

Reviewed by: imp@
Pull Request: https://github.com/freebsd/freebsd-src/pull/459

3 years agoChange "compiled" to "assembled"
Warner Losh [Fri, 11 Jun 2021 19:58:51 +0000 (13:58 -0600)]
Change "compiled" to "assembled"

Assembly files are assembled, not compiled.

Submitted by: github user gAlfonso-bit
Pull Request: https://github.com/freebsd/freebsd-src/pull/474

Sponsored by: Netflix

3 years agobsdinstall: Allow automation in jails
eoli3n [Mon, 7 Jun 2021 20:49:02 +0000 (22:49 +0200)]
bsdinstall: Allow automation in jails

Set SCRIPT=/path/to/script env var to be able to automate bsdinstall to
a jail.

Pull Request: https://github.com/freebsd/freebsd-src/pull/473
Reviewed by: allanjude

3 years agoancontrol: Remove an(4) utility
Emmanuel Vadot [Mon, 7 Jun 2021 16:48:57 +0000 (18:48 +0200)]
ancontrol: Remove an(4) utility

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30680
Reviewed by: imp (earlier version), emaste (earlier version)
Sponsored by: Diablotin Systems

3 years agoan: Remove driver
Emmanuel Vadot [Mon, 7 Jun 2021 16:48:00 +0000 (18:48 +0200)]
an: Remove driver

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30679
Reviewed by: imp (earlier version), emaste (earlier version)
Sponsored by: Diablotin Systems

3 years agoan: Deprecate the driver
Emmanuel Vadot [Mon, 7 Jun 2021 16:45:58 +0000 (18:45 +0200)]
an: Deprecate the driver

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30678
Reviewed by: imp (earlier version), adrian (earlier version)
MFC after: 3 days
Sponsored by: Diablotin Systems

3 years agoarm64: allwinner: Add i2s and codec support
Oleksandr Tymoshenko [Thu, 13 May 2021 19:10:38 +0000 (21:10 +0200)]
arm64: allwinner: Add i2s and codec support

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

3 years agoarm64: Add Soc audio framework
Oleksandr Tymoshenko [Thu, 13 May 2021 19:09:50 +0000 (21:09 +0200)]
arm64: Add Soc audio framework

This framework is initial implementation of the simple-audio-card compatible
audio driver framework. It provides glue for CPU/codec/aux device.

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

3 years agotcp: remove debug output from RACK
Michael Tuexen [Fri, 11 Jun 2021 13:43:38 +0000 (15:43 +0200)]
tcp: remove debug output from RACK

Reported by: iron.udjin@gmail.com, Marek Zarychta
Reviewed by: rrs
PR: 256538
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30723
Sponsored by: Netflix, Inc.

3 years agostyle: Relax 80 column rule
Warner Losh [Fri, 11 Jun 2021 16:37:36 +0000 (10:37 -0600)]
style: Relax 80 column rule

Note that the 80 column rule has been relaxed for some time when things
are clearer when a little longer. Add in that things that people grep
for, such as error messages, shouldn't be broken up which is the most
common reason people exceed 80 columns intentionally.

Reviewed by: jhb, domagoj.stolfa@gmail.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30255

3 years agostyle: tweak tab after #define advice
Warner Losh [Fri, 11 Jun 2021 16:33:04 +0000 (10:33 -0600)]
style: tweak tab after #define advice

Once upon a time, #define<tab> was cultural thing. However, even when it
was promulgated, it was a minority usage. 20 years ago the split was
30k/69k (tab/space) and today the split is 80k/546k (tab/space). Update
guidance to allow either with the usual suggestion to be consistent
within a file.

Reviewed by: sef, allenjude, 0mp (prior rev), jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30254

3 years agoscripts/commitcheck.sh: fix false positive for signed commits
наб [Thu, 3 Jun 2021 17:40:09 +0000 (19:40 +0200)]
scripts/commitcheck.sh: fix false positive for signed commits

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agoForbid basename(3) and dirname(3)
наб [Sat, 22 May 2021 15:19:14 +0000 (17:19 +0200)]
Forbid basename(3) and dirname(3)

There are at least two interpretations of basename(3),
in addition to both functions being allowed to /both/ return a static
buffer (unsuitable in multi-threaded environments) /and/ raze the input
(which encourages overallocations, at best)

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agolibzutil: import: filter out unsuitable files earlier
наб [Sat, 22 May 2021 14:29:53 +0000 (16:29 +0200)]
libzutil: import: filter out unsuitable files earlier

Only accept the right type of file, if available, and reject too-small
files before opening them on Linux

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agolinux/libzutil: zpool_open_func: don't dup name, extract untouchables
наб [Sat, 22 May 2021 14:26:40 +0000 (16:26 +0200)]
linux/libzutil: zpool_open_func: don't dup name, extract untouchables

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agolibzutil: add zfs_{base,dir}name()
наб [Thu, 3 Jun 2021 15:17:09 +0000 (17:17 +0200)]
libzutil: add zfs_{base,dir}name()

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agolinux/libzutil: use ARRAY_SIZE instead of constant for search paths
наб [Sat, 22 May 2021 14:23:59 +0000 (16:23 +0200)]
linux/libzutil: use ARRAY_SIZE instead of constant for search paths

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105

3 years agolibnv: optimize nvlist size calculation
Mariusz Zaborski [Fri, 11 Jun 2021 15:35:36 +0000 (17:35 +0200)]
libnv: optimize nvlist size calculation

If we had a multiple nvlist, during nvlist_pack, we calculated the size
of every nvlist separately. For example, if we had a nvlist with three
nodes each containing another (A contains B, and B contains C), we first
calculated the size of nvlist A (which contains B, C), then we calculate
the size of B (which contains C, notice that we already did the
calculation of B, when we calculate A), and finally C. This means that
this calculation was O(N!). This was done because each time we pack
nvlist, we have to put its size in the header
(the separate header for A, B, and C).

To not break the ABI and to reduce the complexity of nvlist_size,
instead of calculating the nvlist size when requested,
we track the size of each nvlist.

Reported by: pjd, kp
Tested by: kp

3 years agoAdded uncompress requirement
Rich Ercolani [Fri, 11 Jun 2021 15:38:23 +0000 (11:38 -0400)]
Added uncompress requirement

Having an old enough version of "file" and no "uncompress" program
installed can cause rpmbuild as root to crash and mangle rpmdb.

So let's add a build dependency for RPM-based systems.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes: #12071
Closes: #12168
3 years agotcp: Missing mfree in rack and bbr
Randall Stewart [Fri, 11 Jun 2021 15:38:08 +0000 (11:38 -0400)]
tcp: Missing mfree in rack and bbr

Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and
then not including a timestamp. This involved in the input path doing a goto done_with_input
label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN.
This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this
missing m_freem() but rack did not). This then caused the missing m_freem to show
up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs
later (after processing) is not a good idea, even though its only for logging. Best to
copy that off before any frees can take place.

Reviewed by: mtuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30727

3 years agoZTS: Add zfs_clone_livelist_dedup.ksh to Makefile.am
Brian Behlendorf [Fri, 11 Jun 2021 15:21:36 +0000 (08:21 -0700)]
ZTS: Add zfs_clone_livelist_dedup.ksh to Makefile.am

Commit 86b5f4c12 added a new zfs_clone_livelist_dedup.ksh test case
but didn't include it in the Makefile.am.  This results in the test
not being included in the dist tarball so it's never run by the CI.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #12224
3 years agoImprove handling of USB device re-open in the LibUSB v1.x API.
Hans Petter Selasky [Fri, 11 Jun 2021 15:06:10 +0000 (17:06 +0200)]
Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Found by: sergii.dmytruk@3mdeb.com
PR: 256296
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agotcp: fix two bugs in new reno
Michael Tuexen [Fri, 11 Jun 2021 13:37:39 +0000 (15:37 +0200)]
tcp: fix two bugs in new reno

* Completely initialise the CC module specific data
* Use beta_ecn in case of an ECN event whenever ABE is enabled
  or it is requested by the stack.

Reviewed by: rscheff, rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.

3 years agoAdd new USB ID to u3g(4).
Hans Petter Selasky [Fri, 11 Jun 2021 10:53:22 +0000 (12:53 +0200)]
Add new USB ID to u3g(4).

Submitted by: pierre-jean.gineste@nuabee.fr
PR: 231909
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agotcp: fix compilation of IPv4-only builds
Michael Tuexen [Fri, 11 Jun 2021 07:50:46 +0000 (09:50 +0200)]
tcp: fix compilation of IPv4-only builds

PR: 256538
Reported by: iron.udjin@gmail.com
MFC after: 3 days
Sponsored by: Netflix, Inc.

3 years agospl: Fix gcc6 build
Warner Losh [Fri, 11 Jun 2021 03:28:52 +0000 (21:28 -0600)]
spl: Fix gcc6 build

-Wno-error= is only a clang flag, restrict its use to only clang.

Sponsored by: Netflix

3 years agotools: Remove obsolete svn information.
Warner Losh [Fri, 11 Jun 2021 00:50:46 +0000 (18:50 -0600)]
tools: Remove obsolete svn information.

Reviewed by: jhb@
Differential Revision: https://reviews.freebsd.org/D30720
Sponsored by: Netflix

3 years agotests/sys/netpfil: Move common tests out from behind MK_PF.
Brad Davis [Thu, 10 Jun 2021 23:01:53 +0000 (17:01 -0600)]
tests/sys/netpfil: Move common tests out from behind MK_PF.

Approved by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agozfs: unbreak build with clang 12
Martin Matuska [Thu, 10 Jun 2021 23:31:56 +0000 (01:31 +0200)]
zfs: unbreak build with clang 12

Change -Wno-error-atomic-alignment to -Wno-error=atomic-alignment
in the Makefile of libspl.

Reported by: Ed Maste <emaste@FreeBSD.org>
Fix by: Alexander Richardson <arichardson@FreeBSD.org>

3 years agolibalias: tidy up housekeeping
Lutz Donnerhacke [Sat, 15 May 2021 15:35:36 +0000 (17:35 +0200)]
libalias: tidy up housekeeping

Replace current expensive, but sparsly called housekeeping
by a single, repetive action.

This is part of a larger restructure of libalias in order to switch to
more efficient data structures.  The whole restructure process is
split into 15 reviews to ease reviewing.  All those steps will be
squashed into a single commit for MFC in order to hide the
intermediate states from production systems.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30277

3 years agoRe-embed multilist_t storage
Alexander Motin [Thu, 10 Jun 2021 16:42:31 +0000 (12:42 -0400)]
Re-embed multilist_t storage

This commit partially reverts changes to multilists in PR 7968
(multi-threaded spa-sync()) and adds some cache line alignments to
separate read-only multilists and heavily modified refcount's to different
cache lines.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-by: iXsystems, Inc.
Closes #12158

3 years agodracut: 90zfs: respect zfs_force=1 on systemd systems
наб [Thu, 10 Jun 2021 16:26:37 +0000 (18:26 +0200)]
dracut: 90zfs: respect zfs_force=1 on systemd systems

On systemd systems provide an environment generator in order
to respect the zfs_force=1 kernel command line option.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11403
Closes #12195

3 years agoRemove pool io kstats (#12212)
Alexander Motin [Thu, 10 Jun 2021 15:27:33 +0000 (11:27 -0400)]
Remove pool io kstats (#12212)

This mostly reverts "3537 want pool io kstats" commit of 8 years ago.

From one side this code using pool-wide locks became pretty bad for
performance, creating significant lock contention in I/O pipeline.
From another, there are more efficient ways now to obtain detailed
statistics, while this statistics is illumos-specific and much less
usable on Linux and FreeBSD, reported only via procfs/sysctls.

This commit does not remove KSTAT_TYPE_IO implementation, that may
be removed later together with already unused KSTAT_TYPE_INTR and
KSTAT_TYPE_TIMER.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12212