Commit graph

287746 commits

Author SHA1 Message Date
Warner Losh 5a1d14419a include: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Warner Losh 90aea514c6 bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Warner Losh e717cb04be misc: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

This is for the misfits that have only a few: COPYRIGHT, gnu, tools,
rescue, and etc.

Sponsored by:		Netflix
2023-11-26 22:23:27 -07:00
Ka Ho Ng d030761168 dirdeps: Update/fix Makefile.depend* for toolchain
This fixes make pseudo/toolchain.
2023-11-26 20:50:13 -05:00
Ka Ho Ng 3244c9c673 dirdeps: Remove $FreeBSD$
There was a $FreeBSD$ line in lib/liblua/Makefile.depend.

MFC after:	3 days
2023-11-26 15:47:54 -05:00
Gordon Bergling 502e8f44fc iostat.8: Better wording for some use cases
The iostat(8) manual page should be more specific when using
options. Also extented the BUGS section.

PR:	153012
Reviewed by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42633
2023-11-26 19:30:58 +01:00
Kyle Evans e4967d4d48 lockf: switch to strtonum() for parsing timeout
Convert waitsec to a long long to be able to hold the full domain of
alarm(3) timeout on all platforms, and let strtonum(3) handle the input
validation.  strtonum(3) also happens to provide a neater interface for
error handling, and it already includes our pre-existing empty input
check.

Sponsored by:	Klara, Inc.
2023-11-25 22:41:05 -06:00
Kyle Evans 09a7fe0a55 lockf: allow locking file descriptors
This is most useful inside a shell script, allowing one to lock just
portions of a script rather than having to wrap the entire script in a
lock.

PR:		262738
Reviewed by:	0mp, allanjude (both previous versions)
Co-authored-by:	Daniel O'Connor <darius@dons.net.au>
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42718
2023-11-25 22:15:05 -06:00
Kyle Evans 296a5a4db1 lockf: add some tests
Provide basic coverage for the existing options, nothing deeper (e.g.,
pipe closing behavior) is tested in this set.

Reviewed by:	allanjude
Feedback from:	des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42714
2023-11-25 22:09:58 -06:00
Alexander Melkov 18425c19ca lockf: don't hold stdin/stdout/stderr open
None of these are essential in the lockf monitor (parent post-fork), so
close them to maintain the illusion that lockf hasn't been inserted into
the pipeline.  This ensures that the correct effects happen on other
programs in the pipeline if the locked command closes or redirects these
elsewhere.

The original patch used -s to close stdout/stderr rather than closing
them unconditionally, but it's not clear that we really care that much.
kevans dropped that part when taking the patch, patch is otherwise by
listed author.

PR:		112379
Reviewed by:	0mp, allanjude (both earlier version), kevans
Feedback from:	des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42713
2023-11-25 22:09:27 -06:00
Kyle Evans 35095fd23f lockf: correct omission in the usage statement
The -w flag was added without being noted in the usage statement; fix
that now.

While we're here, re-sort the getopt() string.

Reviewed by:	0mp, allanjude, des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42712
2023-11-25 22:08:40 -06:00
Kyle Evans 3041e6950d lockf: hide unavailable error with -n -s
The error message is expected, allow -s to suppress just that one since
it would loosely fall under the definition of "failure to acquire the
lock" described in the manpage for the -s option.

Reviewed by:	0mp, allanjude
Feedback from:	des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42711
2023-11-25 22:08:40 -06:00
Xin LI 832c63f5e0 Update leap-seconds to leap-seconds.3676924800
Obtained from:  ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2023-11-25 17:13:23 -08:00
Xin LI ca6a6373bd MFV: xz 5.4.5
MFC after:	2 weeks
2023-11-25 17:02:59 -08:00
Xin LI 039b23c923 Vendor import of xz 5.4.5 (trimmed) 2023-11-25 16:53:12 -08:00
Konstantin Belousov a9758e4647 Do not install kernel and modules with executable access bit set
They are not executables and cannot be activated by kernel.

Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42768
2023-11-25 20:47:42 +02:00
Konstantin Belousov d3849ec3c9 Set installed kernel and driver files access modes using KMODMODE var
Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42768
2023-11-25 20:40:39 +02:00
John Baldwin ed88eef140 new-bus: Disable assertions for rman mismatches for activate/deactivate
Bus drivers which use an rman to sub-divide a resource allocated from
a parent bus should handle mapping requests (and activate/deactivate
requests) for those sub-allocated resources by doing a subset mapping
of the resource allocated from the parent (and then using this to
handle activate/deactivate requests).

However, not all bus drivers which use internal rmans (such as acpi(4)
and pci_pci(4)) do that since not all nexus drivers support
bus_map/unmap.  Eventually bus drivers should be updated to do this
properly at which point these assertions can be reenabled.

Reported by:	delphij, kib
2023-11-25 10:32:19 -08:00
Peter Holm 49a83b9439 stress2: Do not make assumptions about the value of UFS_LINK_MAX 2023-11-25 10:36:00 +01:00
Ed Maste f72b4f7e14 etcupdate: temporarily comment out one tzsetup test
This test fails after tzsetup was changed to symlink rather than copy
the zoneinfo file (5e16809c95).
2023-11-24 17:31:28 -05:00
John Baldwin 5622f52c98 aarch64 nexus: Fix a mismerge in nexus_activate_resource
Fixes:		658501d259 aarch64 nexus: Use bus_generic_rman_*_resource
2023-11-24 14:00:33 -08:00
Cy Schubert ac910ad995 rc.d/ldconfig: Remove stray ;;
Stray ";;" causes the ldconfig rc script to fail at boot. Remove it.

Fixes:		73902ed85a
2023-11-24 12:11:45 -08:00
John Baldwin 46971d38de new-bus: Add comments for resource_*_map_request*
Requested by:	mhorne
2023-11-24 10:33:57 -08:00
John Baldwin 00b3cde596 new-bus: Add a comment for bus_generic_get_domain 2023-11-24 10:33:57 -08:00
Warner Losh 67d2bd974d stand: Retire setting hw.ata.wc: it doesn't exist.
hw.ata.wc was disconnected as part ot the 2013 cam-ification of ata. No
need to continue setting it. It's been unused in FreeBSD 10.x and newer.

Sponsored by:		Netflix
2023-11-24 11:28:44 -07:00
Warner Losh e0e5081538 ata: Retire unused variable / externs
When looking for something else, I noticed these are no longer used
anywhere.

Sponsored by:		Netflix
2023-11-24 11:27:38 -07:00
Warner Losh 21795c374a stand: Retire setting hw.eisa_slots.
When the eisa code was removed in 2017, prior to the stable/12 branch,
setting hw.eisa_slots became a nop. The oldest supported branch doesn't
have eisa at all. The need to set it manually on boot disappeared
largely by 2000...

Sponsored by:		Netflix
2023-11-24 10:58:44 -07:00
Jean-Sébastien Pédron f18b3ce0b7
vt(4): Always call vt_window_switch() in vtterm_cnungrab()
[Why]
This ensures that vtterm_cnungrab() is the mirror of vtterm_cngrab().
And the latter always call vt_window_switch() and thus the backend's
vd_postswitch().

This makes sure that whatever the backend did during vtterm_cngrab(), it
can undo it during vtterm_cnungrab().

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D42752
2023-11-24 18:31:33 +01:00
Jean-Sébastien Pédron 16b13bd3fd
vt(4): Call vd_postswitch callback regardless of the current window
[Why]
We want the same behavior at the backend level, regardless if we need to
switch the current window or not.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D42751
2023-11-24 18:31:33 +01:00
Jean-Sébastien Pédron 162a2b8588
vt(4): New bitblt_text variant making a copy before unlocking vt_buf
[Why]
In the DRM drivers and the integration with vt(4), we need to execute
DRM code outside of the vtbuf_lock. The reason is that this DRM code
acquires locks which can't be acquired when vtbuf_lock, an MTX_SPIN
mutex, is already held.

[How]
A vt(4) backend can now set the `vd_bitblt_after_vtbuf_unlock` flag to
true if it wants to be called outside of vt_buf_lock.

In this case, vt(4) uses an internal version of bitblt_text that uses
the `vd_drawn` arrays, plus a new `vd_pos_to_flush` array, to track
characters to draw/refresh. This internal version then uses the
backend's bitblt_bmp callback to draw the characters after vt_buf has
been unlocked.

Drawing borders and CPU logos is also deferred after the vt_buf lock is
released for the same reason.

We introduce another lock (a default mutex), only used when the
`vd_bitblt_after_vtbuf_unlock` flag is set, to replace part the role of
the vt_buf lock and manage concurrent calls to vt_flush().

The `SC_NO_CONSDRAWN` define is dropped because we now always need the
`vd_drawn` arrays.

Reviewed by:	manu
Approved by:	manu
Differential Revision:  https://reviews.freebsd.org/D42057
2023-11-24 18:31:33 +01:00
Jean-Sébastien Pédron 24d6f256f8
vt(4): Skip vt_window_switch() for nested panics
[Why]
The same protection was added to vt_flush() in the previous commit. We
want the same one in vt_window_switch(): if e.g. the DRM driver panics
while handling a call to vt_window_switch(), we don't want to
recursively call vt_window_switch() again and trigger another panic.

Reviewed by:	imp, manu
Approved by:	imp, manu
Differential Revision:	https://reviews.freebsd.org/D42750
2023-11-24 18:31:33 +01:00
Jean-Sébastien Pédron 049e3fba04
vt(4): Skip vt_flush() for nested panics
[Why]
If there is a problem with DRM drivers or in their integration with
vt(4) and displaying something on the console triggers a panic, there is
a high chance that displaying that panic will trigger another one,
recursively.

[How]
If vt_flush() is called and it detects is is called resursively from
another panic, it return immediately, doing nothing, to avoid the risk
of triggering another panic.

Reviewed by:	manu
Approved by:	manu
Differential Revision:  https://reviews.freebsd.org/D42056
2023-11-24 18:31:33 +01:00
Jean-Sébastien Pédron 14dcd40983
linuxkpi: GFP_KERNEL equals M_NOWAIT now
... instead of `M_WAITOK`.

[Why]
The reason is that in some places in the DRM drivers (in particular, the
framebuffer management code), kmalloc() is called from a non-sleepable
context, such as after a call to mtx_lock(8) with an MTX_DEF mutex.

If `GFP_KERNEL` is defined as `M_WAITOK`, we hit an assertion from
witness(4).

[How]
The definition of `GFP_KERNEL` is changed to `M_NOWAIT`. This means that
callers should verify the return value of kmalloc(). Fortunately, this
is always the case in Linux.

Reviewed by:	bz, emaste, manu
Approved by:	manu
Differential Revision:  https://reviews.freebsd.org/D42054
2023-11-24 18:31:32 +01:00
John Baldwin 7bf9223ca9 riscv nexus: Sort bus_set_resource in DEVMETHOD table 2023-11-24 09:28:40 -08:00
John Baldwin f8709c826b riscv nexus: Use bus_generic_rman_*_resource
Custom activate/deactivate_resource methods are still needed to handle
IRQ resources.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42742
2023-11-24 09:28:28 -08:00
John Baldwin 658501d259 aarch64 nexus: Use bus_generic_rman_*_resource
Custom activate/deactivate_resource methods are still needed to handle
IRQ resources.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42741
2023-11-24 09:28:19 -08:00
John Baldwin a03a335a80 x86 nexus: Use bus_generic_rman_*_resource
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42740
2023-11-24 09:28:10 -08:00
John Baldwin 751615c538 newbus: Add a set of bus resource helpers for nexus-like devices
These routines can be used to implement
bus_alloc/adjust/activate/deactive/release_resource on bus drivers
which suballocate resources from rman(9) resource managers.

These methods require a new bus_get_rman method in the bus driver to
return the suitable rman for a given resource type.  The
activate/deactivate helpers also require the bus to implement the
bus_map/ummap_resource methods.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42739
2023-11-24 09:28:00 -08:00
Konstantin Belousov 73902ed85a ldconfig: only configure compat32 when kernel supports it
and eliminate hard-coded arch list.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42669
2023-11-24 18:38:42 +02:00
Konstantin Belousov 393ac29f0b kqueue: on process exit, force-clear its registered signal events
Normally, process already has all its kqueue fds destroyed at the moment
p_klist is detached in exit flow. But, if the process was created with
rfork(2) with shared file descriptors, its signal knotes can survive.
Then, knlist_detach() does not destroy non-empty knlist. Later, when
owning kqueue is closed, we access freed (or rather, reused, because
struct proc is type-stable) memory by referencing p->p_klist from such
knote.

Handle this situation by deleting all knotes hanging from p_klist.

PR:	275286
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42745
2023-11-24 18:26:53 +02:00
Emmanuel Vadot 50335b1ae4 sys/mutex.h: Reorder includes
Fixes:	2a35f3cdf6 ("sys/mutex.h: Include sys/lock.h instead of sys/_lock.h")
2023-11-24 12:59:02 +01:00
Emmanuel Vadot 2a35f3cdf6 sys/mutex.h: Include sys/lock.h instead of sys/_lock.h
It uses the LA_ defines when INVARIANTS is set.
This unbreak dpaa2 with FDT only kernel (like ALLWINNER or ROCKCHIP) as
the driver only include sys/lock.h via header polution for ACPI kernels.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37145
Reviewed by:	kib, mjg
2023-11-24 10:49:58 +01:00
Emmanuel Vadot b3c116d50e devd: autofs: Move autofs related events to a separate file
If a user don't have FreeBSD-autofs installed there is no need to try calling
automount on every GEOM event.
It's also easier to add/delete autofs related event in a separate file.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D42495
Reviewed by:	imp
2023-11-24 10:45:03 +01:00
Emmanuel Vadot 5a78fcfce4 autofs: Remove stale comment
devd action for automount -c was never commented.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D42493
Reviewed by:	rew
2023-11-24 10:44:40 +01:00
Emmanuel Vadot 0b7c89c8c2 autofs: media: Don't include nosuid in the script
We already have nosuid option in auto_master so no need to redefine it.
Also it's easier for a user to modify the auto_master configuration file
than the script (which shouldn't be modified).

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D42492
Reviewed by:	rew
2023-11-24 10:44:20 +01:00
Ed Maste 5e16809c95 tzsetup: symlink /etc/localtime instead of copying
Using a symlink means that new timezone data (installed by an errata
update, say) will be usable without having to be copied again.

Reviewed by:	bapt, kevans, philip
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37005
2023-11-23 21:13:49 -05:00
Mitchell Horne c4dacfa7f4 pst: improve shutdown_post_sync handler
It is desirable to shut down the raid controller even in the face of a
panic. In the SCHEDULER_STOPPED() case, set the interrupt mask bits so
that we request a polled wait, rather than sleep(), from
iop_queue_wait_msg().

Tweak the function name and signature.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D42337
2023-11-23 16:19:40 -04:00
John Baldwin 7aa3bf6952 etc/mtree: Remove entry for /usr/tests/usr.sbin/mixer
These were removed when the new mixer(3) library was imported, and I
missed updating the mtree file when I added the entries to
ObsoleteFiles.inc.

Fixes:		903873ce15 Implement and use new mixer(3) library for FreeBSD.
2023-11-23 12:17:41 -08:00
Brad Smith 88d2b69c71 re(4): Add support for 8168FP HW rev
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42671
2023-11-23 12:13:00 -08:00
Mitchell Horne ad34121518 Revert "pst: improve shutdown_post_sync handler"
I did not realize this driver was i386-only, and the change fails to
compile. Revert so that I can fix it properly.

This reverts commit 428ebb7cd9.

Pointy hat to: mhorne
2023-11-23 15:48:44 -04:00