Commit graph

292065 commits

Author SHA1 Message Date
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
Jessica Clarke 25a33bfe9c ee: Fix use of uninitialised pointer in ispell_op
This used to be name = mktemp followed by fd = open downstream,
replacing upstream's crude PID-based sprintf, but in 1.4.7 this was
changed upstream to this buggy code, which we then picked up in the
1.5.0 import. Presumably nobody's actually used ee's ispell function
in the past 15 years; that or it's just ended up using junk file names
as temporary files if name's happened to be a valid address to something
that can be interpreted as a string.

Reported by:	Dapeng Gao <dapeng.gao@cl.cam.ac.uk>
Fixes:		96b676e999 ("Update ee(1) in the base system to version 1.5.0.")
MFC after:	1 week
2024-06-02 23:53:09 +01:00
Jessica Clarke 28aaa58fa6 fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence
DELAY takes microseconds not milliseconds, so 100 was too low. Moreover,
when enabling hw.pci.clear_pcib, PCI emeration would still stop at one
of the first bridges, but by asserting PERST for the rest of the reset
sequence that appears to be reliably addressed.

Fixes:	896e217a0e ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver")
2024-06-02 21:42:18 +01:00
Eugene Grosbein c2db3a0c7d rc.subr(8): fix debugging message after previous commit
Fixes:		32a579e4fc
2024-06-03 02:41:10 +07:00
Eugene Grosbein 32a579e4fc rc.subr(8): introduce ${name}_offcmd
New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but now rc.subr(8) does not call it
if a service is not enabled.

Fix devd startup script to use it instead of start_precmd.

PR:		279198
MFC after:	2 weeks
Reported by:	Dmitry S. Lukhtionov
Tested by:	Dmitry S. Lukhtionov
2024-06-03 02:29:22 +07:00
Brooks Davis 39c4f65c72 stddef.h/stdlib.h: Remove unused rune_t
This non-standard type is unused in the base system (__ct_rune_t or
__rune_t are used instead) and ports.  It has been around as long as our
current source repo, but we have avoided using it.  In sys/_types.h
where the __*rune_t typedefs are defined, the following appears in a
comment:

    NOTE: rune_t is not covered by ANSI nor other standards, and should
    not be instantiated outside of lib/libc/locale.  Use wchar_t.

The definition of this unused type meant we gratutiously differed from
standards compliant stddef.h/stdlib.h.

PR:		279357 (exp-run by antoine)

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D45426
2024-06-02 19:41:22 +01:00
Brooks Davis af8cafb2a3 iovec: macros to manipulate len and base together
A set of convenience macros to initialize struct iovec's and increment
the base and length together.

IOVEC_INIT - sets iov_base and iov_len
IOVEC_INIT_CSTR - takes a string and sets iov_len to strlen + 1
IOVEC_INIT_OBJ - takes an object and sets iov_len to sizeof obj
IOVEC_ADVANCE - increments iov_base and decrements iov_len

On CheriBSD these present the opportunity to insert more precise bounds
on some objects and hide differences in casts in hybrid kernels (where
some, but not all pointers are capabilities and require annotation).
Here in FreeBSD the resulting code is tidier, particularly in the
IOVEC_ADVANCE case where the need to cast iov_base to (char *) is
avoided.

Reviewed by:	kib
Feedback from:	des, jrtc27
MFC after:	1 week
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D45422
2024-06-02 19:41:22 +01:00
Colin Percival e50fec56bf Revert "release/Makefile.vm: Use qemu-user-static-devel"
This breaks the weekly snapshot builds.  We'll try again once Warner has
some time to debug the qemu-user-static-devel port.

This reverts commit a04ecddfc7.
2024-06-02 07:07:52 -07:00
Stefan Eßer 077f757d72 newfs_msdos: align data area to VM page boundary by default
Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD devices
and issues with very large cluster sizes (see PR 277414).

The -A option used to align the start of the root directory to a
multiple of the cluster size, which happens to align the start of the
data area with a buffer page boundary in case of large clusters and
the default number of directory entries (512 entries requiring 16 KB
for FAT12 or FAT16, FAT32 puts the root directory into the data area).

This commit aligns the start of the data area with the page size, if
neither -A nor -r is used. It changes -A to align the start of the
data area (end of the root directory) to a multiple of the cluster
size, since this is the alignment that prevents write multiplication
due to clusters crossing erase block boundaries of a SSD device.
The -r option is unchanged and will prevent any automatic alignment
from occuring.

Approved by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45436
2024-06-02 14:07:52 +02:00
Alan Somers e461c7bc7d mdconfig: remove the "cluster" option.
It's never had any effect.  The kernel ignores it.  Remove it from the
documentation.  But continue to parse it on the command line, for
backwards-compatibility.

Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1271
2024-06-01 17:31:04 -06:00
John Baldwin c7c037fad1 bhnd: Remove orphaned driver for the BHND USB core
This was only connected to the build for MIPS and has been
disconnected from the build since MIPS was removed.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45432
2024-06-01 13:25:12 -07:00