Commit Graph

306246 Commits

Author SHA1 Message Date
Konstantin Belousov ce16be7370 libthr/thread/thr_join.c: deduplicate backout_join() helper
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54766
2026-01-19 18:49:51 +02:00
Konstantin Belousov 002c50ea23 amd64/vmm: remove unused static function vcpu_state2str()
It is guarded by #ifdef KTR, so the warning does not show up under usual
kernel configs.

Fixes:	ed85203fb7
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D54781
2026-01-19 18:45:40 +02:00
Aymeric Wibo 4b534b814a acpi: Fix not calling AcpiLeaveSleepState() in S3 path
When resuming from ACPI suspend, the ACPI_SS_SLP_PREP bit in slp_state
was being checked and subsequently unset when calling resumeclock().
This bit was also being checked for the AcpiLeaveSleepState() call in
the non-s2idle path, but having just been unset, it was never actually
being called.

Change this so that resumeclock() is always being called (since we never
goto breakout between suspendclock() and resumeclock() anyway) and
ACPI_SS_SLP_PREP is purely used for AcpiEnterSleepStatePrep() and
AcpiLeaveSleepState() in the non-s2idle paths.

PR:		292568
Reported by:	Marek Zarychta
Reviewed by:	olce
Tested by:	Marek Zarychta
Approved by:	olce
Fixes:	7669cbd0f0 (“acpi: Suspend-to-idle support (s2idle)”)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D54777
2026-01-19 17:30:10 +01:00
Konstantin Belousov 709a53c8b2 x86/local_apic.c: Properly calculate the number of LVT entries
First, the CMCI entry index is APIC_LVT_MAX, so it was excluded
unconditionall [1].

Second, the number of entries is reported by the version register, and
we must not access past the last reported entry.

Reported by:	olivier [1]
Fixes:	11f954b021
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54773
2026-01-19 18:20:37 +02:00
Konstantin Belousov ad5e3cb950 x86/local_apic.c: add lapic_maxlvt() helper
that calculates the max index of the present LVT entry from the value of
the LAPIC version register.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54773
2026-01-19 18:20:36 +02:00
Konstantin Belousov 83d9882886 sys: do not allow entering vm_fault() on boot until VM is initialized
On amd64, a hack sets td_critnest to 1 in hammer_time(), and then clear
it before returning from hammer_time(), which is too early.  Instead,
set TDP_NOFAULTING for thread0, and clear the flag after vm_init() finished.

Noted by:	adrian
Reviewed by:	adrian (previous version), markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54768
2026-01-19 18:20:36 +02:00
John Baldwin 3a6289e1e5 .github: Disable checklist workflow on forks
Reviewed by:	imp
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1973
2026-01-19 10:56:20 -05:00
Andrew Gallatin d91ae61f8f iflib: null out freed mbuf in iflib_txsd_free
When adding the IFLIB_GET_MBUF/FLAGS, I neglected to NULL out the
mbuf in the descriptor ring.  I didn't think this should matter as
the I thought this code was only used when the ring was about
to be freed. But I was wrong, and leaving a stale mbuf in there can
cause panics.

Reported by:  Marek Zarychta (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292547)
Fixes: 14d93f612f
Sponsored by: Netflix
2026-01-19 10:45:49 -05:00
Mark Johnston 99afbc5cc7 vmm: Avoid clobbering errors from vmm_modinit()
Reported by:	novel
Reviewed by:	bnovkov
Fixes:		e758074458 ("vmm: Move the module load handler to vmm_dev.c")
Differential Revision:	https://reviews.freebsd.org/D54750
2026-01-19 14:29:33 +00:00
Wolfram Schneider a2c87d4f88 symlink.7: add a new section "mount options"
Add a new section "mount options" to explain
the mount option nosymfollow in more details.

Differential Revision:	https://reviews.freebsd.org/D54530
2026-01-19 10:47:53 +00:00
Joseph Mingrone 8ac6427b1b periodic: Support RFC 5424 syslog timestamps
This is based on an initial implementation by michaelo in
https://reviews.freebsd.org/D54361.

PR:		270497
Reported by:	michaelo
Reviewed by:	michaelo
Tested by:	michaelo
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D54606
2026-01-18 18:11:37 -04:00
Bjoern A. Zeeb 0f0b833e4d modules: iwlwifi/rtw89 allow standalone build
The KERN_OPTS:MDEV_ACPI checks are fine for as long as we are building
modules along the kernel.  If one wants to just build the module
standalone out of the module directory this would fail.
Add the missing include for kmod.opts.mk (as was done for tcp
in 1319a76179).

Sponsored by:	The FreeBSD Foundation
Reported by:	Tassilo Philipp (tphilipp potion-studios.com)
Fixes:	f5a77dc8f8 ("improve module Makefile dependency on ACPI")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54769
2026-01-18 21:53:39 +00:00
Konstantin Belousov 11f954b021 x86: mask all LAPIC vectors early, before BSP interrupts are enabled
If APIC is left in somewhat bad state, with some source hot (not masked
and active, e.g. timers after kexec or due to BIOS bug), we get the
interrupt too early.

Reported by:	jmg
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54543
2026-01-18 21:47:26 +02:00
Konstantin Belousov 87ed56a5c4 x88/local_apic.c: for each lvt element, add LVT register index
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54543
2026-01-18 21:47:25 +02:00
Konstantin Belousov 4938ee8064 x86/local_apic.c: convert lvts[] and elvts[] arrays to designated initializers
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54543
2026-01-18 21:47:25 +02:00
Michael Tuexen 0ef8f7133d netstat: fix typo
MFC after:	3 days
2026-01-18 13:26:52 +01:00
Amy Vargas 2f900cbc5f ifconfig: Use strlcpy(3) instead of strncpy(3) for interface name
No functional change intended.

Reviewed by: pouria, delphij, imp
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D54752
2026-01-18 11:56:39 +03:30
Pouria Mousavizadeh Tehrani adb66ef8c6 netlink(4): Add snl(3) to See Also section
While here, fix manlint warnings in rtnetlink(4).

Reviewed by: melifaro, ziaee, glebius
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D53786
2026-01-18 11:52:13 +03:30
Gleb Smirnoff 76af334737 ipfw: fix !VIMAGE build
NB: Rest of ipfw(4) sources get sx.h via vnet.h, which isn't perfect.
2026-01-17 21:51:38 -08:00
Jose Luis Duran 964d91ee1d pflog: tests: Fix rdr_action_head()
Fix a typo in the rdr_action_head() test.

Fixes:		685fb42538 ("pf: Log the intended action when a NAT rule matches a packet")
MFC after:	1 week
2026-01-17 23:33:04 +00:00
Justin Hibbits dce3d3a8c0 powerpc/loader: Size the CAS PVR array correctly
Fixes:		895eeb492 ("powerpc/loader: Add CAS support for older CPUs")
MFC after:	1 week
2026-01-17 16:54:43 -05:00
Michael Tuexen 5d8777f3a7 dwc: add receive checksum offload for IPv6
This patch adds support for receive checksum offload for TCP/IPv6
and UDP/IPv6. Since receive checksum offload can't be configured
separately for IPv4 and IPv6, IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6
can't be changed independently.

Reviewed by:		Timo Völker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54756
2026-01-17 21:06:28 +01:00
Michael Tuexen aca67c37a5 dwc: add transmit checksum offload for IPv6
This patch adds support for transmit checksum offload for TCP/IPv6
and UDP/IPv6.

Reviewed by:		Timo Völker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54754
2026-01-17 21:01:54 +01:00
Justin Hibbits 895eeb4923 powerpc/loader: Add CAS support for older CPUs
QEMU creates a "ibm,arch-vec-5-platform-support" property for all
pseries emulations.  Add POWER7 and POWER6 to the CAS list, more can be
added later as needed/desired.

MFC after:	1 week
2026-01-17 13:59:43 -05:00
Gordon Bergling 9be9ab2a24 netpfil/ipfw: Fix a typo in a source code comment
- s/vaues/values/

MFC after:	5 days
2026-01-17 19:39:55 +01:00
Gordon Bergling cabb5add07 rockship: Fix a typo in a source code comment
- s/vaues/values/

MFC after:	5 days
2026-01-17 19:38:53 +01:00
Jose Luis Duran 4cd4ccb8e2 nanobsd: Fix typos
MFC after:	1 week
2026-01-17 18:11:19 +00:00
Jose Luis Duran ecc039be7f nanobsd: Add a NO_ROOT build option
Add a -U option to build NanoBSD images without root privileges.  It
relies on makefs/mkimg and metalog (mtree) files, similar to what
release engineering uses to build images.

Keep the current way to build NanoBSD images untouched.  Once this
method gets battle tested, it may be used to build images as root as
well.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48793
2026-01-17 18:10:48 +00:00
Jose Luis Duran 8832f767d6 nanobsd: Add a provisional populate /data function
Add a provisional _populate_data_part function.  It populates the
optional /data partition, but using makefs(8), which is more in-line
with what release engineering uses to create images.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48792
2026-01-17 18:10:22 +00:00
Jose Luis Duran 800d390fe7 nanobsd: Add a provisional populate /cfg function
Add a provisional _populate_cfg_part function.  It populates the /cfg
partition, but using makefs(8), which is more in-line with what release
engineering uses to create images.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48791
2026-01-17 18:09:59 +00:00
Jose Luis Duran 61ac7309c3 nanobsd: Add a provisional populate_part function
Add a _populate_part(ition) function that mimics the current
populate_slice.  Note however, that this function is not
backward-compatible with populate_slice, hence the different name.  A
"_" is prepended to signal that it still experimental.

It can be used to populate the /cfg and /data partition using makefs(8).

Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48790
2026-01-17 18:09:14 +00:00
Jose Luis Duran 5ba2a74e3a nanobsd: Add a nano_makefs function
Add a NANO_MAKEFS global variable with options equivalent to NANO_NEWFS
to be used with a nano_makefs function for creating images.

Also add a function that adjusts the code size calculation, so makefs -s
won't error about the minimum rounded size.  Ideally this shim should be
removed, therefore the suspicious _xxx prefix.

Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48789
2026-01-17 18:08:52 +00:00
Jose Luis Duran 4f141f5ef4 nanobsd: Switch the / partition in fstab
Introduce a function tgt_switch_root_fstab() that switches the root
partition in the target file system tab file.  Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48788
2026-01-17 18:08:03 +00:00
Jose Luis Duran 605fb076eb nanobsd: Add a NANO_TIMESTAMP variable
Initially not wired, this variable will hold the time stamp for all the
files of the final image.
By default uses the last commit time stamp, if empty, it will use the
start time of the NanoBSD build.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48787
2026-01-17 18:07:31 +00:00
Jose Luis Duran 7c4d6fbd1b nanobsd: Add a function to create directories
Add tgt_dir(), that creates and adds directory entries to the metalog
specification file.  Initially not wired.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48786
2026-01-17 18:06:58 +00:00
Jose Luis Duran 64e16fa5c7 nanobsd: Prefer tgt_touch() instead of touch
Prefer tgt_touch() as it adds an entry to the metalog file.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48785
2026-01-17 18:06:19 +00:00
Jose Luis Duran b8b046a259 nanobsd: Set the proper mode for /tmp
The correct mode for /tmp is 1777, keep the same mode when symlinking it
to /var/tmp.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48784
2026-01-17 18:06:01 +00:00
Jose Luis Duran 5345567935 nanobsd: Prefer tgt_dir2symlink() to create symlinks
Prefer tgt_dir2symlink() to create symlinks, as it has the benefit of
appending the entry to the metalog file.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48783
2026-01-17 18:04:09 +00:00
Jose Luis Duran 6eccd84bee nanobsd: Make tgt_dir2symlink() take a mode
Make tgt_dir2symlink() take an optional third argument that sets the
mode.  By default, assume an absolute mode of 0777, to maintain
backward compatibility.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48782
2026-01-17 18:03:50 +00:00
Jose Luis Duran eb544c63fc nanobsd: Add uname/gname to the spec
Also include the default NanoBSD uname/gname in the specification file.

By default, NANO_DEF_UNAME and NANO_DEF_GNAME map to root and wheel
respectively.

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48781
2026-01-17 18:03:26 +00:00
Jose Luis Duran 7106db625e nanobsd: Prefer nano_umount to umount
nano_umount[^1] is a convenience routine used to override issues with
umount(8) without changing the nanobsd.sh source code.  There were a few
places where it was not being used.

[^1]: Introduced in 6d12b61a88 ("Add a routine for easy workaround any
umount issues w/o hacking nanobsd.sh.")

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48780
2026-01-17 18:03:00 +00:00
Jose Luis Duran a4f0a60e05 tarfs: tests: Increase timeout (again 2)
Bump the timeout value (for the third time), to avoid cutoff on emulated
architectures on ci.freebsd.org.  One of the runners will take
considerably more time to complete this test.

Reported by:	Jenkins
Fixes:		a551b05249 ("tarfs: tests: Increase timeout (again)")
MFC after:	3 days
2026-01-17 18:01:21 +00:00
Michael Tuexen 97b177f51f dwc: prepare for IPv6 transmit checksum offloading
No functional change intended.

MFC after:	3 days
2026-01-16 18:28:01 +01:00
Xin LI 8e6843db9b libc: drop NO_FP_LIBC support
NO_FP_LIBC was added in 2004 to save space by disabling FP support in
*printf()/*scanf(). The size benefit is negligible on modern systems
and conflicts with assumptions made by current base utilities.

Remove the option and always build libc with floating-point support.

Reported by:	Oskar Holmlund <eovholmlund at gmail com>
MFC after:	2 weeks
2026-01-16 22:43:40 -08:00
Adrian Chadd afbb21bd1d aq: remove from NOTES; it's unfortunately amd64 only
Unfortunately the aq driver is using readl/writel calls instead
of bus space routines.

This broke, well, everything else.
Fixes:		c75eff16ef
2026-01-16 21:01:02 -08:00
Justin Hibbits cd22fd0549 powerpc: Add ISA 2.06 sub-word atomic set/clear
Add atomic_set/clear_short/char for doing 8-bit and 16-bit operations
more efficiently on "newer" architectures (POWER7 and later).

Piggybacks on b31abc95eb.
2026-01-16 23:10:02 -05:00
Gleb Smirnoff 35caa56a32 tests/ipfw: add a test for ipfw(4) log rules that write to bpf(4) 2026-01-16 20:09:02 -08:00
Gleb Smirnoff 65b4bf7a6e ipfw: refactor how we store bpf tap points
Make the tap database belong to ip_fw_chain, but leave the default "ipfw0"
tap per-vnet.  This is only slightly better than keeping the database per-
vnet, as the bpf name space is per-vnet.  However, we yet have only single
ipfw chain.  Whenever multiple chains will coexist, this needs to be
addressed.

Require the chain lock to make modifications to the database.

Move tap allocation to a later ruleset build stage, when all rule numbers
are known already.  This fixes a panic introduced by 3daae1ac1d.

Fixes:	3daae1ac1d
2026-01-16 20:09:02 -08:00
Gleb Smirnoff 1a7b74d312 ipfw: in a vnet destructor use NET_EPOCH_WAIT()
The lock grab & drop predates epoch(9) introduction to the network
stack and it doesn't provide a true guarantee that all threads that
may use ipfw configuration have finished.  Also the lock prevented
from sleepable operations when freeing the rules.
2026-01-16 20:09:02 -08:00
Sulev-Madis Silber 6dc12ecfb2 spi: "-S" option for continuous stream from standard input to bus
created to allow addressable leds to be driven by abusing spi bus as waveform generator. this might have other uses for similar "permanent" spi transfers

Differential Revision:	https://reviews.freebsd.org/D54734
Reviewed by:	adrian
2026-01-16 19:41:33 -08:00