Commit Graph

283688 Commits

Author SHA1 Message Date
Emmanuel Vadot
d7f39ec19f fwget: Fix a few kmod name
The -kmod part was forgot in a few names for Intel firmware.

Fixes:		d198b8774d ("fwget: Introduce new utility")
Reported by:	bz
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-05-09 16:02:03 +02:00
Ed Maste
469c325a49 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
2023-05-09 09:46:09 -04:00
Vitaliy Gusev
c543e09f1f
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
2023-05-09 10:31:27 +02:00
Bojan Novković
fefac54359
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
2023-05-09 10:04:55 +02:00
Yuri Pankov
b0cf48305f 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
2023-05-09 10:00:32 +02:00
Kyle Evans
20d8d9809a Revert "uart(4): add Sunrise Point UART controllers"
This reverts commit d1b6271118.

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
2023-05-09 01:38:32 -05:00
Kyle Evans
20c61a7c51 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.
2023-05-08 22:45:12 -05:00
Yuri Pankov
7adea6dbed calendar: cleanup obsolete directories
Follow 5282ada06b and don't reinstall obsolete directories.
2023-05-09 00:43:12 +02:00
George Amanakis
4eca03faaf
Fixes in head_errlog feature with encryption
For the head_errlog feature use dsl_dataset_hold_obj_flags() instead of
dsl_dataset_hold_obj() in order to enable access to the encryption keys
(if loaded). This enables reporting of errors in encrypted filesystems
which are not mounted but have their keys loaded.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14837
2023-05-08 13:35:03 -07:00
Ed Maste
9c6f3dfda6 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
2023-05-08 14:32:27 -04:00
Ed Maste
76887e84be 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
2023-05-08 14:25:15 -04:00
Matthew Ahrens
3095ca91c2
Verify block pointers before writing them out
If a block pointer is corrupted (but the block containing it checksums
correctly, e.g. due to a bug that overwrites random memory), we can
often detect it before the block is read, with the `zfs_blkptr_verify()`
function, which is used in `arc_read()`, `zio_free()`, etc.

However, such corruption is not typically recoverable.  To recover from
it we would need to detect the memory error before the block pointer is
written to disk.

This PR verifies BP's that are contained in indirect blocks and dnodes
before they are written to disk, in `dbuf_write_ready()`. This way,
we'll get a panic before the on-disk data is corrupted. This will help
us to diagnose what's causing the corruption, as well as being much
easier to recover from.

To minimize performance impact, only checks that can be done without
holding the spa_config_lock are performed.

Additionally, when corruption is detected, the raw words of the block
pointer are logged.  (Note that `dprintf_bp()` is a no-op by default,
but if enabled it is not safe to use with invalid block pointers.)

Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #14817
2023-05-08 11:20:23 -07:00
Brian Behlendorf
dd19821149
zdb: consistent xattr output
When using zdb to output the value of an xattr only interpret it
as printable characters if the entire byte array is printable.
Additionally, if the --parseable option is set always output the
buffer contents as octal for easy parsing.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14830
2023-05-08 11:17:41 -07:00
Brian Behlendorf
245f4a3467
ZTS: add snapshot/snapshot_002_pos exception
Add snapshot_002_pos to the known list of occasional failures
for FreeBSD until it can be made entirely reliable.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #14831
Closes #14832
2023-05-08 10:09:30 -07:00
Kristof Provost
f76df4718d 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")
2023-05-08 17:44:47 +02:00
Kristof Provost
f7ee28e755 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
2023-05-08 16:43:25 +02:00
Mykola Hohsadze
9f60b8ce60 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
2023-05-08 10:59:35 -03:00
Yuri Pankov
1e37655ec3 vt(4): document enable_altgr
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D39997
2023-05-08 15:51:43 +02:00
Dag-Erling Smørgrav
4849767cb1 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
2023-05-08 06:56:22 +00:00
Warner Losh
f710a4de92 twe: Add deprecation notice
This was flagged for removal in 14 over a year ago. Add deprecation to
man page.

MFC After: 3 days
2023-05-07 23:14:12 -06:00
Warner Losh
be68c895c8 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
2023-05-07 22:30:10 -06:00
Warner Losh
4e2ddfba50 ciss: Fix typo
Although unused, fixed type in CISS_BOARD_UNKNOWN #define.

Submitted by: Peter Eriksson (a trivial part of D25155)
2023-05-07 22:25:01 -06:00
Jason A. Harmening
356e698011 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
2023-05-07 18:30:43 -05:00
Jason A. Harmening
0745d837c2 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
2023-05-07 18:30:43 -05:00
Jason A. Harmening
0809172985 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
2023-05-07 18:30:43 -05:00
Mariusz Zaborski
95950880ad libc: document when the namespace was created
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39989
2023-05-07 11:45:13 +02:00
Elliott Mitchell
af8e0a60d9 RELNOTES: fix consistency
Colons on the commit ids started being lost at 89d197cc99 and
continued subsequent updates.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D39991
2023-05-06 23:32:04 -06:00
Alexander Motin
572b77f8da 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
2023-05-06 15:02:08 -04:00
Mitchell Horne
39f92a76a9 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
a35453b9c7 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
fa88954fd8 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
772b2dc3ab 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
3a7c9fc01b 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
31610e34b7 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
aba91805aa 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
5387495773 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
bf66159342 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
7253dc57a0 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
2023-05-06 14:49:19 -03:00
Mitchell Horne
3c8b7f49d0 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
ca43b2ae3e 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
8bd4459560 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
b6c9d2a3f8 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
6bdf067890 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
d71a439020 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
2023-05-06 14:49:18 -03:00
Mitchell Horne
1be8ef2679 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
2023-05-06 14:49:18 -03:00
Konstantin Belousov
38843fe0f2 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
2023-05-06 14:24:07 +03:00
Konstantin Belousov
3a8c69c1ff 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
2023-05-06 14:24:07 +03:00
Konstantin Belousov
7c8e66ed8d amd64: convert UP code to dynamically allocated pmap->pm_pcid
Reported by:	peterj
Sponsored by:	The FreeBSD Foundation
2023-05-06 14:24:07 +03:00
Michael Tuexen
e044a0bce4 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
2023-05-06 11:21:16 +02:00
Michael Tuexen
c2399dd2e2 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
2023-05-06 11:12:06 +02:00