Commit graph

292225 commits

Author SHA1 Message Date
Kristof Provost cce6951755 pf tests: basic debug level test
Set & retrieve the debug level.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost c36c90a2cc pf: convert DIOCSETDEBUG to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost 71d3c7041d pf: convert DIOCNATLOOK to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Kristof Provost a9d7ff4e5e pf tests: basic status get/clear test
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Kristof Provost 9dbbe68bc5 pf: convert DIOCCLRSTATUS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Peter Holm 005dd61dd6 stress2: Change fixed number of test loops to timed loops. This to
improve testing with qemu.
2024-06-04 09:39:40 +02:00
Corvin Köhne e425e601b9
bhyve: verify OpRegion size
If the OpRegion size doesn't match the size of our igd_opregion struct, it's
using a different layout than we're expecting. To avoid strange issues, we
should exit hard. If we see any devices in the field with a different OpRegion
size, we can analyse it and fix it accordingly.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45335
2024-06-04 09:08:49 +02:00
Corvin Köhne 5e09c5a1ed
bhyve: use correct size to map the OpRegion
We're already converting the size reported by the OpRegion header from
kilobytes to bytes. We don't have to do that twice when mapping the OpRegion.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45334
2024-06-04 09:08:34 +02:00
Stefan Eßer 41ee91c64f newfs_msdos: fix build on non-FreeBSD systems
Disable data area alignment if the build environment does not define
PAGE_SIZE (e.g., when building on Linux or macOS).

Reported by:	jrtc27
MFC after:	1 week
2024-06-04 08:26:09 +02:00
Alan Cox f1d73aacdc pmap: Skip some superpage promotion attempts that will fail
Implement a simple heuristic to skip pointless promotion attempts by
pmap_enter_quick_locked() and moea64_enter().  Specifically, when
vm_fault() calls pmap_enter_quick() to map neighboring pages at the end
of a copy-on-write fault, there is no point in attempting promotion in
pmap_enter_quick_locked() and moea64_enter().  Promotion will fail
because the base pages have differing protection.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45431
MFC after:	1 week
2024-06-04 00:38:05 -05:00
Xin LI 3b35e7ee8d MFV: xz 5.6.2.
MFC after:	4 weeks
2024-06-03 18:14:43 -07:00
Gleb Smirnoff a9b55a6644 unix: use m_freemp() when disposing unix socket buffers
The new unix/dgram uses m_nextpkt linkage, while the old unix/stream
uses m_next linkage.  This fixes memory leak.

Diagnosed by:		khng
Reviewed by:		khng, markj
PR:			279467
Fixes:			458f475df8
Differential Revision:	https://reviews.freebsd.org/D45478
MFC After:		1 week
2024-06-03 17:23:06 -07:00
Gleb Smirnoff badf44cc21 mbuf: provide m_freemp()
This function follows both m_nextpkt and m_next linkage freeing all mbufs.
Note that existing m_freem() follows only m_next.

Reviewed by:		khng
Differential Revision:	https://reviews.freebsd.org/D45477
2024-06-03 17:23:06 -07:00
Oleksandr Kryvulia ef659a2d04 snd_hda: Add Lenovo X1 Carbon Gen11 support
MFC after:	2 days
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D45361
2024-06-04 02:00:12 +02:00
Olivier Certner f3ab0d86e8
bitset: Fix __BIT_FFS_AT()'s herald comment
The manual page is correct though.

No functional change.

Reviewed by:    emaste
Approved by:    emaste (mentor)
MFC after:      3 days
Event:          Kitchener-Waterloo Hackathon 202406
Sponsored by:   The FreeBSD Foundation
2024-06-03 16:48:49 -04:00
Ed Maste e0dcb9b611 mfi: correct typo in sysctl/tunable description
Reported by:	jrtc27
Reviewed by:	lwhsu
Sponsored by:	The FreeBSD Foundation
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-03 16:32:36 -04:00
Dapeng Gao fbfdf57d65 Fix off-by-one bug in btpand
`ul` reaches `__arraycount(services)` before the bound-check happens, causing undefined behaviour.

Reviewed by:	imp, jrtc27
Fixes:		7718ced0ea ("Add btpand(8) daemon from NetBSD.")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45463
2024-06-03 20:30:36 +01:00
Ryan Libby 7f1012ff7c pctrie: predict successful allocation
Reviewed by:	dougm
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45407
2024-06-03 11:35:28 -07:00
Ryan Libby 3ca6bf7929 db_show_buffer: minor cleanup
Do some light cleanup to make the output format more consistent for
readability.

Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45442
2024-06-03 11:35:28 -07:00
Doug Moore 749c249dc3 subr_pctrie: use ilog2(x) instead of fls(x)-1
In three instances where fls(x)-1 is used, the compiler does not know
that x is nonzero and so adds needless zero checks.  Using ilog(x)
instead saves, in each instance, about 4 instructions, including a
conditional, and 16 or so bytes, on an amd64 build.

Reviewed by:    alc
Differential Revision:  https://reviews.freebsd.org/D45330
2024-06-03 13:31:19 -05:00
Doug Moore 08f6f78f81 libkern: don't use MPASS
Using MPASS in libkern breaks buildworld.  Replace MPASS with KASSERT
in three places.
2024-06-03 13:22:22 -05:00
Dapeng Gao 5dda778db6 Use correct function declaration for yyerror
According to the POSIX standard at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html
`yyerror` should return `int`. Add unreachable since errx never returns.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D45447
2024-06-03 12:14:10 -06:00
Doug Moore e3537f9235 Revert "subr_pctrie: use ilog2(x) instead of fls(x)-1"
This reverts commit 574ef65069.
2024-06-03 13:07:42 -05:00
Doug Moore 574ef65069 subr_pctrie: use ilog2(x) instead of fls(x)-1
In three instances where fls(x)-1 is used, the compiler does not know
that x is nonzero and so adds needless zero checks.  Using ilog(x)
instead saves, in each instance, about 4 instructions, including a
conditional, and 16 or so bytes, on an amd64 build.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D45330
2024-06-03 12:45:45 -05:00
Doug Moore b0056b31e9 libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function;
some are slower than necessary, and one of them is incorrect.
Elimininate them all and define an ilog2 macro in libkern to replace
them, in a way that is fast, correct for all argument types, and, in a
GENERIC kernel, includes a check for an invalid zero parameter.

Folks at Microsoft have verified that having a correct ilog2
definition for their MANA driver doesn't break it.

Reviewed by:	alc, markj, mhorne (older version), jhibbits (older version)
Differential Revision:	https://reviews.freebsd.org/D45170
Differential Revision:	https://reviews.freebsd.org/D45235
2024-06-03 11:37:55 -05:00
Wolfram Schneider 965fff9826 man(1): ignore absolute path for .so include
We want only a relative include, as ".so man1/foobar.1"

MFC after:	1 week
2024-06-03 16:00:42 +00:00
Joshua Kinard 80828c6fab kern: Remove leftover saf1761otg bits
Almost all code related to the saf1761 driver was removed in commit
44796b7e82, except for two small bits related to saf1761otg support.
This patch completes the removal.

PR:		279302
Signed-off-by:	Joshua Kinard <freebsd@kumba.dev>
Reviewed by:	mhorne
MFC after:	3 days
Fixes:		44796b7e82 ("mips: remove saf1761")
2024-06-03 12:52:58 -03:00
Gordon Tetlow a68e4f7a06
Migrate from printb to print_bits for locally defined bit fields.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441
2024-06-03 11:48:35 -04:00
Gordon Tetlow c3e9423743
Move print_bits to ifconfig.c and make available to other src files.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441
2024-06-03 11:48:35 -04:00
Minsoo Choo 079d67b1d8 sys: Disable C standards prior to C99 from kernel build
The kernel hasn't built with anything less than c99 for a long
time. Retire support in the build for it.  In addition, retire the
translation of c99 to -std=iso9899:1999, since all latter day C
compilers that we support have had this for maybe 15 years or so (gcc
since 4.5, clang since the earliest version) and it simplifies the code.

Reviewed-by: imp, emaste
Differential-Revision: https://reviews.freebsd.org/D44145
2024-06-03 08:58:18 -06:00
Dmitry Salychev 645a228481
ds1307: Return error code instead of boolean
It's probably a copy-paste leftover from the other functions which
return a boolean value and generates annoying "CLOCK_SETTIME error 1"
from subr_rtc.c on Traverse Ten64 in verbose mode.

No functional changes intended.

MFC after:	3 days
2024-06-03 15:41:11 +02:00
Xin LI b599c3410c Vendor import of xz 5.6.2 (trimmed) 2024-06-02 22:49:22 -07:00
Cy Schubert 0f996f4541 sqlite3: Vendor import of sqlite3 3.46.0
Release notes at https://www.sqlite.org/releaselog/3_46_0.html.

Obtained from:	https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz

Merge commit '259d29fd8c012d4392fa59ff803b691ead5b304d' into main
2024-06-02 19:28:53 -07:00
Cy Schubert 259d29fd8c sqlite3: Vendor import of sqlite3 3.45.1
Release notes at https://www.sqlite.org/releaselog/3_46_0.html.

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz
2024-06-02 18:33:10 -07:00
Mark Johnston 542f9494b7 proto: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 66d2d42a1f uart: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston a3b460d499 mvs: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston de140d60d5 virtio: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston bad36a4998 acpi: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 801b12ba89 qlnx: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 17bfbc400f siis: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 54482989d3 etherswitch: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston a1b8445115 cxgbe: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston 796bcf1845 cxgb: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston a866a40b9b bhnd: Use device_set_descf()
Here we are in a device probe routine with no locks held.  M_WAITOK
allocations are ok.  No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston 25b839dfd2 ata: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston a74b496507 ahci: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston 459dc61c8b arm: Convert drivers to use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Jessica Clarke 3cc91b7751 Revert "src.sys.obj.mk: Export OBJTOP"
Unfortunately this results in make universe's environment, i.e.
corresponding to the host, being used for every one of its sub-makes, so
they're in the wrong place and trample over each other.

This reverts commit 2b7c1402f9.
2024-06-03 00:33:52 +01:00
Jessica Clarke a20a903b16 Makefile.inc1: Allow showconfig and test-system-* if (X)CC is GCC
This case gets hit in make universe on Linux, since we will first run
make test-system-compiler to determine whether to use the system or
universe toolchain, during which time CC is the host's, GCC, and XCC
isn't set, so defaults to the same.

Fixes:	4c0dfd5959 ("arm: fail early on gcc builds")
2024-06-03 00:16:58 +01:00