]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 months agonetlink: fix compiler warnings
Alexander V. Chernikov [Tue, 9 May 2023 15:26:16 +0000 (15:26 +0000)]
netlink: fix compiler warnings

16 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.

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 months agobhyve: fix vCPU single-stepping on VMX
Bojan Novković [Tue, 9 May 2023 07:02:04 +0000 (09:02 +0200)]
bhyve: fix vCPU single-stepping on VMX

This patch fixes virtual machine single stepping on VMX hosts.

Currently, when using bhyve's gdb stub, each attempt at single-stepping
a vCPU lands in a timer interrupt. The current single-stepping mechanism
uses the Monitor Trap Flag feature to cause VMEXIT after a single
instruction is executed. Unfortunately, the SDM states that MTF causes
VMEXITs for the next instruction that gets executed, which is often not
what the person using the debugger expects. [1]

This patch adds a new VM capability that masks interrupts on a vCPU by
blocking interrupt injection and modifies the gdb stub to use the newly
added capability while single-stepping a vCPU.

[1] Intel SDM 26.5.2 Vol. 3C

Reviewed by: corvink, jbh
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39949

16 months agoem(4): update sysctl list, mention iflib(4)
Yuri Pankov [Tue, 9 May 2023 08:00:32 +0000 (10:00 +0200)]
em(4): update sysctl list, mention iflib(4)

Some of the settings, e.g. disabling/enabling msix, are now handled
as generic iflib variables; mention iflib explicitly in tunables
section (in addition to SEE ALSO).

Reviewed by: cc, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D39999

16 months agoRevert "uart(4): add Sunrise Point UART controllers"
Kyle Evans [Tue, 9 May 2023 06:38:32 +0000 (01:38 -0500)]
Revert "uart(4): add Sunrise Point UART controllers"

This reverts commit d1b6271118188dd25a18f2372ab1d3004335ea3c.

I've received multiple reports of machines failing to boot with
this hardware; back it out for now until we can fix it.

PR: 271147
MFC after: Morning coffee

16 months agoacl(3): improve discoverability of acl_get_perm_np(3)
Kyle Evans [Tue, 9 May 2023 03:45:12 +0000 (22:45 -0500)]
acl(3): improve discoverability of acl_get_perm_np(3)

- Mention it in acl(3) as an available function, xref
- Mention it in acl_get_permset(3), as acl_get_perm_np(3) is a natural
    follow-up to acl_get_permset(3)

Sponsored by: Klara, Inc.

16 months agocalendar: cleanup obsolete directories
Yuri Pankov [Mon, 8 May 2023 22:43:12 +0000 (00:43 +0200)]
calendar: cleanup obsolete directories

Follow 5282ada06bb and don't reinstall obsolete directories.

16 months agobhyve: specify OpenSSL 1.1 API
Ed Maste [Mon, 8 May 2023 12:09:26 +0000 (08:09 -0400)]
bhyve: 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
change can then switch bhyve to use OpenSSL 3.0 APIs.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39998

16 months agocpuset: increase userland maximum size to 1024
Ed Maste [Tue, 2 May 2023 20:57:12 +0000 (16:57 -0400)]
cpuset: increase userland maximum size to 1024

Hardware with more than 256 CPU cores is now available and will become
increasingly common.  Bump CPU_MAXSIZE (used for userland cpuset_t
sizing) to 1024 to define the ABI for FreeBSD 14.

PR: 269572, 271213 [exp-run]
Reviewed by: mjg, jhb
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39941

16 months agoif_ovpn tests: fix route_to test case
Kristof Provost [Mon, 8 May 2023 15:44:47 +0000 (17:44 +0200)]
if_ovpn tests: fix route_to test case

* Move the .254 address to the tunnel device so we reply through the
  tunnel.
* Remove the network route to 'break' routing, which we then 'fix' with
  pf's route-to, which is the functionality we wanted to test in the
  first place.

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

16 months agoif_ovpn: notify userspace when we've used half of the sequence numbers
Kristof Provost [Mon, 8 May 2023 14:41:48 +0000 (16:41 +0200)]
if_ovpn: notify userspace when we've used half of the sequence numbers

OpenVPN uses the sequence number (as well as a userspace supplied nonce)
to build the IV. This means we should avoid re-using sequence numbers.
However, userspace doesn't know how many packets we've sent (and thus
what sequence number we're up to).

Notify userspace when we've used half of the available sequence numbers
to tell it that it's time for a key renegotiaton.

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

16 months agoarm64/disassem.c: Add detection of xzr and sp
Mykola Hohsadze [Mon, 8 May 2023 13:39:09 +0000 (10:39 -0300)]
arm64/disassem.c: Add detection of xzr and sp

Added support to distinguish between XZR/WZR and SP/WSP registers.

Add new OP_ flags to indicate if the instruction allows the use of SP
for a given register field. "wSP" and "SP" are removed from w_reg and
x_reg, and helper functions are introduced for this purpose of detecting
the correct name of the x31 register.

mhorne: While here, adjust some whitespace issues from a previous
commit.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39862

16 months agovt(4): document enable_altgr
Yuri Pankov [Mon, 8 May 2023 13:51:43 +0000 (15:51 +0200)]
vt(4): document enable_altgr

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D39997

16 months agomd5: Improve compatibility.
Dag-Erling Smørgrav [Mon, 8 May 2023 06:56:09 +0000 (06:56 +0000)]
md5: Improve compatibility.

* Overhaul the GNU compatibility mode to more closely emulate what the GNU tools do.

* Add a Perl compatibility mode which emulates the shasum tool that ships with Perl.  This is currently not installed.

* Overhaul the tests.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D39446

16 months agotwe: Add deprecation notice
Warner Losh [Mon, 8 May 2023 05:14:12 +0000 (23:14 -0600)]
twe: Add deprecation notice

This was flagged for removal in 14 over a year ago. Add deprecation to
man page.

MFC After: 3 days

16 months agoMAINTAINERS: Add myself to stand
Warner Losh [Mon, 8 May 2023 04:28:16 +0000 (22:28 -0600)]
MAINTAINERS: Add myself to stand

People email me when the boot loader breaks anyway, so ask to be
included in reviews. And ask strongly since I've had to deal with too
many major breakages lately, distruting other things I need to do.

Sponsored by: Netflix

16 months agociss: Fix typo
Warner Losh [Mon, 8 May 2023 04:25:01 +0000 (22:25 -0600)]
ciss: Fix typo

Although unused, fixed type in CISS_BOARD_UNKNOWN #define.

Submitted by: Peter Eriksson (a trivial part of D25155)

16 months agounionfs(): destroy root vnode if upper registration fails
Jason A. Harmening [Sun, 26 Mar 2023 01:50:55 +0000 (20:50 -0500)]
unionfs(): destroy root vnode if upper registration fails

If unionfs_domount() fails, the mount path will not call VFS_UNMOUNT()
to clean up after it.  If this failure happens during upper vnode
registration, the unionfs root vnode will already be allocated.
vflush() it in order to prevent the vnode from being leaked and the
subsequent vfs_mount_destroy() call from getting stuck waiting for
the mountpoint reference count to drain.

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

16 months agounionfs: prevent upperrootvp from being recycled during mount
Jason A. Harmening [Sun, 26 Mar 2023 01:41:33 +0000 (20:41 -0500)]
unionfs: prevent upperrootvp from being recycled during mount

If upperrootvp is doomed by a concurrent unmount, unionfs_nodeget()
may return without a reference or lock on it.  unionfs_domount() must
prevent the vnode from being recycled for use by a different file until
it is finished with the vnode, namely once vfs_register_upper_from_vp()
fails.  Accomplish this by holding the reference returned by namei()
a bit longer.

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

16 months agounionfs: fixes to unionfs_nodeget() error handling
Jason A. Harmening [Sun, 26 Mar 2023 01:30:25 +0000 (20:30 -0500)]
unionfs: fixes to unionfs_nodeget() error handling

If either the lower or upper vnode is found to be doomed after
locking it, the newly-created unionfs node won't be associated
with it and its lock will be dropped.  In that case, clear the
uppervp and lowervp locals as necessary to avoid further use
of the vnode in unionfs_nodeget().  If the upper vnode is doomed
but the lower vnode remains valid, additionally reset the unionfs
node's v_vnlock field to point to the lower vnode lock.

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

16 months agolibc: document when the namespace was created
Mariusz Zaborski [Sun, 7 May 2023 09:45:13 +0000 (11:45 +0200)]
libc: document when the namespace was created

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D39989

16 months agoRELNOTES: fix consistency
Elliott Mitchell [Sun, 7 May 2023 05:30:21 +0000 (23:30 -0600)]
RELNOTES: fix consistency

Colons on the commit ids started being lost at 89d197cc991a and
continued subsequent updates.

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

16 months agomountd: Improve error message for exports lines
Alexander Motin [Sat, 6 May 2023 18:57:14 +0000 (14:57 -0400)]
mountd: Improve error message for exports lines

Currently mountd print error message "symbolic link in export path or
statfs failed" in case some path component in an exports line fails
validation.  This revision improves the error message by giving more
information about the precise error as well as the path component that
caused the issue.

Submitted by: Andrew Walker <awalker@ixsystems.com>
Reviewed by: mav, rmacklem
Differential Revision: https://reviews.freebsd.org/D39840

16 months agohwpmc: pass pmc pointer to more class methods
Mitchell Horne [Fri, 5 May 2023 22:00:02 +0000 (19:00 -0300)]
hwpmc: pass pmc pointer to more class methods

In many cases this avoids an extra lookup, since the callers always have
pm at hand. We can also eliminate several assertions, mostly for pm !=
NULL. The class methods are an internal interface, and the callers
already handle such a scenario. No functional change intended.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39915

16 months agohwpmc: unused/diagused annotations in tsc class
Mitchell Horne [Fri, 5 May 2023 21:59:53 +0000 (18:59 -0300)]
hwpmc: unused/diagused annotations in tsc class

These are preferred over casts to void. No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39914

16 months agohwpmc: remove stub pmd_switch_{in,out} methods
Mitchell Horne [Fri, 5 May 2023 21:59:41 +0000 (18:59 -0300)]
hwpmc: remove stub pmd_switch_{in,out} methods

Most platforms (non-x86) don't require these methods and implement stub
versions. If we initialize the pmc_mdep structure to always point to the
generic versions, then we can purge the duplicate stubs.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39913

16 months agohwpmc: remove pmd_pcpu_{init,fini} callbacks
Mitchell Horne [Fri, 5 May 2023 21:59:33 +0000 (18:59 -0300)]
hwpmc: remove pmd_pcpu_{init,fini} callbacks

These are unused on all platforms.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39912

16 months agohwpmc_logging: less macro magic for type names
Mitchell Horne [Fri, 5 May 2023 21:59:27 +0000 (18:59 -0300)]
hwpmc_logging: less macro magic for type names

Provide the log type names in their entirely, rather than relying on the
macro to prepend the prefix. This improves their searchability; for
example, if I see PMCLOG_TYPE_PMCALLOCATE in libpmc I will now be able
to find where that is emitted in the kernel with a simple grep.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39911

16 months agohwpmc: don't use deprecated copystr(9)
Mitchell Horne [Fri, 5 May 2023 21:59:15 +0000 (18:59 -0300)]
hwpmc: don't use deprecated copystr(9)

It is just wrapper around strlcpy(), but results in more complicated
code. Clean this up to use strlcpy() or snprintf() as appropriate.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39910

16 months agohwpmc: use kstack_contains()
Mitchell Horne [Fri, 5 May 2023 21:59:01 +0000 (18:59 -0300)]
hwpmc: use kstack_contains()

This existing helper function is preferable to the hand-rolled
calculation of the kstack bounds.

Make some small style improvements while here. Notably, rename every
instance of "r", the return address, to "ra". Tidy the includes in the
affected files.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39909

16 months agohwpmc: simplify arm64 kernel stack unwinding
Mitchell Horne [Fri, 5 May 2023 21:58:40 +0000 (18:58 -0300)]
hwpmc: simplify arm64 kernel stack unwinding

Use the unwind_frame() function, which properly validates the frame
pointer and uses ADDR_MAKE_CANONICAL() for the pc, required when PAC is
enabled.

Reviewed by: andrew, markj, jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39934

16 months agopmcstat: augment an error message
Mitchell Horne [Fri, 5 May 2023 21:58:23 +0000 (18:58 -0300)]
pmcstat: augment an error message

It also applies to the -t argument.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39907

16 months agohwpmc: formatting of CPU and class lists
Mitchell Horne [Fri, 5 May 2023 21:58:13 +0000 (18:58 -0300)]
hwpmc: formatting of CPU and class lists

The end result is much more legible in both cases.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39906

16 months agohwpmc: trim MIPS CPU and class defs
Mitchell Horne [Fri, 5 May 2023 21:57:44 +0000 (18:57 -0300)]
hwpmc: trim MIPS CPU and class defs

MIPS is gone, and this is the last remaining bit in the pmc code.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39905

16 months agohwpmc: trim obsolete Intel CPU and class defs
Mitchell Horne [Fri, 5 May 2023 21:57:38 +0000 (18:57 -0300)]
hwpmc: trim obsolete Intel CPU and class defs

No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39904

16 months agopmccontrol: drop Pentium 4 special case
Mitchell Horne [Fri, 5 May 2023 21:57:23 +0000 (18:57 -0300)]
pmccontrol: drop Pentium 4 special case

This is dead code; we no longer support Pentium hardware in libpmc or
hwpmc.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

16 months agopmc_events.h: event list formatting
Mitchell Horne [Fri, 5 May 2023 21:57:14 +0000 (18:57 -0300)]
pmc_events.h: event list formatting

Improve the legibility of the list. Bump overall indentation, fix some
whitespace, and sort the IAF block.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39903

16 months agopmc_events.h: update event list comment
Mitchell Horne [Fri, 5 May 2023 21:56:55 +0000 (18:56 -0300)]
pmc_events.h: update event list comment

This comment is no longer in sync with the contents of __PMC_EVENTS().
Update to reflect the removal of various Intel event definitions from
this list; these event definitions now come from Linux and live in
lib/libpmc/pmu-events/.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39902

16 months agohwpmc: remove remaining UCP event definitions
Mitchell Horne [Fri, 5 May 2023 21:56:34 +0000 (18:56 -0300)]
hwpmc: remove remaining UCP event definitions

Although this block has remained in __PMC_EVENTS(), there is no handling
of UCP in libpmc/libpmc.c, so it is not possible to select one of these
events. It should therefore be impossible to trigger the code removed
from ucp_start_pmc(). Note that the GQ_SNOOP_MSF MSR exists only for
Nehalem and Westmere architectures, and the related events do not exist
for later generations.

The Uncore support in hwpmc has severely atrophied in general. We have
uncore event definitions in pmu-events, but the kernel support was
written against Intel Performance Measurement Architecture version 2,
and is disabled for processor generations later than Westmere. Nehalem
and Westmere lack uncore event definitions in pmu-events. I'd be
surprised if Uncore support is usable on any machine in its current
state.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39901

16 months agohwpmc: drop vestigial IAP event definitions
Mitchell Horne [Fri, 5 May 2023 21:55:54 +0000 (18:55 -0300)]
hwpmc: drop vestigial IAP event definitions

These are maintained elsewhere. No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39900

16 months agoamd64: add MINIMALUP config
Konstantin Belousov [Sat, 6 May 2023 11:22:58 +0000 (14:22 +0300)]
amd64: add MINIMALUP config

This is the MINIMAL config with SMP/NUMA options turned off.
Useful to ensure that UP configuration still builds, until it is removed
finally.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

16 months agoamd64 MINIMAL config: remove sentence about acpi
Konstantin Belousov [Sat, 6 May 2023 11:21:13 +0000 (14:21 +0300)]
amd64 MINIMAL config: remove sentence about acpi

On amd64 ACPI is required to boot, it cannot work as a module, and we do
not build the ACPI module for long time.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

16 months agoamd64: convert UP code to dynamically allocated pmap->pm_pcid
Konstantin Belousov [Sat, 6 May 2023 11:20:15 +0000 (14:20 +0300)]
amd64: convert UP code to dynamically allocated pmap->pm_pcid

Reported by: peterj
Sponsored by: The FreeBSD Foundation

16 months agobblog: inherit TCP_LOG option from listener
Michael Tuexen [Sat, 6 May 2023 09:21:16 +0000 (11:21 +0200)]
bblog: inherit TCP_LOG option from listener

When the TCP_LOG option is used to enable logging on a listening
socket, inherit this if the listener is not auto selected and does
not have a log id set.

Reviewed by: cc
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D38436

16 months agotcp: improve BBLoging for PRUs
Michael Tuexen [Sat, 6 May 2023 09:12:06 +0000 (11:12 +0200)]
tcp: improve BBLoging for PRUs

Log all errors for PRUs, except when INP_DROPPED is set. In that case,
don't log it.

Reviewed by: glebius, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D39591

16 months agotcp_rack: allow the module to be loaded without TCP_BLACKBOX
Michael Tuexen [Sat, 6 May 2023 09:02:50 +0000 (11:02 +0200)]
tcp_rack: allow the module to be loaded without TCP_BLACKBOX

PR: 271091
Reviewed by: cc
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D39860

16 months agolibfido2: update to 1.10.0
Ed Maste [Fri, 5 May 2023 23:57:34 +0000 (19:57 -0400)]
libfido2: update to 1.10.0

Some highlights from NEWS:

 ** bio: fix CTAP2 canonical CBOR encoding in fido_bio_dev_enroll_*();
    gh#480.
 ** New API calls:
  - fido_dev_info_set;
  - fido_dev_io_handle;
  - fido_dev_new_with_info;
  - fido_dev_open_with_info.
 ** Documentation and reliability fixes.
 ** Support for TPM 2.0 attestation of COSE_ES256 credentials.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

16 months agolibfido2: update to 1.9.0
Ed Maste [Fri, 5 May 2023 23:11:52 +0000 (19:11 -0400)]
libfido2: update to 1.9.0

Some highlights from NEWS:

 ** Added OpenSSL 3.0 compatibility.
 ** Removed OpenSSL 1.0 compatibility.
 ** Support for FIDO 2.1 "minPinLength" extension.
 ** Support for COSE_EDDSA, COSE_ES256, and COSE_RS1 attestation.
 ** Support for TPM 2.0 attestation.
 ** Support for device timeouts; see fido_dev_set_timeout().
 ** New API calls:
  - es256_pk_from_EVP_PKEY;
  - fido_cred_attstmt_len;
  - fido_cred_attstmt_ptr;
  - fido_cred_pin_minlen;
  - fido_cred_set_attstmt;
  - fido_cred_set_pin_minlen;
  - fido_dev_set_pin_minlen_rpid;
  - fido_dev_set_timeout;
  - rs256_pk_from_EVP_PKEY.
 ** Reliability and portability fixes.
 ** Better handling of HID devices without identification strings; gh#381.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

16 months agonfsd: Fix NFSv3 Readdir/ReaddirPlus reply for large i-node numbers
Rick Macklem [Fri, 5 May 2023 22:43:55 +0000 (15:43 -0700)]
nfsd: Fix NFSv3 Readdir/ReaddirPlus reply for large i-node numbers

If the i-node number (d_fileno) for a file on the server did
not fit in 32bits, it would be truncated to the low order 32bits
for the NFSv3 Readdir and ReaddirPlus RPC replies.
This is no longer correct, given that ino_t is now 64bits.

This patch fixes this by sending the full 64bits of d_fileno
on the wire in the NFSv3 Readdir/ReaddirPlus RPC reply.

PR: 271174
Reported by: bmueller@panasas.com
Tested by: bmueller@panasas.com
MFC after: 2 weeks

16 months agoAdd mrsasutil(8) as alias to mfiutil(8)
Doug Ambrisko [Wed, 24 Aug 2022 22:38:43 +0000 (15:38 -0700)]
Add mrsasutil(8) as alias to mfiutil(8)

mfiutil(8) in theory can work on devices attached to mrsas(4) but
mrsas(4) is missing the FreeBSD mfi(4) ioctl support.  Once that
support is added to mrsas(4) then mrsasutil(8) can manage mrsas(4)
attached devices.  So this commit depends on that.  When mrsasutil(8)
is run it automatically opens /dev/mrsas0 instead of /dev/mfi0.
Add -D <device> and -t <type> flag to optionally specify mrsas or mfi to
work with the existing -u <unit>.  Device is the device node with or
without /dev/

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265794
Differential Revision: https://reviews.freebsd.org/D36343
Tested by: Dan Mahoney <freebsd@gushi.org>
Reviewed by: jhb

16 months agoApply libc++ fix for compiling <type_traits> with gcc 13
Dimitry Andric [Fri, 5 May 2023 16:19:40 +0000 (18:19 +0200)]
Apply libc++ fix for compiling <type_traits> with gcc 13

Merge commit 484e64f7e7b2 from llvm-project (by Roland McGrath):

  [libc++] Use __is_convertible built-in when available

  https://github.com/llvm/llvm-project/issues/62396 reports that
  GCC 13 barfs on parsing <type_traits> because of the declarations
  of `struct __is_convertible`.  In GCC 13, `__is_convertible` is a
  built-in, but `__is_convertible_to` is not.  Clang has both, so
  using either should be fine.

  Reviewed By: #libc, philnik

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

Reported by: Mark Millard <marklmi@yahoo.com>
MFC after: 3 days

16 months agodaemon: EINTR from kevent(2) is not a fatal error
Kyle Evans [Fri, 5 May 2023 15:12:13 +0000 (10:12 -0500)]
daemon: EINTR from kevent(2) is not a fatal error

Simply resume waiting for events rather than exiting if we took a signal
here.

This at least fixes running programs under daemon(8) in the face of
suspend/resume, which I suspect hits us with a spurious EINTR rather
than a signal anyways.

Reported and tested by: manu
Fixes: 8935a3993219b ("daemon: use kqueue for all events")

16 months agoman9: Add a manual page for kstack_contains(9).
Joseph Koshy [Tue, 2 May 2023 09:37:38 +0000 (10:37 +0100)]
man9: Add a manual page for kstack_contains(9).

Approved by: gnn (mentor)
Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D39933

16 months agoshare/mk/bsd.cpu.mk: add AltiVec / VSX to powerpc*'s MACHINE_CPU
Piotr Kubaj [Fri, 5 May 2023 14:19:19 +0000 (16:19 +0200)]
share/mk/bsd.cpu.mk: add AltiVec / VSX to powerpc*'s MACHINE_CPU

MFC after: 3 days
Approved by: jhibbits
Differential revision: https://reviews.freebsd.org/D39240

16 months agolibpcap: Update to 1.10.4
Joseph Mingrone [Fri, 5 May 2023 13:56:10 +0000 (10:56 -0300)]
libpcap: Update to 1.10.4

Changelog: https://git.tcpdump.org/libpcap/blob/104271ba4a14de6743e43bcf87536786d8fddea4:/CHANGES
Reviewed by: emaste
Obtained from: https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz
Sponsored by: The FreeBSD Foundation

16 months agovmm: don't free unallocated memory
Corvin Köhne [Fri, 5 May 2023 06:36:20 +0000 (08:36 +0200)]
vmm: don't free unallocated memory

If vmx or svm is disabled in BIOS or the device isn't supported by vmm,
modinit won't allocate these state save areas. As kmem_free panics when
passing a NULL pointer to it, loading the vmm kernel module causes a
panic too.

PR: 271251
Reviewed by: markj
Fixes: 74ac712f72cfd6d7b3db3c9d3b72ccf2824aa183 ("vmm: Dynamically allocate a couple of per-CPU state save areas")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39974

16 months agobhyve(8): fix typo in examples
Alexey Marchenko [Fri, 5 May 2023 12:56:50 +0000 (14:56 +0200)]
bhyve(8): fix typo in examples

PR: 271259

16 months agodd: Fix SIGINT handling.
Dag-Erling Smørgrav [Fri, 5 May 2023 11:17:44 +0000 (11:17 +0000)]
dd: Fix SIGINT handling.

Currently, we handle SIGINT by calling summary() and _exit() directly from the signal handler, which we install after setup().  There are several issues with this:

* summary() is not signal safe;
* the parent is not informed about the signal;
* setup() can block on open(), and catching SIGINT at that stage will produce the correct exit status but will not print anything to stderr as POSIX demands.

Fix this by making SIGINT non-restartable, changing our signal handler to only set a flag, installing it before setup(), and checking the termination flag before and after every blocking operation, i.e. open(), read(), write().

Also add two test cases, one for catching SIGINT while opening the input and one for catching it while reading.  I couldn't think of an easy way to test catching SIGINT while writing (it's certainly feasible, but perhaps not from a shell script).

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: cracauer, ngie, imp
Differential Revision: https://reviews.freebsd.org/D39641

16 months agodd: Tidy up the tests.
Dag-Erling Smørgrav [Fri, 5 May 2023 11:17:39 +0000 (11:17 +0000)]
dd: Tidy up the tests.

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

16 months agoMakefile.inc1: use make builtin :ts instead of sed
Ed Maste [Sun, 10 Apr 2022 22:52:48 +0000 (18:52 -0400)]
Makefile.inc1: use make builtin :ts instead of sed

Commit 3eb1b4da3cf7 replaced "xargs -n1" with a sed expression to
convert from space to newline as a list separator for *-old-* targets.
Dan Nelson followed up with a suggestion to use make's built-in :ts
instead, which should be slightly more efficient.

Reviewed by: sjg
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39972

16 months agopf: fix a few more prototypes
Kristof Provost [Fri, 5 May 2023 11:40:25 +0000 (13:40 +0200)]
pf: fix a few more prototypes

Fix function prototypes to use the same type for sa_family_t as the
definition.

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

16 months agopvscsi: maximum target number is one less than number of targets
Yuri Pankov [Fri, 5 May 2023 09:48:57 +0000 (11:48 +0200)]
pvscsi: maximum target number is one less than number of targets

Fix the number of targets we inquiry to be one less than the maximum
number of targets adapter reports.  This gets rid of the errors reported
on VMware Workstation:

(probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error

While here, print the maximum number of targets.

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

16 months agontpd: Support IPv6-only hosts
Mina Galic [Fri, 5 May 2023 04:33:18 +0000 (21:33 -0700)]
ntpd: Support IPv6-only hosts

0.pool.* returns only IPv4 addresses.
2.pool.* returns both, IPv6 and IPv4 addresses.

conservatively extend our IPv4 only pool configuration by adding a
second pool, which also returns IPv6 addresses.

PR: 270536
Reported by: Lapo Luchini <lapo@lapo.it>
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/731
Differential Revision: https://reviews.freebsd.org/D39954

16 months agobuild.7: remove reference to deprecated mergemaster
Ed Maste [Fri, 3 Mar 2023 13:54:22 +0000 (08:54 -0500)]
build.7: remove reference to deprecated mergemaster

Sponsored by: The FreeBSD Foundation

16 months agosys/x86/x86/mptable.c: typo (compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:08:26 +0000 (01:08 +0100)]
sys/x86/x86/mptable.c: typo (compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

16 months agosys/sys/_endian.h: typo (Compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:05:11 +0000 (01:05 +0100)]
sys/sys/_endian.h: typo (Compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

16 months agosys/netpfil/ipfw/ip_fw2.c: typo (Compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:01:33 +0000 (01:01 +0100)]
sys/netpfil/ipfw/ip_fw2.c: typo (Compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

16 months agosys/amd64/conf/FIRECRACKER: typo (compatiblity)
Igor Ostapenko [Thu, 4 May 2023 19:44:21 +0000 (20:44 +0100)]
sys/amd64/conf/FIRECRACKER: typo (compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

16 months agoAdd wifi(4) alias for wlan(4).
Warner Losh [Thu, 4 May 2023 22:19:16 +0000 (16:19 -0600)]
Add wifi(4) alias for wlan(4).

Suggested by: jrtc27
Sponsored by: Netflix

16 months agompsutil(8): Remove a stray paragraph
Tom Hukins [Thu, 4 May 2023 22:05:15 +0000 (16:05 -0600)]
mpsutil(8): Remove a stray paragraph

Spotted by running `mandoc -Tlint usr.sbin/mpsutil/mpsutil.8`.

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

16 months agompsutil(8): Improve English usage
Tom Hukins [Thu, 4 May 2023 22:05:15 +0000 (16:05 -0600)]
mpsutil(8): Improve English usage

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

16 months agompr(4) & mps(4): refer to related utilities
Tom Hukins [Thu, 4 May 2023 22:05:14 +0000 (16:05 -0600)]
mpr(4) & mps(4): refer to related utilities

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

16 months agobluetooth/hccontrol: Fix unterminated command list
Brian Campbell [Thu, 4 May 2023 22:01:31 +0000 (16:01 -0600)]
bluetooth/hccontrol: Fix unterminated command list

Signed-off-by: Brian Campbell <Brian.Campbell@ed.ac.uk>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/730

16 months agowlan(4): Mention WiFi more prominently
Tom Hukins [Mon, 1 May 2023 14:47:58 +0000 (15:47 +0100)]
wlan(4): Mention WiFi more prominently

WiFi is a commonly used term to describe wireless LANs.  Adding this
word will help readers better understand the contents of this manual
page and will help find the page when searching, for example when
running `man -k wifi`.

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

16 months agoemac(4): Use bool rather than boolean_t.
John Baldwin [Thu, 4 May 2023 19:34:02 +0000 (12:34 -0700)]
emac(4): Use bool rather than boolean_t.

This was already using true/false rather than TRUE/FALSE.

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

16 months agoofw_cpu_early_foreach: Change callback to return bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:33:39 +0000 (12:33 -0700)]
ofw_cpu_early_foreach: Change callback to return bool instead of boolean_t.

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

16 months agodwc(4): Use bool rather than boolean_t.
John Baldwin [Thu, 4 May 2023 19:33:20 +0000 (12:33 -0700)]
dwc(4): Use bool rather than boolean_t.

This was already using true/false rather than TRUE/FALSE.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D39925

16 months agodpaa2: Replace boolean_t with bool.
John Baldwin [Thu, 4 May 2023 19:32:57 +0000 (12:32 -0700)]
dpaa2: Replace boolean_t with bool.

This was already using true/false rather than TRUE/FALSE.

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

16 months agoal: Replace boolean_t with either al_bool or bool.
John Baldwin [Thu, 4 May 2023 19:32:40 +0000 (12:32 -0700)]
al: Replace boolean_t with either al_bool or bool.

Use al_bool for interfaces and structures defined in the
OS-independent HAL in sys/contrib, and use plain bool for
FreeBSD-specific APIs and structures in sys/dev/al_eth.

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

16 months agoacpi_button: Replace boolean_t with better types.
John Baldwin [Thu, 4 May 2023 19:32:09 +0000 (12:32 -0700)]
acpi_button: Replace boolean_t with better types.

- Use an enum for the button type (it is not really a boolean value).

- Use bool for fixed.

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

16 months agopmap_{un}map_io_transient: Use bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:29:48 +0000 (12:29 -0700)]
pmap_{un}map_io_transient: Use bool instead of boolean_t.

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D39920

16 months agoimgact_elf: Change header_supported to return bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:29:29 +0000 (12:29 -0700)]
imgact_elf: Change header_supported to return bool instead of boolean_t.

Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D39919

16 months agomd5 Makefile.depend.host
Simon J. Gerraty [Thu, 4 May 2023 19:03:34 +0000 (12:03 -0700)]
md5 Makefile.depend.host

16 months agolocal.dirdeps.mk skip N_host_libs for non-FreeBSD host
Simon J. Gerraty [Thu, 4 May 2023 18:58:39 +0000 (11:58 -0700)]
local.dirdeps.mk skip N_host_libs for non-FreeBSD host

The N_host_libs dance only makes sense if host is FreeBSD.
Even then, if MK_host_egacy is yes we need libmd

libnetbsd does not need libutil when using libegacy

Sponsored by: Juniper Networks, Inc.

16 months agotsort: Error out if writing to stdout failed.
Dag-Erling Smørgrav [Thu, 4 May 2023 17:26:59 +0000 (17:26 +0000)]
tsort: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D39959

16 months agoncal: Error out if writing to stdout failed.
Dag-Erling Smørgrav [Thu, 4 May 2023 17:26:54 +0000 (17:26 +0000)]
ncal: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D39958

16 months agodirdeps.mk for host* DEP_TARGET_SPEC is just DEP_MACHINE
Simon J. Gerraty [Thu, 4 May 2023 18:29:33 +0000 (11:29 -0700)]
dirdeps.mk for host* DEP_TARGET_SPEC is just DEP_MACHINE

This helps avoid ugly noise in dirdeps.cache on Linux.

16 months agoUpdate meta.sys.mk ensure DEP_* set at level 1+
Simon J. Gerraty [Thu, 4 May 2023 16:46:47 +0000 (09:46 -0700)]
Update meta.sys.mk ensure DEP_* set at level 1+

16 months agopf: remove NULL check before uma_zfree()
Kristof Provost [Thu, 4 May 2023 15:20:02 +0000 (17:20 +0200)]
pf: remove NULL check before uma_zfree()

uma_zfree() can be called on a NULL pointer. Simplify the pf code a
little by removing the redundant checks.

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

16 months agoAdd 'contrib/spleen/' from commit '5eab6333fa27e2b6954c6927859d462a004e57bb'
Ed Maste [Thu, 4 May 2023 15:46:25 +0000 (11:46 -0400)]
Add 'contrib/spleen/' from commit '5eab6333fa27e2b6954c6927859d462a004e57bb'

git-subtree-dir: contrib/spleen
git-subtree-mainline: 3582acbad303bb69895457a8a7dae0f485efe8ea
git-subtree-split: 5eab6333fa27e2b6954c6927859d462a004e57bb

Reviewed by: imp [earlier]
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20653

16 months agoamd64 mp_machdep.c: remove useless comment
Konstantin Belousov [Thu, 4 May 2023 06:24:03 +0000 (09:24 +0300)]
amd64 mp_machdep.c: remove useless comment

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39945

16 months agoamd64: do not leak pcpu pages
Konstantin Belousov [Wed, 3 May 2023 09:41:46 +0000 (12:41 +0300)]
amd64: do not leak pcpu pages

Do not preallocate pcpu area backing pages on early startup, only
allocate enough of KVA for pcpu[MAXCPU] and the page for BSP.  Other
pages are allocated after we know the number of cpus and their
assignments to the domains.

PCPUs are not accessed until they are initialized, which happens on AP
startup.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39945