Commit graph

286351 commits

Author SHA1 Message Date
Fernando Apesteguía 8dc9b10e38 save-entropy: Add manual page
Succinct manual page for save-entropy(8).

PR:			223998
Reported by:		AJ Jordan <alex+freebsd@strugee.net>
Reviewed by:		carlavilla@, delphij@, lwhsu@, pauamma_gundo.com
Approved by:		delphi, lwhsu (src)
Differential Revision:	https://reviews.freebsd.org/D41768
2023-09-18 13:33:59 +02:00
Kenta Kubo 501edb1cc7 Fix typo in RELNOTES (objump -> objdump)
Pull Request: https://github.com/freebsd/freebsd-src/pull/847
2023-09-18 11:04:21 +01:00
Ed Maste 8ee97b1928 freebsd-update: do not restart sshd when updating jail/basedir
In 6cd1bc5316 for PR 263489 I changed freebsd-update to restart sshd
after upgrade, to avoid an upgrade-related incompatibility that made it
impossible to login.

This is intended to avoid losing access to remote hosts, and ought not
apply to upgrading jails (from outside).

PR:		263489, 272282
Reported by:	otis
Reviewed by:	otis, kevans
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Fixes: 6cd1bc5316 ("freebsd-update: restart sshd after upgrade")
Differential Revision: https://reviews.freebsd.org/D41890
2023-09-18 10:47:01 +01:00
Ed Maste b15f640037 swapon.2: correct FreeBSD release that introduced swapoff
It was introduced in 92da00bb24, after 5.0 and beforen 5.1.  Reported
in https://github.com/ziglang/zig/issues/16590.
2023-09-18 10:01:38 +01:00
Simon J. Gerraty 9887588385 Merge bmake-20230909
Merge commit '1012cf15f75d1e9048779abd07270a37cdba590a'
2023-09-17 18:09:37 -07:00
Shawn Anastasio a6662c37b6 powerpc: Implement fpu_kern_enter/fpu_kern_leave
Summary:
Provide an implementation of fpu_kern_enter/fpu_kern_leave for PPC to
enable FPU, VSX, and Altivec usage in-kernel. The functions currently
only support FPU_KERN_NOCTX, but this is sufficient for ossl(1) and many
other users of the API.

This patchset has been tested on powerpc64le using a modified version of
the in-tree tools/tools/crypto/cryptocheck.c tool to check for FPU/Vec
register clobbering along with a follow-up patch to enable ossl(4) on
powerpc64*.

Reviewed by:	jhibbits
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D41540
2023-09-17 13:21:04 -04:00
Justin Hibbits 67a27733d1 Revert "powerpc: Implement fpu_kern_enter/fpu_kern_leave"
This reverts commit 6a47fa697a.

Need to correct authorship.
2023-09-17 13:19:56 -04:00
Simon J. Gerraty 1012cf15f7 Import bmake-20230909
Update import.sh to generate below

ChangeLog since bmake-20230622

2023-09-09  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230909
	Merge with NetBSD make, pick up
	o main.c: allow -j to compute a multiple of ncpu
	If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
	point number or ends in 'C' compute .MAKE.JOBS as a multiple of
	_SC_NPROCESSORS_ONLN
	.MAKE.JOBS.C will be "yes" if -jC is supported

2023-08-20  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230820
	Merge with NetBSD make, pick up
	o make.1: note that :localtime is better for %s
	o parse.c: improve error messages for invalid input.
	o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
	correct result, it is still better to use %s:L:localtime.

2023-08-18  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230818
	Merge with NetBSD make, pick up
	o meta.c: meta_ignore - check raw path against metaIgnorePaths
	to potentially skip call to realpath.
	o var.c: be strict when parsing the argument of the ':mtime' modifier
	o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
	should be used to get an equivalent value to time(3).

2023-08-16  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230816
	Merge with NetBSD make, pick up
	o cond.c: clean up multiple-inclusion guards

2023-07-25  Simon J Gerraty  <sjg@beast.crufty.net>

	* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
	if configure cannot work out how to control TZ.
	Remove varmod-localtime from BROKEN_TESTS for IRIX*

2023-07-24  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230723

	* configure.in: fix the test for wether TZ=Europe/Berlin works.
	Depending on the time of year, if run between 22:00 and 00:00 UTC
	the check in configure would fail incorrectly.
	Take the day into account as well.

2023-07-18  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230711
	Merge with NetBSD make, pick up
	o make.1: clean up wording, clarify scope of '!' in conditions

2023-07-15  Simon J Gerraty  <sjg@beast.crufty.net>

	* make-bootstrap.sh.in: set prefix
	If configure is run using ksh we get unexpanded ${prefix} in
	DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
	correct result.

2023-07-13  Simon J Gerraty  <sjg@beast.crufty.net>

	* VERSION (_MAKE_VERSION): 20230711
	bump version for IRIX tweaks

	* make.h: undef OP_NONE if defined

	* unit-tests/Makefile: set BROKEN_TESTS for IRIX

	* configure.in: override INSTALL on IRIX

2023-06-27  Simon J Gerraty  <sjg@beast.crufty.net>

	* boot-strap op_test: ensure we set TEST_MAKE as we want it.

mk/ChangeLog since bmake-20230622

2023-09-09  Simon J Gerraty  <sjg@beast.crufty.net>

	* jobs.mk (JOB_MAX): use -jC if we can
	we actually use JOB_MAX_C which defaults to 1.33C

2023-08-18  Simon J Gerraty  <sjg@beast.crufty.net>

	* now_utc: %s only works with :localtime

2023-07-14  Simon J Gerraty  <sjg@beast.crufty.net>

	* install-sh: ignore -c as claimed and only insist on
	a directory for destination when more than one file to copy.

	* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
	${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)

2023-07-13  Simon J Gerraty  <sjg@beast.crufty.net>

	* install-mk (MK_VERSION): 20230711

	* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
	install(1)

	* sys/IRIX.mk:  when setting ROOT_GROUP only match the first :0:
	set INSTALL to install-sh rather than pathname that may not exist
	(yet).

2023-07-07  Simon J Gerraty  <sjg@beast.crufty.net>

	* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
	normally this is empty - for the default target, but there are
	use-cases where we might set it to something else.

2023-07-04  Simon J Gerraty  <sjg@beast.crufty.net>

	* install-mk (MK_VERSION): 20230704

	* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
	when DEBUG_DIRDEPS is in effect.
	Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
	can greatly improve readability.
2023-09-17 10:03:11 -07:00
Justin Hibbits 6a47fa697a powerpc: Implement fpu_kern_enter/fpu_kern_leave
Summary:
Provide an implementation of fpu_kern_enter/fpu_kern_leave for PPC to
enable FPU, VSX, and Altivec usage in-kernel. The functions currently
only support FPU_KERN_NOCTX, but this is sufficient for ossl(1) and many
other users of the API.

This patchset has been tested on powerpc64le using a modified version of
the in-tree tools/tools/crypto/cryptocheck.c tool to check for FPU/Vec
register clobbering along with a follow-up patch to enable ossl(4) on
powerpc64*.

Reviewed by:	jhibbits
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D41540
2023-09-17 11:45:23 -04:00
Tom Hukins 576b06d7ad cam(4): Remove redundant words
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/843
2023-09-17 09:14:06 -06:00
Tom Hukins c2909b0c9a cam(4): Fix device hints documentation
The code in sys/cam/cam_periph.c that calls resource_int_value(9) looks
for "lun" not "unit".

PR: 212155
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/843
2023-09-17 09:13:49 -06:00
Warner Losh 5d51862412 Restrict the glibc compat cookie open functions to __BSD_VISIBLE
Sponsored by:		Netflix
2023-09-17 09:11:57 -06:00
Warner Losh d95431624f nvme: Give up when we've failed
Normally, we poll the device every so often to see if commands have
timed out. However, we'll go into the recovery state as part of failing
the drive. To account for all possibilties, if we're failed when we get
into the polling function, just stop polling: Party is over.

Sponsored by:		Netflix
2023-09-17 09:11:56 -06:00
Doug Rabson 4ff9d27089 pkgbase: Add instructions for upgrading past 78847e1
The pkg solver gets confused by the file moves and refuses to upgrade
without manually upgrading FreeBSD-utilities and FreeBSD-utilities-dev
first.

PR:             254173, 273859
MFC after:	1 week
Reviewed by:	Mina Galić <freebsd@igalic.co>
Differential Revision: https://reviews.freebsd.org/D41892
2023-09-17 13:21:06 +01:00
Dimitry Andric 479d224efc Fix geom build with clang 17 and KTR enabled
When building a kernel with clang 17 and KTR enabled, such as with the
LINT configurations, a -Werror warning is emitted:

    sys/geom/geom_io.c:145:31: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
      145 |         if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) {
          |             ~~~~~~~~~~~~~~~~~~~~~~~~ ^
    sys/geom/geom_io.c:145:31: note: use '&' for a bitwise operation
      145 |         if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) {
          |                                      ^~
          |                                      &
    sys/geom/geom_io.c:145:31: note: remove constant to silence this warning

Replace the multiple uses of the expression with one macro, and in this
macro use "!= 0" to get a logical operand instead of a bitwise one.

Reviewed by:	jhb
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D41823
2023-09-17 14:13:09 +02:00
Mark Johnston f7c733e4fe amd64: Convert a cheap DIAGNOSTIC check to a KASSERT
MFC after:	1 week
2023-09-17 06:27:31 -04:00
Mark Johnston 8f26ed01bd mlock tests: Add a regression test
The test tries to trigger creation of a superpage mapping in an
mlock()ed region.

MFC after:	2 weeks
2023-09-17 06:27:31 -04:00
Bojan Novković aa3bcaad51 amd64: Add a leaf PTP when pmap_enter(psind=1) creates a wired mapping
This patch reverts the changes made in D19670 and fixes the original
issue by allocating and prepopulating a leaf page table page for wired
userspace 2M pages.

The original issue is an edge case that creates an unmapped, wired
region in userspace. Subsequent faults on this region can trigger wired
superpage creation, which leads to a panic in pmap_demote_pde_locked()
as the pmap does not create a leaf page table page for the wired
superpage. D19670 fixed this by disallowing preemptive creation of
wired superpage mappings, but that fix is currently interfering with an
ongoing effort of speeding up vm_map_wire for large, contiguous entries
(e.g. bhyve wiring guest memory).

Reviewed by:	alc, markj
Sponsored by:	Google, Inc. (GSoC 2023)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41132
2023-09-17 06:27:22 -04:00
Robert Clausecker 601fd768cf lib/libc/tests/string/strcspn_test.c: extend tests to catch previous bug
This extends the strcspn() unit tests to catch mistakes in the
implementation that only appear when a mismatch occurs in a certain
position of the string against a certain position of the set.

See also:	52d4a4d4e0
Sponsored by:	The FreeBSD Foundation
Approved by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41821
2023-09-16 20:40:13 -04:00
Mateusz Guzik 9080190b97 vfs: count how many times vnlru got woken up due to vnode shortage 2023-09-16 17:26:39 +00:00
Pierre Pronchery 1a18383a52 libcrypto: link engines and the legacy provider to libcrypto
OpenSSL's legacy provider module and engines need to link to
libcrypto.so, as it provides some of the actual implementations of
legacy routines.

This is a little tricky due to build order issues.  Introduce a small
hack (LIBCRYPTO_WITHOUT_SUBDIRS) that builds libcrypto.so in its usual
early phase without any OpenSSL provider modules or engines.  This is
intended to restore the test suite; a future change should remove the
hack and replace it with a better approach.

PR:		254853, 273528
Discussed with:	Folks at EuroBSDCon in Coimbra
Sponsored by:	The FreeBSD Foundation
2023-09-16 16:55:12 +01:00
Mateusz Guzik ef89b78bb1 vfs: stabilize freevnodes_old
In face of parallel callers.
2023-09-16 15:54:09 +00:00
Ed Maste d3a9d605a8 Add WITHOUT_MANSPLITPKG description
Fixes: 74da9c39c3 ("pkgbase: Split out manpages by default")
Sponsored by: The FreeBSD Foundation
2023-09-16 16:40:41 +01:00
Mateusz Guzik 49874af3ec zfs: retire z_nr_znodes
It is not needed and is going away soon(tm), facilitating other changes.

See https://github.com/openzfs/zfs/pull/15274
2023-09-16 14:18:05 +00:00
Mark Johnston d643925a79 unix tests: Use the right type for sendmsg(2) return values
MFC after:	1 week
2023-09-15 13:04:15 -04:00
Mark Johnston 38426b32e1 socket tests: Add a regression test for MSG_WAITALL
PR:		212716
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-09-15 12:59:46 -04:00
Greg Becker f44102411e sockets: re-check socket state after call to pr_rcvd()
Socket state may have changed after dropping the receive
buffer lock in order to call pr_rcvd().  If the buffer is
empty, re-check the state after reaquiring the lock and
skip calling sbwait() if the socket is in error or the
peer has closed.

PR:		212716
Reviewed by:	markj, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41783
2023-09-15 12:59:46 -04:00
Mateusz Guzik 509d843a98 vfs: s/u_long vstir/bool vstir/ 2023-09-16 08:19:24 +00:00
Dimitry Andric cadbf320b3 ObsoleteFiles: cleanup old libclang_rt files for powerpc64le
PR:		273776
MFC after:	3 days
2023-09-16 09:47:19 +02:00
Mateusz Guzik d3e6478912 vfs: group vnode-related sysctls under vfs.vnode
Instead of having things scattered through vfs, debug and kern trees.

Old names remain for compatibility.

Sample output of "sysctl vfs.vnode":
vfs.vnode.vnlru.failed_runs: 0
vfs.vnode.vnlru.recycles_free: 0
vfs.vnode.vnlru.recycles: 0
vfs.vnode.stats.alloc_sleeps: 0
vfs.vnode.stats.free: 1310
vfs.vnode.stats.skipped_requeues: 0
vfs.vnode.stats.created: 1686
vfs.vnode.stats.count: 1641
vfs.vnode.param.wantfree: 2097152
vfs.vnode.param.limit: 8388608
2023-09-16 07:39:42 +00:00
Mateusz Guzik 2a689cadf0 vfs: retire kern.minvnodes
It was marked as legacy in 2005.
2023-09-16 07:33:36 +00:00
Robert Clausecker 953b93cf24 lib/libc/amd64/string/memcmp.S: harden against phony buffer lengths
When memcmp(a, b, len) (or equally, bcmp) is called with a phony length
such that a + len < a, the code would malfunction and not compare the
two buffers correctly.  While such arguments are illegal (buffers do not
wrap around the end of the address space), it is neverthless conceivable
that people try things like memcmp(a, b, SIZE_MAX) to compare a and b
until the first mismatch, in the knowledge that such a mismatch exists,
expecting memcmp() to stop comparing somewhere around the mismatch.
While memcmp() is usually written to confirm to this assumption, no
version of ISO/IEC 9899 guarantees this behaviour (in contrast to
memchr() for which it is).

Neverthless it appears sensible to at least not grossly misbehave on
phony lengths.  This change hardens memcmp() against this case by
comparing at least until the end of the address space if a + len
overflows a 64 bit integer.

Sponsored by:	The FreeBSD Foundation
Approved by:	mjg (blanket, via IRC)
See also:	b2618b651b
MFC after:	1 week
2023-09-16 00:20:32 -04:00
Dag-Erling Smørgrav 7e0a7ef95f tcpdump: Initialize tzcode early.
An explicit tzset() call is usually not needed as it happens implicitly
the first time we call localtime() or mktime(), but in some cases
(sandboxing, chroot) this may be too late.

PR:		273807
MFC after:	3 days
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D41880
2023-09-15 23:36:41 +02:00
Konstantin Belousov 72d97e1dd9 rtld: output rtld errors into the dbg channel
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-09-15 22:40:41 +03:00
Christos Margiolis bbe8195bfa kinst: do not look for a function epilogue
kinst currently only traces functions that start and end with the usual
function prologue and epilogue respectively. Ignoring functions that do
not have an epilogue however, makes the filtering too strict, as this
means that we can not trace functions that never return (e.g
vnlru_proc()). This patch relaxes the filtering and only checks whether
the function pushes the frame pointer.

Reviewed by:	markj
Approved by:	markj
Differential Revision:	https://reviews.freebsd.org/D41876
2023-09-15 16:33:41 +01:00
Mateusz Guzik 03bfee1752 vfs: use vnlru_read_freevnodes for the freevnodes sysctl
For a more accurate result.
2023-09-15 00:06:57 +00:00
Mateusz Guzik ba5dc166e0 vfs: retire vnlru_under_unlocked
It only looks at the centralized value which in corner cases can end up
being negative.
2023-09-14 23:05:51 +00:00
Bjoern A. Zeeb f454a4a10d LinuxKPI: 802.11: fix counting the number of supbands
While the main purpose was to assign an(y) early chandef with the
loop, later additions made use of it to also count supbands as well
as to initialise max_rates.
Due to the main goal we can exit the loop early and not properly
count and initialise supbands and max_rates.
Move the terminating condition into the loop and make it a continue
rather than ending the loop.

Fixes:		d9945d7821 ("improve hw_scan")
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb e1e90be050 LinuxKPI: 802.11: make sure bssid for scans (probe_req) is set
In b0f7376822 we added bssid[] to struct cfg80211_scan_request
likely while working on mt76 and did not need it (yet) back then.
iwlwifi started to use the field in Linux f1fec51cda70f (April 2023).
Without it set firmware crashes when trying to send probe requests
((empty) SSID also given to hw_scan).
For now always set the field to the wildcard BSSID.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb 33396ec29f net80211: improve scan debugging
While debugging other problems I ran into the case where net80211
was thinking a scan was ongoing and new scans could not be started
but given other logging there was clearly no more scan running.
It was hard after the fact to quickly determine enough state to
reconstruct or validate assumptions.

Improve a MSG_SCAN debug logging and implement _db_show_scan() ddb
output which can be printed along with show com /S or /a.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb 778da03b12 net80211: mark argument to scan_curchan_task() __unused
Mostly as documentation mark an unused argument to scan_curchan_task()
as __unused.  We may possibly want to check all callers in the future
and see if the argument was supposed to be useful or should be entirely
removed.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb ee7077f24f iwlwifi: fix a bug in iwl_ssid_exist()
Rather than always comparing a given SSID to the first SSID of the
IE list, compare it to the the iterator one.  That way duplicates can
be found.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Mateusz Guzik 07f52c4b5a vfs cache: garbage collect the fullpathfail2 counter
The conditions it checks cannot legally be true (modulo races against
forced unmount), so assert on it instead.
2023-09-14 20:34:20 +00:00
Mateusz Guzik 9dc0c983b0 vfs: fix stale comment about freevnodes management 2023-09-14 17:29:52 +00:00
Mateusz Guzik 76f1153790 vfs: don't kick vnlru if it is already running
Further shaves some lock trips.
2023-09-14 16:40:14 +00:00
Dimitry Andric b9c012a60b ObsoleteFiles: cleanup old libclang_rt files for powerpc64
PR:             273776
MFC after:      3 days
2023-09-14 18:39:31 +02:00
Simon J. Gerraty a1575a9885 Fix typo in VERIEXEC_VERIFIED_FILE
Reviewed by:	stevek
2023-09-14 09:31:31 -07:00
Doug Rabson 74da9c39c3 pkgbase: Split out manpages by default
This helps with building small container images using pkgbase.

Reviewed by:	manu bapt
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D41861
2023-09-14 16:50:40 +01:00
Olivier Certner 125bbadf60 x86: Add defines for workaround bits in AMD's MSR "Decode Configuration"
They are a bit more informative than raw hexadecimal values.

While here, sort existing defines of bits for AMD MSRs to match the address
order.

Reviewed by:	kib, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41816
2023-09-14 16:24:48 +01:00
Mateusz Guzik 74be676d87 vfs: drop one vnode list lock trip during vnlru free recycle
vnlru_free_impl would take the lock prior to returning even though most
frequent caller does not need it.

Unsurprisingly vnode_list mtx is the primary bottleneck when recycling
and avoiding the useless lock trip helps.

Setting maxvnodes to 400000 and running 20 parallel finds each with a
dedicated directory tree of 1 million vnodes in total:
before:	4.50s user 1225.71s system 1979% cpu 1:02.14 total
after:	4.20s user 806.23s system 1973% cpu 41.059 total

That's 34% reduction in total real time.

With this the block *remains* the primary bottleneck when running on
ZFS.
2023-09-14 15:03:03 +00:00