Commit Graph

294459 Commits

Author SHA1 Message Date
Ka Ho Ng 50c64df2a1 Revert "libkldelf: add a private library for kernel/kld-related ELF parsing"
This reverts commit 0a2cfd653e.
2024-10-08 19:40:20 +00:00
Ka Ho Ng 7007de7d10 Revert "libkldelf: add elf_lookup_symbol function"
This reverts commit 2c7d847956.
2024-10-08 19:40:13 +00:00
Ka Ho Ng 6df3a2d1bf Revert "libkldelf: use warnx instead of printf"
This reverts commit 550ee2d03c.
2024-10-08 19:39:36 +00:00
Graham Percival 9fd66e40ca manuals: Fix syntax of list width
Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1455
2024-10-08 16:16:26 -03:00
Graham Percival 643fc69820 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1454
2024-10-08 16:14:49 -03:00
Graham Percival 8b92fa1ceb manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1453
2024-10-08 16:13:39 -03:00
Dag-Erling Smørgrav c2d93a803a env: Check the status of stdout.
MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47009
2024-10-08 19:01:46 +02:00
Dag-Erling Smørgrav 6f6166e49c env: Add an option to change the directory.
This mirrors the equivalent option in GNU coreutils env, but does not
add support for long options.

MFC after:	3 days
Relnotes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, bcr
Differential Revision:	https://reviews.freebsd.org/D47008
2024-10-08 19:01:32 +02:00
Gleb Popov e3ebc5f534 procctl(2): Clarify the ESRCH error code case
Approved by: kib
Differential Revision: https://reviews.freebsd.org/D47010
2024-10-08 19:58:17 +03:00
Mateusz Piotrowski 72f5e9833f committers-*.dot: Fix typos 2024-10-08 17:24:53 +02:00
Mateusz Piotrowski 9cf2efbaa0 committers-src: Add myself (0mp)
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D47007
2024-10-08 17:24:53 +02:00
Konstantin Belousov ba40b2b899 vmstat -o: report objects backing posix shm segments
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:29 +03:00
Konstantin Belousov a1258191d5 procstat vm: report posix shm segment mapping
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:23 +03:00
Konstantin Belousov b0b18b57a5 sysctl vm.objects: report objects backing posix shm segments
Add the KVMO_FLAG_POSIXSHM flag.  Fill the path.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:15 +03:00
Konstantin Belousov a8c641bbcb sys/user.h: report posix shm mappings
Add flag KVME_FLAG_POSIXSHM.  Fill kve_path with the path of the
segment.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:09 +03:00
Konstantin Belousov bda73e441f posix shm: add shm_get_path(9)
to calculate the posix shm path from the vm_object backing shm segment.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:38:03 +03:00
Konstantin Belousov a10870ecea posix shm: mark backing objects with SHM_POSIXSHM flag
and consistently store the pointer to shmfd into pager priv data space.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:37:57 +03:00
Konstantin Belousov 71a66883b5 kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46970
2024-10-08 15:37:47 +03:00
Doug Moore d0b225d164 swap_pager: use iterators in swp_pager_meta_build
Add a method to use an iterator for pctrie insertion; this should
improve performance when the last search ended near the place where
the new item will be inserted.

Add an iterator argument to swp_pager_meta_build, so that the lookups
and insertions it does can be faster in the common case when keys are
bunched close together, or appear in sequence.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D46848
2024-10-08 03:31:16 -05:00
Roger Pau Monné e7fe856437 xen/blk{front,back}: fix usage of sector sizes different than 512b
The units of the size reported in the 'sectors' xenbus node is always 512b,
regardless of the value of the 'sector-size' node.  The sector offsets in
the ring requests are also always based on 512b sectors, regardless of the
'sector-size' reported in xenbus.

Fix both blkfront and blkback to assume 512b sectors in the required fields.

The blkif.h public header has been recently updated in upstream Xen repository
to fix the regressions in the specification introduced by later modifications,
and clarify the base units of xenstore and shared ring fields.

PR: 280884
Reported by: Christian Kujau
MFC after: 1 week
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D46756
2024-10-08 09:29:13 +02:00
Baptiste Daroussin 8bfd7d5f50 pci_vendors: update to 2024-09-20 2024-10-08 09:06:13 +02:00
Konstantin Belousov e90b2b7d6c ptrace(PT_VM_ENTRY): report max protection
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46971
2024-10-08 09:50:17 +03:00
Konstantin Belousov 409c2fa385 kinfo_vmentry: report max protection
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46971
2024-10-08 09:50:17 +03:00
Baptiste Daroussin 88a198af3c powerd: use nlsysevent if possible
instead of depending on devd and its socket, try to use nlsysevent
instead. This makes powerd independant from devd.

Approved by:		des
Reviewed by:		des
Differential Revission:	https://reviews.freebsd.org/D46972
2024-10-08 08:40:58 +02:00
Ka Ho Ng 550ee2d03c libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-08 04:29:10 +00:00
Ka Ho Ng 2c7d847956 libkldelf: add elf_lookup_symbol function
The elf_lookup_symbol function looks up the symbol with a given symbol
name. A pointer to the GElf_Sym of the symbol is returned if the symbol
exists in the opened ELF file.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46764
2024-10-08 04:29:10 +00:00
Ka Ho Ng 0a2cfd653e libkldelf: add a private library for kernel/kld-related ELF parsing
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.

To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.

kldxref(8) is modified to link against the libkldelf library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-08 04:24:07 +00:00
Warner Losh 6c711019f2 nvme: Don't create sysctl for io queues not created
When we can't set the number of I/O queues ont he admin queue, we
continue on. However, we don't create the I/O queue structures, so
having pointers (NULL) into them for sysctls makes no sense and leads to
a panic when accessed. When summing up different stats, also skip the
ioq stats when it's NULL.

Sponsored by:		Netflix
2024-10-07 22:22:40 -06:00
Maxim Konovalov 3ebb738a93 bsd-family-tree: FreeBSD 13.4 and OpenBSD 7.6 added 2024-10-07 21:16:19 +00:00
Dag-Erling Smørgrav a0dfb0668b env: Improve documentation.
* The `env` utility's inability to run a command whose name contains an
  equal sign is a feature, not a bug, so move that paragraph up from the
  BUGS section to the DESCRIPTION section.

* Mention that this can be worked around by prefixing the command name
  with `command`, and add an example of this to the EXAMPLE section.

* Add a test case which verifies that `env` does not run a command with
  an equal sign in its name even if it exists, and also demonstrates the
  workaround.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46997
2024-10-07 23:01:09 +02:00
Dag-Erling Smørgrav 334af5e413 env: Add a handful of test cases.
MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46996
2024-10-07 23:01:09 +02:00
Mark Johnston c59166e5b4 vm_page: Fix a logic bug in vm_page_unwire_managed()
When releasing a page reference, we have logic for various cases, based
on the value of the counter.  But, the implementation fails to take into
account the possibility that the VPRC_BLOCKED flag is set, which is ORed
into the counter for short windows when removing mappings of a page.  If
the flag is set while the last reference is being released, we may fail
to add the page to a page queue when the last wiring reference is
released.

Fix the problem by performing comparisons with VPRC_BLOCKED masked off.
While here, add a related assertion.

Reviewed by:	dougm, kib
Tested by:	pho
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46944
2024-10-07 20:52:15 +00:00
Mark Johnston d8b32da235 vm_page: Use atomic loads for cmpset loops
Make sure that the compiler loads the initial value value only once.
Because atomic_fcmpset is used to load the value for subsequent
iterations, this is probably not needed, but we should not rely on that.

I verified that code generated for an amd64 GENERIC kernel does not
change.

Reviewed by:	dougm, alc, kib
Tested by:	pho
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46943
2024-10-07 20:52:08 +00:00
Ed Maste 6684779b32 capsicum-test: rights are propagated on accept(2)
As of commit 85b0f9de11 ("capsicum: propagate rights on accept(2)")
a capability is generated from accept(cap_fd,...).  Enable the
corresponding test code.

PR:		201052
Reviewed by:	oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46994
2024-10-07 15:40:06 -04:00
Graham Percival c8b31033c3 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Additional clarification: there was a non-breaking space in
lib/libcasper/services/cap_grp/cap_grp.3.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1449
2024-10-07 15:41:14 -03:00
Graham Percival d21e322d56 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1448
2024-10-07 15:40:58 -03:00
Graham Percival c801836ff4 manuals: Fix "skipping end of block" .El errors
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .El commands.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1447
2024-10-07 15:37:47 -03:00
Navdeep Parhar 52e5a66eac cxgbe(4): Use correct synchronization when marking the adapter offline.
adapter->flags are guarded by a synch_op, as noted in the comment in
adapter.h where the flags are defined.

Fixes:	5241b210a4 cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-10-07 10:25:53 -07:00
Ed Maste be9243409d pkg: improve error message
Print the complete list of url that have failed

PR:		281924
Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D46983
2024-10-07 13:05:07 -04:00
Roger Pau Monné 9a73b5b1e8 xen: remove PV suspend/resume support copyright
Thew code for PV suspend/resume support has long been removed, also remove the
copyright notice associated with it.

There are still two copyright blocks with (to my understanding) slightly
different wordings of the BSD 2 clause license.  I however don't feel like
merging them due to those wording differences.

The removal of the PV suspend/resume code was done in
ed95805e90.

Sponsored by: Cloud Software Group
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D46860
2024-10-07 18:59:45 +02:00
Roger Pau Monné 9dd5105f22 xen: expose support for poweroff/reboot/suspend on xenbus
Some toolstacks won't attempt the signal power actions on xenbus unless the VM
explicitly exposes support for them.  FreeBSD supports all power actions, hence
signal on xenbus such support by setting the nodes to the value of "1".

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential review: https://reviews.freebsd.org/D46859
2024-10-07 18:59:45 +02:00
Bojan Novković 596a36ddc4 vmstat: Add NOFREE page count to -s report
This change adds the number of permanently allocated pages
to the 'sum' structure report.

Differential Revision:	https://reviews.freebsd.org/D46980
Reviewed by:	markj
2024-10-07 18:46:32 +02:00
Bojan Novković a02f9685ed vm_meter: Add counter for NOFREE pages
This change adds a new counter that tracks the total number
of permanently allocated pages.

Differential Revision:	https://reviews.freebsd.org/D46978
Reviewed by:	alc, markj
2024-10-07 18:46:32 +02:00
Doug Moore 6af02087d2 swap_pager: rename iter init functions
Add _init to the function names of the functions that initialize
iterators for swblks.

Reported by:	alc, markj
Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D46974
2024-10-07 11:11:33 -05:00
Ed Maste f5c847ae84 pkg: prefer .pkg extension
.pkg is the default extension as of commit c244b1d8a3, falling back to
.txz if not found.

PR:		281924
Reviewed by:	bapt
Fixes: a2aac2f5e5 ("pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz")
Fixes: c244b1d8a3 ("pkg: settle the uniq extension to .pkg instead of .bsd")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46977
2024-10-07 12:01:36 -04:00
Michael Tuexen 3326ab87cc getsockopt: improve locking for SOL_SOCKET level socket options
Ensure SOLISTENING() is done inside SOCK_LOCK()/SOCK_UNLOCK()
for getsockopt() handling of SOL_SOCKET-level socket options.

Reviewed by:		markj, rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46881
2024-10-07 16:46:41 +02:00
Zhenlei Huang 8161000892 iflib: Make iflib_stop() static
It is declared as static. Make the definition consistent with the
declaration.

This follows 7ff9ae90f0 and partially reverts 09f6ff4f1a.

Reviewed by:	erj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46185
2024-10-07 22:19:02 +08:00
Baptiste Daroussin 782766a32d genl: small cleanup
Following up from another review using basically the same code:
remove useless cast
replace uint32_t with unsigned int.

No functional changes expected
2024-10-07 15:28:54 +02:00
Ed Maste 8b41e693fc libsys: connect membarrier.2
Sponsored by:	The FreeBSD Foundation
2024-10-07 08:01:34 -04:00
Igor Ostapenko dfcb8de5ef dummymbuf: Log the entire rule set if no delimiters are present
An empty string was printed instead.

Reviewed by:	kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D46964
2024-10-07 11:16:44 +00:00