]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 months agosrc.conf.5: regen
Ed Maste [Fri, 12 May 2023 14:53:11 +0000 (10:53 -0400)]
src.conf.5: regen

Fixes: ad9d10a859ac ("efi: mark as broken on i386")
Fixes: bee3d4bf8ed5 ("Move DIRDEPS_BUILD settings to sys.dirdeps.mk")
Sponsored by: The FreeBSD Foundation

15 months agonetlink: reduce default log levels
Kristof Provost [Thu, 11 May 2023 13:08:42 +0000 (15:08 +0200)]
netlink: reduce default log levels

Reduce the default log level for netlink to LOG_INFO. This removes a
number of messages such as

> [nl_iface] dump_sa: unsupported family: 0, skipping
or
> [nl_iface] get_operstate_ether: error calling SIOCGIFMEDIA on vlan0: 22

that are useful for debugging, but not for most users.

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40062

15 months agoath11k: import ath11k driver
Bjoern A. Zeeb [Thu, 11 May 2023 22:23:00 +0000 (22:23 +0000)]
ath11k: import ath11k driver

Import BSD-3-Clause-Clear ath11k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working.
There was interest by various people to enhance support further.

We initially only plan to support PCI parts but it would be great
to further enhance qcom SoC support to run on several (cheap) APs.

The firmware is provided by port net/wifi-firmware-ath11k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:    core (jhb, 2023-05-11) [1]
MFC after:      2 months

15 months agoLinuxKPI: add dummy hash.h and kernel_connect()
Bjoern A. Zeeb [Thu, 11 May 2023 22:19:57 +0000 (22:19 +0000)]
LinuxKPI: add dummy hash.h and kernel_connect()

Add crypto/hash.h and a dummy kernel_connect() needed to compile
the ath11k wireless driver.  While I hope we will not actually need
the hash.h fallbacks, kernel_connect() we will have to deal with once
we sort out more QMI bits.

MFC after: 10 days

15 months agoamd64: pmap.h put a guard around a pcpu.h function
Bjoern A. Zeeb [Fri, 12 May 2023 11:14:54 +0000 (11:14 +0000)]
amd64: pmap.h put a guard around a pcpu.h function

pmap_get_pcid() calls zpcpu_get() which is defined in pcpu.h.
It is unclear why we do not include that header but like right
above the change add another guard around pmap_get_pcid().
This allows some LinuxKPI headers to compile again.

Suggested by: markj
MFC after: 10 days

15 months agozfs: merge openzfs/zfs@e61076683
Martin Matuska [Fri, 12 May 2023 11:12:59 +0000 (13:12 +0200)]
zfs: merge openzfs/zfs@e61076683

Notable upstream pull request merges:
  #14744 Optimize check_filesystem() and process_error_log()
  #14773 Allow zhack label repair to restore detached devices
  #14794 zpool import -m also removing spare and cache when log device
         is missing
  #14805 Simplify and optimize random_int_between()
  #14813 Enable the head_errlog feature to remove errors
  #14816 Fix two abd_gang_add_gang() issues
  #14817 Verify block pointers before writing them out
  #14819 Add dmu_tx_hold_append() interface
  #14823 Remove single parent assertion from zio_nowait()
  #14824 Plug memory leak in zfsdev_state
  #14825 Block cloning dbuf fixes
  #14828 Remove duplicate code in l2arc_evict()
  #14837 Fixes in head_errlog feature with encryption
  #14839 Prevent panic during concurrent snapshot rollback and zvol read
  #14853 zil: Don't expect zio_shrink() to succeed

Obtained from: OpenZFS
OpenZFS commit: e6107668385044718b0a73330ed6423650806473

15 months agovlan: fix setting flags on a QinQ interface
Kristof Provost [Fri, 12 May 2023 08:42:48 +0000 (10:42 +0200)]
vlan: fix setting flags on a QinQ interface

Setting vlan flags needlessly takes the exclusive VLAN_XLOCK().

If we have stacked vlan devices (i.e. QinQ) and we set vlan flags (e.g.
IFF_PROMISC) we call rtnl_handle_ifevent() to send a notification about
the interface.
This ends up calling SIOCGIFMEDIA, which requires the VLAN_SLOCK().
Trying to take that one with the VLAN_XLOCK() held deadlocks us.

There's no need for the exclusive lock though, as we're only accessing
parent/trunk information, not modifying it, so a shared lock is
sufficient.

While here also add a test case for this issue.

Backtrace:
shared lock of (sx) vlan_sx @ /usr/src/sys/net/if_vlan.c:2192
while exclusively locked from /usr/src/sys/net/if_vlan.c:2307
panic: excl->share
cpuid = 29
time = 1683873033
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d4ad4b0
vpanic() at vpanic+0x152/frame 0xfffffe015d4ad500
panic() at panic+0x43/frame 0xfffffe015d4ad560
witness_checkorder() at witness_checkorder+0xcb5/frame 0xfffffe015d4ad720
_sx_slock_int() at _sx_slock_int+0x67/frame 0xfffffe015d4ad760
vlan_ioctl() at vlan_ioctl+0xf8/frame 0xfffffe015d4ad7c0
dump_iface() at dump_iface+0x12f/frame 0xfffffe015d4ad840
rtnl_handle_ifevent() at rtnl_handle_ifevent+0xab/frame 0xfffffe015d4ad8c0
if_setflag() at if_setflag+0xf6/frame 0xfffffe015d4ad930
ifpromisc() at ifpromisc+0x2a/frame 0xfffffe015d4ad960
vlan_setflags() at vlan_setflags+0x60/frame 0xfffffe015d4ad990
vlan_ioctl() at vlan_ioctl+0x216/frame 0xfffffe015d4ad9f0
if_setflag() at if_setflag+0xe4/frame 0xfffffe015d4ada60
ifpromisc() at ifpromisc+0x2a/frame 0xfffffe015d4ada90
bridge_ioctl_add() at bridge_ioctl_add+0x499/frame 0xfffffe015d4adb10
bridge_ioctl() at bridge_ioctl+0x328/frame 0xfffffe015d4adbc0
ifioctl() at ifioctl+0x972/frame 0xfffffe015d4adcc0
kern_ioctl() at kern_ioctl+0x1fe/frame 0xfffffe015d4add30
sys_ioctl() at sys_ioctl+0x154/frame 0xfffffe015d4ade00
amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe015d4adf30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d4adf30
--- syscall (54, FreeBSD ELF64, ioctl), rip = 0x22b0f0ef8d8a, rsp = 0x22b0ec63f2c8, rbp = 0x22b0ec63f380 ---
KDB: enter: panic
[ thread pid 5715 tid 101132 ]

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

15 months agoarm64: Fix a typo in a source code comment
Gordon Bergling [Fri, 12 May 2023 08:45:46 +0000 (10:45 +0200)]
arm64: Fix a typo in a source code comment

- s/inferface/interface/

MFC after: 3 days

15 months agobhyve: import OpRegion definitions
Corvin Köhne [Wed, 10 May 2023 10:25:19 +0000 (12:25 +0200)]
bhyve: import OpRegion definitions

Those definitions are required for the GVT-d emulation to parse the
OpRegion.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40037

15 months agobhyve: add helper for passthru specific mmio ranges
Corvin Köhne [Wed, 10 May 2023 10:22:33 +0000 (12:22 +0200)]
bhyve: add helper for passthru specific mmio ranges

Intel GPUs have two special memory regions. They are called Graphics
Stolen Memory and OpRegion. bhyve has to emulate both of them. In order
to keep track of those special regions, add generic mmio ranges to the
passthru emulation.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40036

15 months agobhyve: don't panic if e820 finds no available memory
Corvin Köhne [Tue, 9 May 2023 12:32:33 +0000 (14:32 +0200)]
bhyve: don't panic if e820 finds no available memory

The GVT-d emulation tries to allocate some specific memory. It could
happen that this address doesn't exist. In that case, GVT-d will fall
back to allocate any address. Nevertheless, this only works if the e820
fails with an error instead of exiting on an assertion.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40034

15 months agoMove DIRDEPS_BUILD settings to sys.dirdeps.mk
Simon J. Gerraty [Thu, 11 May 2023 23:15:04 +0000 (16:15 -0700)]
Move DIRDEPS_BUILD settings to sys.dirdeps.mk

When originally implemented, there was no distinction between
DIRDEPS_BUILD and META_MODE, they were one and the same.

META_MODE however is useful by itself, but since meta.sys.mk
had lots of settings related to DIRDEPS_BUILD its use was limited
to DIRDEPS_BUILD.

Move (most) DIRDEPS_BUILD related items to sys.dirdeps.mk
so that meta.sys.mk can be used for just META_MODE.
There is of course some bluring of the lines, so settings remain
in meta.sys.mk

Add MK_META_ERROR_TARGET to enable the META_MODE .ERROR target
independent of DIRDEPS_BUILD, it copies failed .meta files to ${SB}/error
to make it easier to identify the cause of build failures.

Since sys.dirdeps.mk should be included first, most of
local.meta.sys.mk becomes local.sys.dirdeps.mk
and some other bits need to move to local.sys.dirdeps.env.mk

Also fix dirdeps.mk to not add CURDIR to DIRDEPS when it is SRCTOP.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D40053

15 months agoMake sure we are not trying to clone a spill block.
Pawel Jakub Dawidek [Wed, 10 May 2023 05:32:30 +0000 (22:32 -0700)]
Make sure we are not trying to clone a spill block.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoCorrect comment.
Pawel Jakub Dawidek [Thu, 4 May 2023 23:14:19 +0000 (16:14 -0700)]
Correct comment.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoRemove badly placed comment.
Pawel Jakub Dawidek [Thu, 4 May 2023 06:25:22 +0000 (23:25 -0700)]
Remove badly placed comment.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoDon't call zfs_exit_two() before zfs_enter_two().
Pawel Jakub Dawidek [Wed, 3 May 2023 07:24:47 +0000 (00:24 -0700)]
Don't call zfs_exit_two() before zfs_enter_two().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoDon't use dmu_buf_is_dirty() for unassigned transaction.
Pawel Jakub Dawidek [Tue, 2 May 2023 22:46:14 +0000 (15:46 -0700)]
Don't use dmu_buf_is_dirty() for unassigned transaction.

The dmu_buf_is_dirty() call doesn't make sense here for two reasons:
1. txg is 0 for unassigned tx, so it was a no-op.
2. It is equivalent of checking if we have dirty records and we are doing
   this few lines earlier.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoDeny block cloning is dbuf size doesn't match BP size.
Pawel Jakub Dawidek [Tue, 2 May 2023 21:24:43 +0000 (14:24 -0700)]
Deny block cloning is dbuf size doesn't match BP size.

I don't know an easy way to shrink down dbuf size, so just deny block cloning
into dbufs that don't match our BP's size.

This fixes the following situation:
1. Create a small file, eg. 1kB of random bytes. Its dbuf will be 1kB.
2. Create a larger file, eg. 2kB of random bytes. Its dbuf will be 2kB.
3. Truncate the large file to 0. Its dbuf will remain 2kB.
4. Clone the small file into the large file. Small file's BP lsize is
   1kB, but the large file's dbuf is 2kB.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agoAdditional block cloning fixes.
Pawel Jakub Dawidek [Sun, 30 Apr 2023 09:47:09 +0000 (02:47 -0700)]
Additional block cloning fixes.

Reimplement some of the block cloning vs dbuf logic, mostly to fix
situation where we clone a block and in the same transaction group
we want to partially overwrite the clone.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

15 months agodma: specify OpenSSL 1.1 API
Pierre Pronchery [Tue, 9 May 2023 14:06:40 +0000 (16:06 +0200)]
dma: specify OpenSSL 1.1 API

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

15 months agodma: use OpenSSL 1.1 init API
Ed Maste [Thu, 11 May 2023 14:44:05 +0000 (10:44 -0400)]
dma: use OpenSSL 1.1 init API

> The SSL_library_init() and OpenSSL_add_ssl_algorithms() functions were
> deprecated in OpenSSL 1.1.0 by OPENSSL_init_ssl().

and

> The ERR_load_crypto_strings(), SSL_load_error_strings(), and
> ERR_free_strings() functions were deprecated in OpenSSL 1.1.0 by
> OPENSSL_init_crypto() and OPENSSL_init_ssl() and should not be used.

Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40065

15 months agoLinuxKPI: 802.11: fix IEEE80211_TX_INFO_DRIVER_DATA_SIZE
Bjoern A. Zeeb [Thu, 11 May 2023 21:35:11 +0000 (21:35 +0000)]
LinuxKPI: 802.11: fix IEEE80211_TX_INFO_DRIVER_DATA_SIZE

Fix the sizing of IEEE80211_TX_INFO_DRIVER_DATA_SIZE so that it
also works on 32bit platforms.  Otherwise it triggers a compile-time
assertion in ath10k for i386.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

15 months agozil: Don't expect zio_shrink() to succeed.
Alexander Motin [Thu, 11 May 2023 21:27:12 +0000 (17:27 -0400)]
zil: Don't expect zio_shrink() to succeed.

At least for RAIDZ zio_shrink() does not reduce zio size, but reduced
wsz in that case likely results in writing uninitialized memory.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by:   iXsystems, Inc.
Closes #14853

15 months agorc.conf.5: document name_cpuset, introduced in rev 0661f93892a2
Ceri Davies [Thu, 11 May 2023 21:06:56 +0000 (22:06 +0100)]
rc.conf.5: document name_cpuset, introduced in rev 0661f93892a2

15 months agostand/efi: Retire i386 support
Warner Losh [Thu, 11 May 2023 20:04:12 +0000 (14:04 -0600)]
stand/efi: Retire i386 support

Remove the i386 ifdefs and files. It never worked.

Sponsored by: Netflix
Reviewed by: manu, tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D40012

15 months agoefi: mark as broken on i386
Warner Losh [Thu, 11 May 2023 20:04:05 +0000 (14:04 -0600)]
efi: mark as broken on i386

We're never going to support EFI booting on i386 (32-bit). Start to
decommission it, since it's never worked.

Sponsored by: Netflix
Reviewed by: tsoome, emaste
Differential Revision: https://reviews.freebsd.org/D40011

15 months agostand: eficom: Only set baudrate when it changes
Warner Losh [Thu, 11 May 2023 20:04:00 +0000 (14:04 -0600)]
stand: eficom: Only set baudrate when it changes

Only set the baudrate when it is different than what the device has
reported. In addition, pass in the args to effect no change to the other
parameters to the serial port. Some EFI firmware gets cranky when you
set them to the same value, so avoid doing so (we likely can remove the
HyperV workaround with this fix, but I kept it in place). Add comments
to the code for why we do this too.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40010

15 months agostand: eficom: Don't preemtively assume flow control
Warner Losh [Thu, 11 May 2023 20:03:51 +0000 (14:03 -0600)]
stand: eficom: Don't preemtively assume flow control

Remove rtsdtr_off. It's basically unused. Expand its meaning, but put
changing flow control to under an ifdef. We shouldn't set it unless
we're sure we need to do so. UEFI normally initializes the device
correctly, and we should avoid needless changes that aren't user
requested.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40009

15 months agostand: eficom : remove unused ignore_cd
Warner Losh [Thu, 11 May 2023 20:03:47 +0000 (14:03 -0600)]
stand: eficom : remove unused ignore_cd

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40008

15 months agostand: Move eficom to libefi
Warner Losh [Thu, 11 May 2023 20:03:42 +0000 (14:03 -0600)]
stand: Move eficom to libefi

Rename efiserialc to eficom.c and move it to libefi. Remove
loader.efi.h, since it's not needed. It's architecture independent
(though how we use it might vary). Drivers also belong in libfoo
in the boot loader: all the BIOS drivers are in i386/libi386 and
the console driver is in efi/libefi.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40007

15 months agostand: Make non-matching console names OKer
Warner Losh [Thu, 11 May 2023 20:03:37 +0000 (14:03 -0600)]
stand: Make non-matching console names OKer

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39984

15 months agostand: add comconsole backwards compatibility shim for aarch64
Warner Losh [Thu, 11 May 2023 20:03:30 +0000 (14:03 -0600)]
stand: add comconsole backwards compatibility shim for aarch64

Add a compat shim for the "comconsole" name so that people with a
"console=comconsole" in their loader.conf on aarch64 will continue to
work (though with a warning).

This is only aarch64: it will never be there for amd64 (where comconsole
always means talk to the hardware directly). To do that is too hard.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39983

15 months agostand: efi create eficom console device.
Warner Losh [Thu, 11 May 2023 20:03:17 +0000 (14:03 -0600)]
stand: efi create eficom console device.

Fix the 'renaming kludge' that we absolutely cannot do going forward
(it's cost us days of engineering time).

console=comconsole talks to the hardware directly. This is available
only on amd64. It is not available anywhere else (and so requires
changes for people doing comconsole on aarch64)

console=eficom talks to the console via EFI protocols.  It's available
on amd64, aarch64 and riscv64. It's the first port that we find, though
it can be overriden by efi_com_port (which should be set to the UID of
the serial port, not the I/O port, despite the name). devinfo -v
will give the UID to uartX mapping.

This is an incompatible change for HYPER-V on amd64. It only works with
eficom console, so you'll need to change your configuration in
loader.conf. No compatibility hack will ever be provided for this (since
it requires renamig, which the loader cannot reliably do).

It's also an incompatible change for aarch64. comconsole will need to
change to eficom. There might be a comconsole "shim" for this.

All the interlock to keep only eficom and comconsole from both attaching
have been removed.

RelNotes: Yes
Sponsored by: Netflix
Discussed with: kevans
Differential Revision: https://reviews.freebsd.org/D39982

15 months agoarm64: add swapueword8/32
Kyle Evans [Thu, 11 May 2023 18:23:03 +0000 (13:23 -0500)]
arm64: add swapueword8/32

Much like casueword*, except just a plain old swap.  Maintains a similar
interface to casu(9)- return value -1 (fault), 0 (success), or 1 (fail),
and also both ll/sc and LSE variants are implemented.

These will be used to implement 32-bit swp/swpb emulation on aarch64.

Reveiwed by: andrew
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39837

15 months agoCirrus-CI: hide manual tasks from official runs
Ed Maste [Thu, 11 May 2023 15:16:51 +0000 (11:16 -0400)]
Cirrus-CI: hide manual tasks from official runs

Sponsored by: The FreeBSD Foundation

15 months agofbt/x86: update FBT_AFRAMES to match the trap handlers
Chuck Silvers [Thu, 11 May 2023 01:22:15 +0000 (18:22 -0700)]
fbt/x86: update FBT_AFRAMES to match the trap handlers

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40054

15 months agodpaa2: Simplify addresses translation with PHYS_TO_DMAP
Dmitry Salychev [Tue, 2 May 2023 12:17:04 +0000 (14:17 +0200)]
dpaa2: Simplify addresses translation with PHYS_TO_DMAP

Approved by: bz (mentor)
Reviewed by: bz (mentor), mhorne
Differential Revision: https://reviews.freebsd.org/D39946
MFC after: 3 weeks

15 months agoktls_test: specify OpenSSL 1.1 API
Pierre Pronchery [Thu, 11 May 2023 03:49:44 +0000 (05:49 +0200)]
ktls_test: specify OpenSSL 1.1 API

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

15 months agobhyve: make passthru sel public available
Corvin Köhne [Wed, 10 May 2023 10:19:49 +0000 (12:19 +0200)]
bhyve: make passthru sel public available

The GVT-d emulation requires access to this selector to read from the
device.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40035

15 months agobhyve: add cmdline option for user defined fw_cfg items
Corvin Köhne [Wed, 8 Sep 2021 09:31:21 +0000 (11:31 +0200)]
bhyve: add cmdline option for user defined fw_cfg items

Some guest allow to configure themself by fw_cfg. E.g. Fedora CoreOs can
be provisioned by adding a JSON file as fw_cfg item.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38338

15 months agoComplete removing twe(4)
Li-Wen Hsu [Thu, 11 May 2023 08:28:23 +0000 (16:28 +0800)]
Complete removing twe(4)

Fixes: 062a7b918fac twe: Remove driver

15 months agoe1000: fix VLAN 0
Kristof Provost [Wed, 10 May 2023 16:26:29 +0000 (18:26 +0200)]
e1000: fix VLAN 0

VLAN 0 essentially means "Treat as untagged, but with priority bits",
and is used by some ISPs.

On igb/em interfaces we did not receive packets with VLAN tag 0 unless
vlanhwfilter was disabled.

This can be fixed by explicitly listing VLAN 0 in the hardware VLAN
filter (VFTA). Do this from em_setup_vlan_hw_support(), where we already
(re-)write the VFTA.

Reviewed by: kbowling
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40046

15 months agomd5: Add missing <errno.h>.
Dag-Erling Smørgrav [Thu, 11 May 2023 06:23:56 +0000 (06:23 +0000)]
md5: Add missing <errno.h>.

Sponsored by: Klara, Inc.
Reviewed by: yuripv
Differential Revision: https://reviews.freebsd.org/D40051

15 months agorc.subr(8): run `trailing-whitespace-fixer`
Enji Cooper [Thu, 11 May 2023 05:39:32 +0000 (22:39 -0700)]
rc.subr(8): run `trailing-whitespace-fixer`

This change deletes benign trailing whitespace from rc.subr, making
future non-stylistic changes easier to spot.

MFC after: 1 week

15 months agorc: add support for cpuset(1)
Miroslav Lachman [Thu, 11 May 2023 04:38:23 +0000 (23:38 -0500)]
rc: add support for cpuset(1)

If ${name}_cpuset is specified (and /usr is mounted), cpuset(1) will be
run to limit the service to the configured cpuset.

PR: 142434
Reviewed by: kevans

15 months agotwe: Remove driver
Warner Losh [Thu, 11 May 2023 04:24:12 +0000 (22:24 -0600)]
twe: Remove driver

Sponsored by: Netflix

15 months agolualoader: add support for .lua configuration files
Kyle Evans [Thu, 11 May 2023 04:10:53 +0000 (23:10 -0500)]
lualoader: add support for .lua configuration files

If a file is specified in loader_conf_files that ends in '.lua', lualoader
will now load and execute that file. These may be used in place of a
traditional loader.conf to use more complicated logic, where some values
may be set based on others or based on the environment that the C bits has
left us with.

Lua scripts are run in a limited environment. In particular, it does not get
access to any modules or, in-fact, anything except environment variable.

A config.buildenv hook has been added so that a local module can add
whatever it may need to to the environment.

When a global var is set in the lua script, it does not immediately alter
the loader environment. Instead, the script's environment is initially
empty and processed only if the whole script executes successfully.
Effectively, a lua configuration file either takes effect or it does not,
an error will not leave it in a half-baked state.

Reviewed by: bcr (manpages), imp
Differential Revision: https://reviews.freebsd.org/D28450

15 months agonet/pfkeyv2.h: fix typo, meNber
Konstantin Belousov [Wed, 10 May 2023 23:52:39 +0000 (02:52 +0300)]
net/pfkeyv2.h: fix typo, meNber

Sponsored by: NVidia networking
MFC after: 3 days

15 months agoInstall spleen vt(4) fonts
Ed Maste [Tue, 4 Jun 2019 20:31:00 +0000 (16:31 -0400)]
Install spleen vt(4) fonts

From https://github.com/fcambus/spleen, imported into contrib in
0d66206fff44.

Reviewed by: Frederic Cambus
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20654

15 months agotsort: Add unit tests.
Dag-Erling Smørgrav [Wed, 10 May 2023 13:45:44 +0000 (15:45 +0200)]
tsort: Add unit tests.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40043

15 months agotsort: Replace bcopy() with memcpy().
Dag-Erling Smørgrav [Wed, 10 May 2023 13:45:38 +0000 (15:45 +0200)]
tsort: Replace bcopy() with memcpy().

Also fix an indentation error I introduced in the previous commit.

Fixes: cb46f47c7969
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40042

15 months agomd5: Add missing references to sha384.
Dag-Erling Smørgrav [Wed, 10 May 2023 13:45:11 +0000 (15:45 +0200)]
md5: Add missing references to sha384.

Fixes: 4849767cb16a
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D40032

15 months agohier(7): fix a couple mandoc warnings
Mitchell Horne [Wed, 10 May 2023 13:26:35 +0000 (10:26 -0300)]
hier(7): fix a couple mandoc warnings

These references are rendered correctly without the zero-width space.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

15 months agohier(7): document /home/ and /usr/home/
Mitchell Horne [Wed, 10 May 2023 12:53:56 +0000 (09:53 -0300)]
hier(7): document /home/ and /usr/home/

Reviewed by: imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40002

15 months agohier(7): drop list of /usr/share/doc subdirectories
Mitchell Horne [Wed, 10 May 2023 12:53:40 +0000 (09:53 -0300)]
hier(7): drop list of /usr/share/doc subdirectories

Several entries are outdated, several new ones are missing. I do not
think there is much value added in maintaining this.

Reviewed by: imp, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40001

15 months agohier(7): drop list of /usr/include subdirectories
Mitchell Horne [Wed, 10 May 2023 12:52:47 +0000 (09:52 -0300)]
hier(7): drop list of /usr/include subdirectories

It is nice to have, however, the location of this information means that
it will naturally be missed by developers adding or removing directories
to the layout, so it trends out-of-date and it is out-of-date.

The target audience for hier(7) is users and administrators. It is not
expected to be a place that programmers should go to learn about the
purposes of the different C headers provided by FreeBSD.

Program authors needing FreeBSD-specific interfaces or libraries
(#include <sys/queue.h>, for instance) will either be following a more
detailed man page, or consulting the header contents directly. Folks
targeting standardized headers (#include <sys/time.h>) will not need
hier(7) to tell them where those headers are under /usr/include.

In other words, this is more detail than necessary for this document.
I'd go as far as to say that many of the existing entries in this list
do little more than parrot the name of the directory.

With all this in mind, let's drop the maintenance burden.

Reviewed by: imp, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40000

15 months agoifconfig: fix family selection after 982cd5ae8ef6
Alexander V. Chernikov [Wed, 10 May 2023 12:40:51 +0000 (12:40 +0000)]
ifconfig: fix family selection after 982cd5ae8ef6

15 months agoifconfig: fix interface selection after 982cd5ae8ef6.
Alexander V. Chernikov [Wed, 10 May 2023 12:06:10 +0000 (12:06 +0000)]
ifconfig: fix interface selection after 982cd5ae8ef6.

15 months agoarm64: fix stack unwinding past exception handlers
Zachary Leaf [Tue, 9 May 2023 16:04:44 +0000 (17:04 +0100)]
arm64: fix stack unwinding past exception handlers

Commit 281402e0a563 ("arm64: Shave off two instructions in exceptions")
removed the instruction that set the frame pointer (x29) as it appeared
to be unused.

The frame pointer is used in arm64/db_trace.c:db_stack_trace_cmd() when
unwinding state, and hence still needs to be set.

Add back the instruction to save_registers to properly update frame
pointer.

Reported by: andrew
Sponsored by: Arm Ltd

15 months agoifconfig: split argument parsing and actual execution logic
Alexander V. Chernikov [Wed, 10 May 2023 09:58:56 +0000 (09:58 +0000)]
ifconfig: split argument parsing and actual execution logic

Reduce the amount of global variables by creating the dedicated
 ifconfig_args structure and use it as a context-passing variable.
Simplify the code by moving all argument preparation code a
 separate function.

Reviewed by: kp (previous version)
Differential Revision: https://reviews.freebsd.org/D39932
MFC after: 2 weeks

15 months agonetlink: provide original interface lladdr in the interface dump.
Alexander V. Chernikov [Wed, 10 May 2023 09:49:34 +0000 (09:49 +0000)]
netlink: provide original interface lladdr in the interface dump.

* Store lladdr in the FreeBSD-specific IFLAF_ORIG_HWADDR attr
* Do not export empty IFLA_ADDRESS for interfaces w/o lladdrs.

MFC after: 2 weeks

15 months agonetlink: export more IPv6 ifa info
Alexander V. Chernikov [Wed, 10 May 2023 08:52:31 +0000 (08:52 +0000)]
netlink: export more IPv6 ifa info

* Fill in IFA_CACHEINFO with prefix lifetime data
* Map IPv6 IN6_IFF_ flags to Netlink IFA_F_ flags
* Store original ia6_flags in the FreeBSD-specific IFAF_FLAGS field

MFC after: 2 weeks

15 months agonetlink: export carp VHID when dumping interface addresses.
Alexander V. Chernikov [Wed, 10 May 2023 08:44:47 +0000 (08:44 +0000)]
netlink: export carp VHID when dumping interface addresses.

MFC after: 2 weeks

15 months agomd5: Don't increment a bool.
Dag-Erling Smørgrav [Tue, 9 May 2023 17:59:27 +0000 (17:59 +0000)]
md5: Don't increment a bool.

Fixes: 4849767cb16a
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40020

15 months agomd5: Include <osreldate.h> for __FreeBSD_version.
Dag-Erling Smørgrav [Tue, 9 May 2023 17:59:19 +0000 (17:59 +0000)]
md5: Include <osreldate.h> for __FreeBSD_version.

It is usually provided by <sys/param.h>, but not when bootstrapping.

Fixes: 4849767cb16a
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: yuripv, kevans
Differential Revision: https://reviews.freebsd.org/D40018

15 months agomd5: Fix input error check.
Dag-Erling Smørgrav [Tue, 9 May 2023 17:59:13 +0000 (17:59 +0000)]
md5: Fix input error check.

Fixes: 4849767cb16a
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: tsoome, kevans, lwhsu
Differential Revision: https://reviews.freebsd.org/D40017

15 months agopkgbase: report error if files are installed multiple times
Ed Maste [Fri, 5 May 2023 17:44:39 +0000 (13:44 -0400)]
pkgbase: report error if files are installed multiple times

Files installed by `make installworld` should be installed only once.

PR: 244596
Sponsored by: The FreeBSD Foundation

15 months agoincludes: avoid installing if_wg.h twice
Ed Maste [Wed, 10 May 2023 00:28:44 +0000 (20:28 -0400)]
includes: avoid installing if_wg.h twice

if_wg.h was installed via dev/wg in LSUBDIRS and also explicitly.  We
want to install only wg/if_wg.h not the other headers, so add dev/wg to
the skip list in the copies and symlinks targets.

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

15 months agoPrevent panic during concurrent snapshot rollback and zvol read
Ameer Hamza [Wed, 10 May 2023 00:56:35 +0000 (05:56 +0500)]
Prevent panic during concurrent snapshot rollback and zvol read

Protect zvol_cdev_read with zv_suspend_lock to prevent concurrent
release of the dnode, avoiding panic when a snapshot is rolled back
in parallel during ongoing zvol read operation.

Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #14839

15 months agopam: Fix "buffer overflow" in pam ZTS tests on F38
Tony Hutter [Wed, 10 May 2023 00:55:19 +0000 (17:55 -0700)]
pam: Fix "buffer overflow" in pam ZTS tests on F38

The pam ZTS tests were reporting a buffer overflow on F38, possibly
due to F38 now setting _FORTIFY_SOURCE=3 by default.  gdb and
valgrind narrowed this down to a snprintf() buffer overflow in
zfs_key_config_modify_session_counter().  I'm not clear why this
particular snprintf() was being flagged as an overflow, but when
I replaced it with an asprintf(), the test passed reliably.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #14802
Closes #14842

15 months agoloader: install help files only once
Ed Maste [Fri, 5 May 2023 17:43:33 +0000 (13:43 -0400)]
loader: install help files only once

Every file should be installed exactly once by `make installworld`.
This is especially important for pkgbase.

Loader help files were being installed by each loader variant (e.g.,
the simp, lua, and 4th EFI loaders).  Add a (slightly hacky) mechanism
to skip installing help files for all but one variant.

PR: 271178
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40021

15 months agofreebsd-update: Fix merging already-updated files
Colin Percival [Fri, 5 May 2023 03:00:58 +0000 (20:00 -0700)]
freebsd-update: Fix merging already-updated files

When performing an "upgrade" (moving between FreeBSD releases, as
opposed to "update" which merely applies security/errata updates
to the installed release) FreeBSD Update:

1. Generates a list of "files needing to be merged", namely those
files which don't match the version installed in the "old" release
and have paths matching the MergeChanges configuration directive
(by default, /boot/device.hints and everything under /etc/).

and later on,

2. Compares the currently-installed files to the versions in the
"new" release, removing index entries for files which "don't need
to be updated because they're not changing".

Unfortunately if a file falls into both of these categories -- that
is to say, if a file in /etc/ is the same as the version in the new
release and not the same as the version in the old release -- the
resulting "merge" step saw that the file was no longer listed as
being part of the new release, resulting in the file being deleted.

For the first 18 years of FreeBSD Update's existence, this never
happened, since $FreeBSD$ tags resulted in "new release" files
always being different from any files systems would already have
installed.

This commit fixes this behaviour by only placing a file into the
"files needing to be merged" list if it does not match the version
in the old release *or* the version in the new release.

Reported by: des
Reviewed by: delphij (earlier version), des, emaste
MFC after: 7 days
X-EN-Candidate: yes
Differential Revision: https://reviews.freebsd.org/D39973

15 months agoCirrus-CI: add gcc12 automatic task on primary GitHub mirror
Ed Maste [Tue, 9 May 2023 18:26:47 +0000 (14:26 -0400)]
Cirrus-CI: add gcc12 automatic task on primary GitHub mirror

We want to get GCC coverage via Cirrus-CI, but don't want to trigger
excessive runs across all forks and branches.  Create a duplicate gcc12
task to run automatically for freebsd/freebsd-src.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

15 months agoFix off-by-one error in fsck_ffs(8) chkrange() block-number check.
Kirk McKusick [Tue, 9 May 2023 20:08:10 +0000 (13:08 -0700)]
Fix off-by-one error in fsck_ffs(8) chkrange() block-number check.

On an amd64-CURRENT machine with an i-node that refers to a block
number that is one too large will cause a core dump, due to writing
beyond the end of blockmap[] and corrupting the next heap block,
which happens to contain a struct inoinfo in inphash[]. Note that
valgrind catches the blockmap[] access.

Reported by:  Robert Morris
PR:           271289
MFC after:    1 week
Sponsored by: The FreeBSD Foundation

15 months agoktls: re-work alloc thread
Andrew Gallatin [Mon, 8 May 2023 13:38:59 +0000 (09:38 -0400)]
ktls: re-work alloc thread

When the ktls_buffer zone needs to expand, it may fail due
to a lack of physically contiguous memory.  We tried to rectify
that by introducing an alloc thread to provide a context where
it is harmless to sleep, and letting that thread repopulate
the ktls_buffer zone.

However, it turns out that M_WAITOK is not enough, and we
must call vm_page_reclaim_contig_domain() to reclaim contig
memory. Worse, M_WAITOK results in the allocation essentially
busy-looping around vm_domain_alloc_fail() returning EAGIN,
causing vm_page_alloc_noobj_contig_domain() to loop and resulting
in the alloc thread consuming 100% CPU.

To fix this, we change the alloc thread to call
vm_page_reclaim_contig_domain_ext()

In order to prevent the busy loop around vm_domain_alloc_fail(), we
must change the uma_zalloc flags to M_NORECLAIM | M_NOWAIT.  However,
once that is done, these allocations become no different than the
allocations done in the critical path in ktls_buffer_alloc(), so its
best to just eliminate them.

Since we're no longer doing allocations but just calling
vm_page_reclaim_contig_domain_ext(), the name has changed to the ktls
reclaim thread.

Reviewed by: jhb, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39421

15 months agovm: implement vm_page_reclaim_contig_domain_ext()
Andrew Gallatin [Mon, 8 May 2023 13:25:40 +0000 (09:25 -0400)]
vm: implement vm_page_reclaim_contig_domain_ext()

Implement vm_page_reclaim_contig_domain_ext() to reclaim multiple
contiguous regions at once.  This makes it more efficient for users
that need multiple contiguous regions to reclaim those regions
efficiently.

This is needed because callers like ktls may need to reclaim many
contiguous regions, and each scan of physical memory can take
multiple seconds on a large memory machine (order of 100GB of
RMA).  Rather than modifying the core algorithm, I extended
vm_page_reclaim_contig_domain() to take a "desired_runs" argument to
allow the caller to request that it reclaim more than just a single
run. There is no functional change intended for all existing
callers.

The first user for this interface is the ktls code
(https://reviews.freebsd.org/D39421). By reclaiming multiple runs,
ktls goes from consuming hours of CPU to refill its buffer zone to
just seconds or minutes.

Differential Revision: https://reviews.freebsd.org/D39739
Sponsored by: Netflix
Reviewed by: alc, jhb, markj

15 months agoRevert "cpuset: increase userland maximum size to 1024"
Ed Maste [Tue, 9 May 2023 13:40:27 +0000 (09:40 -0400)]
Revert "cpuset: increase userland maximum size to 1024"

This reverts commit 76887e84be975698b14699d7d0dfb157d73e9990.

struct vm_exit currently requires that cpuset_t be identical in userland
and kernel.  This will be recommitted after these are decoupled.

PR: 271330, 269572
Reported by: corvink
Sponsored by: The FreeBSD Foundation

15 months agolocks: fix two potential overflows in the lock delay code
Jonathan T. Looney [Tue, 9 May 2023 16:20:49 +0000 (16:20 +0000)]
locks: fix two potential overflows in the lock delay code

With large numbers of CPUs, the calculation of the maximum lock delay
could overflow, leading to an unexpectedly low delay. In fact, the
maximum delay would calculate to 0 on systems with between 128 and
255 cores (inclusive). Also, when calculating the new delay in
lock_delay(), the delay would overflow if the old delay was >= 32,768.

This commit fixes these two overflows. It also updates the maximum
delay from 32,678 to SHRT_MAX.

Reviewed by: gallatin, jhb, mjg
Fixes: 6b8dd26e7c5f ("locks: convert delay times to u_short")
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39372

15 months agoAdd dmu_tx_hold_append() interface
Brian Behlendorf [Tue, 9 May 2023 16:03:10 +0000 (09:03 -0700)]
Add dmu_tx_hold_append() interface

Provides an interface which callers can use to declare a write when
the exact starting offset in not yet known.  Since the full range
being updated is not available only the first L0 block at the
provided offset will be prefetched.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14819

15 months agoDebug auto_replace_001_pos failures
Brian Behlendorf [Tue, 9 May 2023 15:57:02 +0000 (08:57 -0700)]
Debug auto_replace_001_pos failures

Reduced the timeout to 60 seconds which should be more than
sufficient and allow the test to be marked as FAILED rather
than KILLED.  Also dump the pool status on cleanup.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14829

15 months agoRemove duplicate code in l2arc_evict()
George Amanakis [Tue, 9 May 2023 15:54:41 +0000 (17:54 +0200)]
Remove duplicate code in l2arc_evict()

l2arc_evict() performs the adjustment of the size of buffers to be
written on L2ARC unnecessarily. l2arc_write_size() is called right
before l2arc_evict() and performs those adjustments.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14828

15 months agoRemove single parent assertion from zio_nowait().
Alexander Motin [Tue, 9 May 2023 15:54:01 +0000 (11:54 -0400)]
Remove single parent assertion from zio_nowait().

We only need to know if ZIO has any parent there.  We do not care if
it has more than one, but use of zio_unique_parent() == NULL asserts
that.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14823

15 months agoEnable the head_errlog feature to remove errors
George Amanakis [Tue, 9 May 2023 15:53:27 +0000 (17:53 +0200)]
Enable the head_errlog feature to remove errors

In case check_filesystem() does not error out and does not report
an error, remove that error block from error lists and logs
without requiring a scrub. This can happen when the original file and
all snapshots/clones referencing it have been removed.

Otherwise zpool status will still report that "Permanent errors have
been detected..." without actually reporting any of them.

To implement this change the functions introduced in corrective
receive were modified to take into account the head_errlog feature.

Before this change:
=============================
pool: test
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A
config:

        NAME                   STATE     READ WRITE CKSUM
        test                   ONLINE       0     0     0
          /home/user/vdev_a    ONLINE       0     0     2

errors: Permanent errors have been detected in the following files:

=============================

After this change:
=============================
  pool: test
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are
unaffected.
action: Determine if the device needs to be replaced, and clear the
errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-9P
config:

        NAME                   STATE     READ WRITE CKSUM
        test                   ONLINE       0     0     0
          /home/user/vdev_a    ONLINE       0     0     2

errors: No known data errors
=============================

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14813

15 months agoamd64 MINIMAL: SysV IPC syscalls are loadable
Konstantin Belousov [Sat, 6 May 2023 20:03:07 +0000 (23:03 +0300)]
amd64 MINIMAL: SysV IPC syscalls are loadable

Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39990

15 months agoamd64 MINIMAL: remove UFS from compiled-in list
Konstantin Belousov [Sat, 6 May 2023 20:02:34 +0000 (23:02 +0300)]
amd64 MINIMAL: remove UFS from compiled-in list

Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39990

15 months agoamd64 MINIMAL config: remove statements about UFS module
Konstantin Belousov [Sat, 6 May 2023 20:01:45 +0000 (23:01 +0300)]
amd64 MINIMAL config: remove statements about UFS module

All UFS options work for ufs.ko.

Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39990

15 months agosmp_topo(): correct allocation sizes for trivial topologies
Konstantin Belousov [Tue, 9 May 2023 15:08:22 +0000 (18:08 +0300)]
smp_topo(): correct allocation sizes for trivial topologies

This patch should not modify the correctness, only the clarity.

Requested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39981

15 months agosmp_topo(): make it idempotent
Konstantin Belousov [Sun, 7 May 2023 18:37:42 +0000 (21:37 +0300)]
smp_topo(): make it idempotent

If more than one call to the function occurs, it currently allocates the
same amount from the group[] array, eventually leading to the memory
corruption.

Noted and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39981

15 months agosmp_topo: dynamically allocate group array
Konstantin Belousov [Fri, 5 May 2023 20:24:22 +0000 (23:24 +0300)]
smp_topo: dynamically allocate group array

Limit its size to mp_maxid + 1 times MAX_CACHE_LEVELS instead MAXCPU.
Allocate the array on a first call into smp_topo(9) functions, where
the mp_maxid is already known.

Make the array private to smp_topo_alloc(), assuming that the callers
that allocate top-level group do it once.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39981

15 months agoquiesce_cpus(): do not overallocate generation array
Konstantin Belousov [Fri, 5 May 2023 20:21:38 +0000 (23:21 +0300)]
quiesce_cpus(): do not overallocate generation array

Also switch to mallocarray().

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39981

15 months agonetlink: fix compiler warnings
Alexander V. Chernikov [Tue, 9 May 2023 15:26:16 +0000 (15:26 +0000)]
netlink: fix compiler warnings

15 months agonetlink: temporary skip snl(3) capped test.
Alexander V. Chernikov [Tue, 9 May 2023 14:59:41 +0000 (14:59 +0000)]
netlink: temporary skip snl(3) capped test.

15 months agonetlink: automatically fill sin6_scope_id in the default snl(3) parsers.
Alexander V. Chernikov [Tue, 9 May 2023 14:55:47 +0000 (14:55 +0000)]
netlink: automatically fill sin6_scope_id in the default snl(3) parsers.

Add the optional post-parse hook to the snl(3) parser declaration.
Use this hook to automatically add the interface indexes to the
 link-local sockaddrs.

MFC after: 2 weeks

15 months agonetlink: use consistent variable lifetime in the default snl(3) parsers.
Alexander V. Chernikov [Tue, 9 May 2023 14:45:57 +0000 (14:45 +0000)]
netlink: use consistent variable lifetime in the default snl(3) parsers.

Currently, parsers use original strings/nla pointers instead of
duplicating them. These pointers refer to the temporary packet buffer,
 which can be silently rewritten when the next message is read.
Instead, duplicate all string/nla attributes using snl_allocz(3) to
 give control over variable lifetime to the user.

MFC after: 2 weeks

15 months agoefiwake(8): add man page
Johannes Totz [Tue, 9 May 2023 13:42:19 +0000 (14:42 +0100)]
efiwake(8): add man page

Reviewed by: christos, grahamperrin, kib
Differential revision: https://reviews.freebsd.org/D39961

15 months agogeom.8: Fix typos and wordsmith
Mateusz Piotrowski [Tue, 9 May 2023 13:46:00 +0000 (15:46 +0200)]
geom.8: Fix typos and wordsmith

MFC after: 3 days

15 months agofwget: Use BSD-2-Clause instead of BSD-2-Clause-FreeBSD
Emmanuel Vadot [Tue, 9 May 2023 14:03:39 +0000 (16:03 +0200)]
fwget: Use BSD-2-Clause instead of BSD-2-Clause-FreeBSD

Reported by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG

15 months agofwget: Fix a few kmod name
Emmanuel Vadot [Tue, 9 May 2023 14:02:03 +0000 (16:02 +0200)]
fwget: Fix a few kmod name

The -kmod part was forgot in a few names for Intel firmware.

Fixes: d198b8774d2c ("fwget: Introduce new utility")
Reported by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG

15 months agolibfido2: specify OpenSSL 1.1 API
Ed Maste [Tue, 9 May 2023 12:44:23 +0000 (08:44 -0400)]
libfido2: specify OpenSSL 1.1 API

OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.  A future
libfido2 update may switch to use OpenSSL 3.0 APIs.

Sponsored by: The FreeBSD Foundation

15 months agobhyve: save/restore pir_desc
Vitaliy Gusev [Tue, 9 May 2023 08:27:29 +0000 (10:27 +0200)]
bhyve: save/restore pir_desc

Failing to preserve pir_desc can result in pending interrupts being lost
on resume leading to a hung VM.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D35447