282215 Commits

Author SHA1 Message Date
Alexander V. Chernikov
8d19575fde netlink: reduce the default debugging levels
Reported by:	kp
MFC after:	2 weeks
2023-04-03 04:12:25 -04:00
Ed Maste
ebe889e57d lorder: add deprecation notice
lorder has not been used by the base system since 0e1e341b486c and
hasn't really been necessary for a very long time.

PR:		259254 [exp-run]
Reviewed by:	arichardson (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30080
2023-04-03 04:12:25 -04:00
Ed Maste
bb6182f567 ldd: clarify format options
-f may be specified zero, one, or two times.  Make this clear in the
usage.

Reviewed by:	markj, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34733
2023-04-03 04:12:25 -04:00
Ed Maste
a16ad7833f tcp_wrappers: Use ANSI (c89) function definitions
Although this code is in contrib/ there is no active upstream.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36047
2023-04-03 04:12:25 -04:00
Ed Maste
e15794ea99 gvinum: correct assertions
Pointer addresses are always >= 0.  Assert that the value is >= 0
instead.

PR:		207855, 207856
Reviewed by:	imp
Reported by:	David Binderman
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37677
2023-04-03 04:12:24 -04:00
Justin Hibbits
ca90fd1686 powerpc/pmap: Account for a potential NULL pmap in pmap_sync_icache
It's apparently possible for pcpu->pc_curpmap to be NULL at some point,
leading to a panic.  Account for this as is done with the other 64-bit
AIM pmap.

Reported by:	pkubaj
Tested by:	pkubaj
Fixes:		6f0b2a235a1 ("Add pmap_sync_icache() for radix pmap")
MFC after:	3 days
2023-04-03 04:12:24 -04:00
David E. O'Brien
b177aa936f pmap_mapdev_attr() doesn't use any of its arguments. 2023-04-03 04:12:24 -04:00
Ihor Antonov
0cbf308022 daemon: move signal setup into a function
No functional change intended.

Reviewed by:	kevans
2023-04-03 04:12:24 -04:00
Zhenlei Huang
1e16025dfd if_re: Drop redundant assignments for ifq_maxlen and ifq_drv_maxlen
Fixes:	4519a073c326b Mechanically convert if_re(4) to DrvAPI
2023-04-03 04:12:24 -04:00
Rick Macklem
db527ae3f2 mountd.8: Update for mountd running in jails
Mountd can now be run in an appropriately
configured vnet jail.

This man page update adds some information
for this case.

This is a content change.

Reviewed by:	markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39168
2023-04-03 04:12:24 -04:00
Jean-Sébastien Pédron
b20f3ee398 x86/pci_early_quirks: Support Intel 11th+ gen
Newer Intel CPUs/iGPUs use a new method to determine the base address of
the stolen memory. This code was ported from Linux.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39057
2023-04-03 04:12:24 -04:00
Jean-Sébastien Pédron
f8c2d40227 linuxkpi: Define seq_has_overflowed() and single_open_size()
This required non-trivial changes to `linux_seq_file.c` to manage a new
`(struct seq_file)->size` field. This field is read directly by DRM
drivers, so we can't alias it to a call to sbuf_len(9).

`single_open_size()` also depended on the ability to allocate the sbuf
with a specified size instead of relying on `sbuf_new_auto()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39056
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
af0361fcc8 linuxkpi: Support non-NULL zero-size pointers
DRM drivers set some pointers to `ZERO_SIZE_PTR` directly (without
allocating anything), to treat pointers which were "initialized" (set to
`ZERO_SIZE_PTR`) with no memory allocation like really allocated
pointers. NULL isn't used because it represents a third state.

Reviewed by:	emaste, manu
Approved by:	emaste, manu
Differential Revision:	https://reviews.freebsd.org/D39055
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
9bf11ee8f8 linuxkpi: Add <linux/iommu.h>
It defines a small part of the IOMMU API of Linux. We don't implement
that yet.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39054
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
7de26952af linuxkpi: Define pcie_aspm_enabled()
This is not the same as querying the PCIE ASPM capability. The function
should return if the feature is actually enabled or not. It always
return false on FreeBSD.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39053
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
d4093f8424 linuxkpi: Add default_groups field to struct kobj_type
We don't use it, but it is set by the DRM drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39051
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
5e51b3254f linuxkpi: Define device_iommu_mapped()
For now, it always return false.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39050
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
c5b6e66417 linuxkpi: Define dev_WARN() and dev_WARN_ONCE()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39049
2023-04-03 04:12:23 -04:00
Mitchell Horne
0dd86d978a x86: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:23 -04:00
Mitchell Horne
afab6ab3fd powerpc: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

Update the top-level comment to be closer to other nexus
implementations.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
b89a9ba540 riscv: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
df08929b6c arm64: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
eb3cabeeed arm: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mark Johnston
f9512cea83 vmrun: Expose bhyve's -G option
MFC after:	1 week
2023-04-03 04:12:22 -04:00
Mitchell Horne
48b22a39ac mi_switch(9): fix comma placement
Sponsored by:	The FreeBSD Foundation
Fixes:	175db7b58270 ("mi_switch(9): update to current day")
2023-04-03 04:12:22 -04:00
Mitchell Horne
19a2bab266 Cross-reference coretemp(4) and amdtemp(4)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:22 -04:00
Mitchell Horne
10c8471031 printf(9): add MLINKS for vlog(9) and vprintf(9)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:21 -04:00
Mitchell Horne
ce87379b74 hardclock(9): small cleanups
- Improve the wording that describes cnt and hz (avoid "the long haul")
 - Use .Fa for function arguments
 - Fix formatting of parenthesis around swi(9) xref
 - removed xref to non-existent options(4)
 - xref polling(4)
 - consistently list xrefs in SEE ALSO
 - xref eventtimers(9) in SEE ALSO

Reviewed by:	mav, rpokala
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39137
2023-04-03 04:12:21 -04:00
Mitchell Horne
232e37df82 callout(9): adopt old references to timeout(9)
timeout(9) was removed a couple of years ago; all consumers now use the
callout(9) interface.

Explicitly do not bump .Dd anywhere, as this is not a content or
semantic change.

Reviewed by:	markj, jhb, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39136
2023-04-03 04:12:21 -04:00
Mitchell Horne
3bff6ac6df kern_reboot(9): describe event handlers
Add more details about the execution and purpose of these shutdown
handlers. Make a point to mention the requirement that they can be run
in a normal or panic context. Add some simple examples.

Add a brief comment to the declaration in sys/eventhandler.h.

Reviewed by:	markj
Discussed with:	rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39135
2023-04-03 04:12:21 -04:00
Mitchell Horne
689f5b4fc6 kern_reboot(9): document shutdown_nice()
Reviewed by:	markj, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39134
2023-04-03 04:12:21 -04:00
Mitchell Horne
ee285c6980 kern_reboot(9): some updates
- This function no longer disables interrupts
 - MLINK to reboot.9
 - The mentions of autoconfiguration is more about shutdown_nice(),
   coming in the next commit.
 - Describe the RB_* flags relevant to this function
 - Describe behaviour when shutdown hooks fail the reset
 - Describe expected execution contexts
 - Add FF copyright
 - xref panic(9)
 - xref this page in reboot(2)

Reviewed by:	markj
Discussed with:	rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39133
2023-04-03 04:12:21 -04:00
Mitchell Horne
b1137dfbad panic(9): some updates
- Better description of what the panic() function does
 - Document KERNEL_PANICKED()
 - Add a section describing panic execution context
 - Add SEE ALSO

Reviewed by:	kib, markj, rpokala
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39132
2023-04-03 04:12:21 -04:00
Mitchell Horne
3b7993f867 KASSERT(9): some updates
- Add a little bit of introductory text
 - Improve the existing example: ANSI C, use a better assertion than a
   NULL check (which is discouraged)
 - Document the widely used MPASS macro in this page
 - Drop the cross-reference to config(8)

Reviewed by:	kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39131
2023-04-03 04:12:20 -04:00
Mitchell Horne
8030b8ae7a critical(9): small updates
- Document CRITICAL_ASSERT() in this man page.
 - Clarify that a thread may also handle interrupts in a critical
   section, not only faults/exceptions.
 - Note the negative effects of critical section abuse
 - Some other minor clarifications
 - Add short SEE ALSO

Reviewed by:	kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39130
2023-04-03 04:12:20 -04:00
Mitchell Horne
d98202980e vcount.9: remove obsolete man page
These functions, vcount() and count_dev(), no longer exist in the source
tree.

Reviewed by:	rpokala
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39128
2023-04-03 04:12:20 -04:00
Fedor Uporov
8bed02c0f8 Fix compilation issue, when DTRACE is not defined
PR:             270346
Reported by:    Michael Paepcke
MFC after:      2 week
2023-04-03 04:12:20 -04:00
Kyle Evans
2d675f411b pkill: tests: do a pass for case-sensitive conflicts
As in 76b6a59f9d30a5a39a5ed, encode upper-case flag tests with a leading
underbar to avoid collisions (thus, erroneously dirty git repos) on
case-sensitive filesystems.

Sponsored by:	Klara, Inc.
2023-04-03 04:12:20 -04:00
Kyle Evans
73c6afb30e pkill: use an ARG_MAX size buffer for argument matching
Right now pkill/pgrep cut off at _POSIX2_LINE_MAX (2048), but argument
strings can be much larger (ARG_MAX is 256K/512K).  Stop arbitrarily
cutting the search off at 2K, rather than documenting the limit.

Reviewed by:	allanjude (earlier version), des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38663
2023-04-03 04:12:20 -04:00
Mark Johnston
02e86504d5 kerneldump: Inline dump_savectx() into its callers
The callers of dump_savectx() (i.e., doadump() and livedump_start())
subsequently call dumpsys()/minidumpsys(), which dump the calling
thread's stack when writing the dump.  If dump_savectx() gets its own
stack frame, that frame might be clobbered when its caller later calls
dumpsys()/minidumpsys(), making it difficult for debuggers to unwind the
stack.

Fix this by making dump_savectx() a macro, so that savectx() is always
called directly by the function which subsequently calls
dumpsys()/minidumpsys().

This fixes stack unwinding for the panicking thread from arm64
minidumps.  The same happened to work on amd64, but kgdb reports the
dump_savectx() calls as coming from dumpsys(), so in that case it
appears to work by accident.

Fixes:	c9114f9f86f9 ("Add new vnode dumper to support live minidumps")
Reviewed by:	mhorne, jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39151
2023-04-03 04:12:20 -04:00
Daniel Kolesa
46636b22d3 sh(1): fix history file write checking
We cannot just compare histsizeval() against 0, since that returns
a string pointer, which is always non-zero (non-null). The logic
in sethistsize() initializes the history size to 100 with values
that are non-number, and an empty string counts as that. Therefore,
the only time we want to not write into history with HISTSIZE val
set is when it's explicitly 0.

MFC after:	2 weeks
2023-04-03 04:12:19 -04:00
Kristof Provost
aeeb3cd0c9 pf tests: try to trigger locking issues in pfsync_timeout()
PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Kristof Provost
5942d0bd54 pfsync: fix pfsync_undefer_state() locking
pfsync_undefer_state() takes the bucket lock, but could get called from
places (e.g. from pfsync_update_state() or pfsync_delete_state()) where
we already held the lock.

As it can also be called from places where we don't yet hold the lock
create new locked variant for use when the lock is already held. Keep
using pfsync_undefer_state() where the lock must still be taken.

PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Kristof Provost
e507a6ce7e pfsync: add missing unlock in pfsync_defer_tmo()
The callout for pfsync_defer_tmo() is created with
CALLOUT_RETURNUNLOCKED, because while the callout framework takes care
of taking the lock we want to run a few operations outside of the lock,
so we unlock ourselves.

However, if `sc->sc_sync_if == NULL` we return without releasing the
lock, and leak the lock, causing later deadlocks.
Ensure we always release the bucket lock when we exit pfsync_defer_tmo()

PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Mark Johnston
ba6b2a2603 netipsec tests: Serialize
The tunnel mode tests use VNET jails and reuse jail names.  Until this
is addressed, serialize them.

MFC after:	1 week
2023-04-03 04:12:19 -04:00
Glen Barber
c25bdd89a5 pkg-stage.sh: update port trailing version information
Reported by:	Ian Smith, Graham Perrin
MFC after:	1 week
X-MFC-13.2:	NO

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:12:19 -04:00
Kristof Provost
7f36f8861d carp: use if_name()
Reported by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:12:19 -04:00
Kristof Provost
a72a570c1c carp: document peer/peer6 and mcast/mcast6 in the relevant man pages
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38943
2023-04-03 04:12:19 -04:00
Kristof Provost
47d582e0cb carp tests: unicast tests (IPv6)
Test the new unicast carp mode for IPv6.

There's a routing hop between the peers, to ensure that the TTL check is
correctly disabled for unicast carp.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38942
2023-04-03 04:12:18 -04:00
Kristof Provost
d81e4337e3 carp tests: unicast tests (IPv4)
Test the new unicast carp mode for IPv4.

There's a routing hop between the peers, to ensure that the TTL check is
correctly disabled for unicast carp.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38941
2023-04-03 04:12:18 -04:00