Commit Graph

306933 Commits

Author SHA1 Message Date
Robert Clausecker 8efcc64928 Summary: *.3: misc man page fixes
Approved by:	markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55249
2026-02-13 18:52:12 +01:00
Baptiste Daroussin 2cfca8e710 diff3: fix merge mode
Make the merge mode compatible with GNU diff3
Add tests for all the changes, those tests are extracted from the
etcupdate testsuite.

This version passes the etcupdate testsuite and the diffutils diff3
test suite.

MFC After:	1 week
2026-02-13 18:36:42 +01:00
Mark Johnston a8b8feced9 atf_python/vnet: Make it possible to set the FIB of vnet interfaces
Reviewed by:	zlei, ngie
MFC after:	1 week
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54972
2026-02-13 16:02:09 +00:00
Dag-Erling Smørgrav 59906a163e ngctl: Fix buffer overflow in config command
Keep track of our buffer length when assembling the argument list.

PR:		293075
MFC after:	1 week
Reviewed by:	zlei, markj
Differential Revision:	https://reviews.freebsd.org/D55259
2026-02-13 16:57:58 +01:00
Dag-Erling Smørgrav 585190dff4 ngctl: Check hook name length
Check the length of the hook name when copying it into the sockaddr.

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55258
2026-02-13 16:57:58 +01:00
Dag-Erling Smørgrav 3cbdcabf71 ngctl: Modernize code somewhat
* Replace fgets(3) with getline(3)

* Replace select(2) with poll(2)

* Avoid needlessly copying text around

* Correct use of getopt(3)

* Pick some style and whitespace nits

MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55257
2026-02-13 16:57:58 +01:00
Konstantin Belousov e7f86f8b13 kqtimer_proc_continue(): correct calculation of 'now'
It must be sbinuptime(), this is how kc->next is set up.

PR:	293141
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D55264
2026-02-13 17:46:41 +02:00
Konstantin Belousov 75a30ea09f filt_timerexpire_l(): re-insert restarted timer into head instead of tail
of the resumed timers list, so that kqtimer_proc_continue() does not
iterated into the same timer again.

PR:	293141
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D55264
2026-02-13 17:46:41 +02:00
Mark Johnston bf149f2e88 kmsan: Implement __msan_test_shadow()
This is needed when building OpenZFS with KMSAN enabled, as the bundled
zstd uses it.

MFC after:	1 week
2026-02-13 15:42:19 +00:00
Dag-Erling Smørgrav 394201ce5b tests: Simplify libarchive tests
The ATF tests work by first running the test program with an invalid
flag, which causes it to print an error message, a summary of options,
and a list of available test cases.  Switch to the new -l option which
simply prints the list, and simplify the awk script used to parse the
output.  No functional change.

MFC after:	1 week
2026-02-13 13:40:57 +01:00
Dag-Erling Smørgrav 1e2eea55c4 nvme: Change fail_on_reset to bool
This is safe since sysctl_handle_bool() handles ints transparently.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55263
2026-02-13 13:34:51 +01:00
Baptiste Daroussin 8d442cf32e diff3: fix diff3 -A
for cases where file2 differs but file1 and file3 agrees, the code
stored the file2 and file3 line numbers in the de[] editing script
entries but used them as if they were file1 line numbers.

Reviewed by:		thj
Differential Revision:	https://reviews.freebsd.org/D55276
2026-02-13 10:34:15 +01:00
Konstantin Belousov cb81a9c18d x86: provide extended description for x86_msr_op(9)
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision: https://reviews.freebsd.org/D55045
2026-02-13 09:55:04 +02:00
Konstantin Belousov 36ceb5509d x86_msr_op(9): consistently return the value read from MSR
If the operation is executed on more than one CPU, a random instance of
the read value is returned.

Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55045
2026-02-13 09:55:04 +02:00
Konstantin Belousov af99e40af1 x86: add a safe variant of MSR_OP_SCHED* operations for x86_msr_op(9)
The modifier executes the operation using msr{read,write}_safe()
functions instead of plain msr reads and writes.  Returns EFAULT if any
MSR access caused #GP.

Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55045
2026-02-13 09:55:04 +02:00
Kevin Bowling 2bdec2ee73 e1000: Increase FC pause/refresh time on PCH2 and newer
This corresponds to Linux f74dc880098b4a29f76d756b888fb31d81ad9a0c

That commit does not provide any public background detail, but it's been
in use for over 5 years and corresponds to previous chip bugs w.r.t.
automatic generation of PAUSE frames.

Reviewed by:	kgalazka
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54555
2026-02-12 23:33:43 -07:00
Abdelkader Boudih 1a6bdd6266 asmc: Convert driver to CTLFLAG_MPSAFE
Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all sysctls.
The driver already uses spin mutexes (sc->sc_mtx) for hardware
access protection and does not require the Giant lock.

This improves scalability by allowing concurrent sysctl access
without Giant serialization.

Reviewed by:	ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D54613
2026-02-12 19:00:46 -08:00
Navdeep Parhar afe55ae68e cxgbe(4): Fix assertion in timer calibration
The calibration callout is stopped when the adapter is marked off limits
but not when the adapter is merely stopped.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2026-02-12 16:54:08 -08:00
Kristof Provost d03b6bb766 pf tests: verify blocked count on log interface
Also check the IPv6 pass/block numbers.

PR:		291763
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-02-12 17:05:16 +01:00
Kristof Provost 1e7665e368 libpfctl: verify all parsers
List all currently defined parsers in 'all_parsers', and pass them to
SNL_VERIFY_PARSERS(). This will detect incorrect odering in parsers,
which will help us detect otherwise subtle bugs.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-02-12 17:05:16 +01:00
Eric A. Borisch 363b57d579 libpfctl: Sort order of snl attribute parser
snl atttribute parsers must be sorted by type, so PF_GS_BCOUNTERS
(16) must follow PF_GF_PCOUNTERS (15). Fix ordering and add a call
to SNL_VERIFY_PARSERS.

Without this fix, byte counters reported by 'pfctl -s info' with
a loginterface are always zero.

PR:		291763
MFC after:	1 week
Reviewed by:	kp
Signed-off-by:	eborisch@gmail.com
2026-02-12 17:05:16 +01:00
Siva Mahadevan 5fa297f4bc mixer/tests: use require.kmods property instead of ad-hoc checks
Reviewed by:	christos
Approved by:	lwhsu (mentor)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55221
2026-02-12 10:01:57 -05:00
Siva Mahadevan fbe6da7f75 libnv/tests: unskip nvlist_send_recv__send_many_fds__dgram
The test passes consistently for 1000+ consecutive iterations.

PR:		260891
Reviewed by:	oshogbo
Approved by:	lwhsu (mentor)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55223
2026-02-12 10:01:57 -05:00
Aymeric Wibo 0bba277f22 libc: Improve {,l,ll,imax}div(3) manpages
Mainly rename numerator parameter of div(3) and ldiv(3) from num to
numer, and explicitly specify what "numer", "denom", and "rem" mean in
the manpages.

MFC after:	3 days
Obtained from:	https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:	Klara, Inc.
2026-02-12 15:55:14 +01:00
Cheng Cui 9778537b67 igc: remove M_HASHTYPE when RSS is not enabled
Summary: manually cherry-pick 21dd554d16

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55256
2026-02-12 09:33:29 -05:00
Alexander Ziaee 64e612b462 newsyslog.conf.5: Add a CAVEAT
PR:			282639
MFC after:		3 days
Reviewed by:		michaelo
Differential Revision:	https://reviews.freebsd.org/D55122
2026-02-12 09:14:48 -05:00
Mark Johnston 7c1c0e9436 rpc: Improve socket locking in svc_vc_accept()
so_state modifications must be synchronized by the socket lock.  For the
listening socket this probably doesn't matter but for the child socket I
think it's possible that this unlocked update clobbers a state
transition if the nascent connection is being disconnected for some
reason.

Also fix the line which potentially clears SS_NBIO in the listening
socket.

It is unclear whether this code is used at all.

Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55247
2026-02-12 14:00:43 +00:00
Mark Johnston be393b6f04 netinet6: Add a struct socket declaration to ip6_var.h
MFC after:	1 week
Reported by:	Ian FREISLICH <ianfreislich@gmail.com>
2026-02-12 13:59:40 +00:00
Aymeric Wibo c3f945eac4 libc: Remove leftover comments
These comments refer to a comment in div.c which doesn't exist anymore.

Fixes:	7c7299df76 ("libc: Remove support for pre-C99 C standards")
Sponsored by:	Klara, Inc.
2026-02-12 14:57:38 +01:00
Peter Holm 83693c121a stress2: Fix cleanup 2026-02-12 11:32:24 +01:00
Peter Holm 2b061bd179 stress2: Limit output from test 2026-02-12 11:31:36 +01:00
Konstantin Belousov 10fde71958 lib/libc/net/sockatmark.3: fix groff mdoc warning
PR:	293072
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-02-12 09:56:42 +02:00
Konstantin Belousov c67d8acca3 sbin/setkey/setkey.8: cleanup groff mdoc warnings
PR:	293072
Sponsored by:	NVidia networking
MFC after:	3 days
2026-02-12 09:47:22 +02:00
Dmitry Morozovsky 0d9b5db9fc committers-ports: add andy
Following up ziaee's pattern, and add andy's line.
I'm not sure whether the original commit bit creation date should be used,
and use commit bit re-activation date for now.

MFC after:	1 week
2026-02-12 09:27:48 +03:00
Alexander Ziaee 261ed379c8 prepare-commit-msg: Sync with committers guide
Add `Discussed with:`, `Closes:`, `MFC to:`, and `Co-authored-by:` to
the commit message template from the committer's guide. While here,
wordsmith these to fit on standard console.

Reported by:		lwhsu
Discussed with:		emaste, jlduran
Reviewed by:		vexeduxr
Differential Revision:	https://reviews.freebsd.org/D54707
2026-02-11 23:46:19 -05:00
Maxim Konovalov 66797b469e pw.8: spell 2026-02-11 21:03:11 +00:00
Olivier Certner 2b728d3bbf hwpstate_amd(4): Move 'struct get_cppc_regs_data' & co. closer to use
No functional change (intended).

Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:23 +01:00
Olivier Certner c6a0eb7ada hwpstate_amd(4): Rename '*set_autonomous_hwp*()' => 'enable_cppc*()'
This is to better reflect that we are really enabling CPPC in these
functions and because we are likely to stop activating CPPC autonomous
mode by default in the near future.

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:23 +01:00
Olivier Certner ebcd80f76e hwpstate_amd(4): Rename PSTATE_CPPC internal flag
While here, also rename check_cppc_enabled() => check_cppc_in_use().

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:22 +01:00
Olivier Certner 4285340c60 hwpstate_amd(4): Style: Align 'machdep.hwpstate_amd_cppc_enable'
Align it like the rest.

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:22 +01:00
Olivier Certner a78e7c22c5 hwpstate_amd(4): Update copyright
Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:22 +01:00
Olivier Certner cec0ab0586 hwpstate_amd(4): Style: Sort headers
And separate includes from the rest with an additional newline.

Sponsored by:   The FreeBSD Foundation
2026-02-11 21:43:21 +01:00
Olivier Certner 7689e68506 hwpstate_amd(4): Add knobs to get/set all fields of CPPC_REQUEST
This will allow experimentations and finer-grained tuning to the full
extent allowed by the hardware, which is especially important given that
the spec leaves to hardware implementors an important leeway in
interpreting CPPC's numeric parameters, causing the same settings to
have different effects on different CPU models.

PR:             292615
Reviewed by:    aokblast (older version)
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55010
2026-02-11 21:43:21 +01:00
Olivier Certner 951788e373 hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values
We were using percents, for compatibility with hwpstate_intel(4), but
this looses granularity that might be important in some scenarios or
with specific CPU models.

For consistency, hwpstate_intel(4) should be changed accordingly, at the
expense of breaking compatibility.

For release notes: Introduction of hwpstate_amd(4) deserves a release
note, even if the original commit was not tagged.  Functionality
introduced by recent commits tagged with "Relnotes" should be mentioned
along that one.

PR:             292615
Reviewed by:    aokblast
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55009
2026-02-11 21:43:21 +01:00
Olivier Certner 6db204dc2d hwpstate_amd(4): Factor out setting the CPPC_REQUEST register
In preparation for creating other knobs to tweak values in this register
beyond just the EPP (Efficiency/Performance Preference).

While here, add a herald comment before the softc structure indicating
how we achieve atomicity when modifying the softc.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55008
2026-02-11 21:43:20 +01:00
Olivier Certner df7b4dcdb8 hwpstate_amd(4): Sane defaults for min/max perf on insane capabilities
If the CPPC_CAPABILITY_1 register stays at its reset value (0) even
after enabling CPPC, as observed in the field (see the referenced PR
below), use sane min/max performance limits as hinted by the ACPI spec,
i.e., all 0s for the minimum value and all 1s for the maximum one.

While here, let's cope upfront with some more insane situations, where
the minimum value would be greater than the maximum one, but also if
they would be equal which does not seem to make sense at all in the CPPC
frame (and, anyway, in this case, the actual minimum and maximum values
we program should have no effect at all).  That last case actually also
covers the one exposed in the previous paragraph.

PR:             292615
Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55007
2026-02-11 21:43:20 +01:00
Olivier Certner bd58239d36 hwpstate_amd(4): attach(): More diagnostic on CPPC enable
When the 'debug.hwpstate_verbose' tunable/sysctl knob is set, dump the
initial content of the CPPC_CAPABILITY_1 and CPPC_REQUEST registers.

If, after enabling CPPC, reading/writing some MSR fails during the attach
sequence, print a diagnostic.  However, once CPPC is enabled, we cannot
go back (disabling it is impossible), so we'll attach even if fiddling
with other MSRs failed.

While here, move diagnostic printing on attach out of the callback that
is executed on (potentially) another CPU and with interrupts disabled,
putting it into the attach routine itself.

While here, fix format for printing the CPU ID.

PR:             292615
Reviewed by:    aokblast (older version)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55006
2026-02-11 21:43:20 +01:00
Olivier Certner 8aac1e9b02 hwpstate_amd(4): Register dump: Fine-grained error reporting
If some of the registers cannot be read, report that but continue trying
reading the others.  This also has the side benefit of simplifying code.

While here, use sbuf_new_for_sysctl(), and rename 'res' and 'ret', which
are to contain error values, to 'error'.

While here, remove the test on getting the per-cpu structure, as if it
is not present we would have already crashed on device attach.

While here, fix format for printing the CPU ID.

PR:             292615
Reviewed by:    aokblast (older version)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55005
2026-02-11 21:42:15 +01:00
Kyle Evans 7bf81e39d8 ls: check fts_children() for errors that may not surface otherwise
In particular, if one simply does a non-recursive `ls` on a directory
that is not accessible, there are some classes of errors that may cause
it to fail that wouldn't be surfaced unless we do an fts_read() that
will recurse into the inaccessible directory.  Catch those kinds of
errors here since we cannot expect to an FTS_ERR/FTS_DNR entry to follow
up on them.

PR:		287451
Reviewed by:	kib
Discusssed with:	des
Differential Revision:	https://reviews.freebsd.org/D51056
2026-02-11 13:56:37 -06:00
Dmitry Morozovsky e89454417b pw: make manual page more friendly for uid/gid search
pw.8 structure is quite different from usual manual page, especially in
describing -o option usage.  Specifically, these paragraphs do not
contain "uid/gid" terms, and have "user id"/"group id" instead,
making searching for "override duplicate safety belt" difficult.
Try to simplify such searches.

Also, clarify uid/gid space between 100 and 1000 as "somewhat special",
as it actually is.

Discussed on:   russian telegram FreeBSD group
Reviewed by:	eugen, novel
MFC after:      1 week
2026-02-11 22:36:42 +03:00