Commit Graph

292291 Commits

Author SHA1 Message Date
Kristof Provost
480ad40553 vnet tests: check for if_bridge.ko
A number of tests create a bridge, but did not check if if_bridge.ko is loaded.

We usually get away with that, because `ifconfig bridge create` autoloads the
module, but if we run the tests in a jail (e.g. because of kyua's upcoming
execenv.jail.params feature) we can't load the module and these tests can fail.

Check if the module is loaded, skip the test if it is not.

Reviewed by:	markj
MFC after:	1 week
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45487
2024-06-04 22:16:56 +02:00
Mark Johnston
05704402ac bhyve: Add a stub VM_EXITCODE_REG_EMUL handler
This lets us print a few fields of interest before aborting the VM loop.

No functional change intended.

Reviewed by:	corvink, andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44741
2024-06-04 15:06:42 -04:00
Mark Johnston
a0ca4af945 bhyve: Add arm64 support to the gdb stub
- Add -G to the arm64 getopt handler.
- Add static register definitions and extensible XML definitions.
- Provide definitions for MD bits such as breakpoint encoding and
  length.
- Ensure that bhyve re-injects breakpoint exceptions that it is not
  responsible for.

Reviewed by:	andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44740
2024-06-04 15:03:17 -04:00
Mark Johnston
75cb949228 arm64/vmm: Add breakpoint and single-stepping support
This will be used to implement parts of bhyve's gdb stub.

Three VM capabilities are added, similar to amd64 without monitor mode.
Two cause breakpoint and single-step exceptions to be raised to EL2 and
then down to bhyve.  One lets the gdb stub mask hardware interrupts
while single-stepping, since otherwise the guest will handle a timer
interrupt before executing the target instruction and thus fail
to make progress.

Reviewed by:	bnovkov, andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44739
2024-06-04 14:58:08 -04:00
Mitchell Horne
afa166be99 build.7: update cross-compile example
Replace armv6 with the more-relevant arm64.

MFC after:	3 days
2024-06-04 15:27:50 -03:00
Alexander Ziaee
a8a2d5ef12 build.7: +freebsd to description, link development
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1273
2024-06-04 15:27:50 -03:00
Alexander Ziaee
8327796cc8 build.7: nit section order, tag spdx
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1273
2024-06-04 15:27:50 -03:00
Doug Moore
543d55d791 vm_phys: use ilog2(x) instead of fls(x)-1
One of these changes saves two instructions on an amd64
GENERIC-NODEBUG build. The rest are entirely cosmetic, because the
compiler can deduce that x is nonzero, and avoid the needless test.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D45331
2024-06-04 13:07:07 -05:00
Doug Moore
9ff1462976 x86: simplify ceil(log2(x)) function
A function called mask_width in one place and log2 in the other
calculates its value in a more complex way than necessary. A simpler
implementation offered here saves a few bytes in the functions that
call it.

Reviewed by:	alc, avg
Differential Revision:	https://reviews.freebsd.org/D45483
2024-06-04 13:00:25 -05:00
Alexander Ziaee
41d6858ebd git-arc.1: list width typo
Reviewed by:	mhorne
MFC after:	3 days
Fixes:	 	760be44702 ("git-arc: document "create" command options")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1272
2024-06-04 14:46:46 -03:00
Kristof Provost
84ff9e9122 pf: fix overly large memcpy()
We only want to copy the labels array, we don't want to copy the counter as well.

Reported by:	CheriBSD
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-04 19:44:20 +02:00
Kristof Provost
4779b16fa6 pf: fix overly large copy in pf_rule_to_krule()
The timeout array in struct pf_rule has PFTM_OLD_MAX entries, the one in
struct pf_krule has PFTM_MAX entries (and PFTM_MAX > PFTM_OLD_MAX).
Use the smaller of the sizes when copying.

Reported by:	CheriBSD
MFC after:	1 week
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-04 19:44:20 +02:00
Jessica Clarke
9712479723 ObsoleteFiles.inc: Add missed riscv64 file for LLVM 17
LLVM 17 was the first version we shipped asan_static for.
2024-06-04 18:07:56 +01:00
Warner Losh
623d432b15 typo: Fix side -> size since it matters to the meaning...
batch side doesn't make sense, but batch size does. Fix.

Sponsored by:		Netflix
2024-06-04 10:59:01 -06:00
Kristof Provost
2144e31d8f netpfil tests: make the pls tests more robust
Give them more time to hit the expected loss numbers.
We see occasional failures during CI runs. This makes that less likely.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost
1c5b886e11 pf tests: make ether:dummynet test a little more robust
Allow slightly more bandwidth, but cause ping to give up sooner.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
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