Commit Graph

285915 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
fb3ef04d20 Add 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'
git-subtree-dir: contrib/unifdef
git-subtree-mainline: 3b7ffacdee
git-subtree-split: 0da4488583
2023-08-21 19:51:03 +02:00
Dag-Erling Smørgrav
0da4488583 Add missing version.h. 2023-08-21 19:48:44 +02:00
Dag-Erling Smørgrav
2b7d40ea0c Import unifdef 2.12 2023-08-21 19:33:42 +02:00
Dag-Erling Smørgrav
9b3517a49d Import unifdef 2.11 2023-08-21 19:33:26 +02:00
Doug Moore
3b7ffacdee pctrie: change for vm_radix compatibility
Restructure parts of pctrie code to make it more compatible with the
needs of vm_radix code.

1. End passing function pointers for memory management.

By breaking insertion into two functions, the call for allocating
memory can happen at the top level and be inlined, rather than
happening via an function pointer to a memory allocator.

By changing the remove function slightly, freeing of memory, when
necessary, can happen at the top level and be inlined.

By turning the reclamation code into two functions, one for starting
iteration over to-be-freed nodes and the other continuing it, all the
freeing can happen at the top level and be inlined.

2. Offer a version of remove that does not panic and returns the freed
value (or NULL).
3. Offer a 'replace' operation, to replace one leaf with another that
has the same key.

These are three of the roadblocks that prevent code sharing between
pctrie and vm_radix code.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D41396
2023-08-21 12:28:51 -05:00
Luiz Otavio O Souza
2c135a2aec e6000sw: support building without FDT
This enables the use of this driver on platorms without device tree,
such as Netgate's XG-7100.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-21 17:26:17 +02:00
Konstantin Belousov
feaae6ba1a rtld: switch from malloc_aligned() to __crt_aligned_alloc()
Use regular free(), since it works now.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41150
2023-08-21 17:16:42 +03:00
Konstantin Belousov
c29ee08204 rtld_malloc: add __crt_aligned_alloc_offset()
It is modelled after aligned_alloc(3).  Most importantly, to free the
allocation, __crt_free() can be used.  Additionally, caller may specify
offset into the aligned allocation, so that we return offset-ed from
alignment pointer.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41150
2023-08-21 17:16:42 +03:00
Konstantin Belousov
d60130bf32 rtld_malloc: increase overhead index to uint16
Reorder it with magic, to keep alignment.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41150
2023-08-21 17:16:42 +03:00
Konstantin Belousov
6bb7f05850 rtld_malloc.c: change return type of cp2op() to void
for it to be useful to return unaligned pointer.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41150
2023-08-21 17:16:42 +03:00
Konstantin Belousov
3c872a70b8 hwpmc: on process exit, ensure that the owned log is closed
Tested by:	pho (previous version)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41521
2023-08-21 16:33:13 +03:00
Kristof Provost
1fd8c845b8 pf tests: test syncookies on IPv6
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-08-21 13:19:41 +02:00
Kajetan Staszkiewicz
92d4152295 pf: enable the syncookie feature for IPv6
When syncookie support was added to pf the relevant work was only done
in pf_test(), not pf_test6(). Do this now.

MFC after:	1 week
Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D41502
2023-08-21 13:19:06 +02:00
Kajetan Staszkiewicz
9642d948c0 pf: reduce indentation
Early-return to reduce syncookie-related indentation.

No functional change.

MFC after:	1 week
Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D41502
2023-08-21 13:18:52 +02:00
Konstantin Belousov
42e70f4283 PMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags
Reported by:	pho
Fixes:	8e63e787ab
Sponsored by:	The FreeBSD Foundation
2023-08-21 13:31:06 +03:00
Bjoern A. Zeeb
e2340276fc rtw89: update driver from upstream
This is a set of updates of the rtw89 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1).
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5).
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3).
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

MFC after:      20 days
2023-08-21 01:35:29 +00:00
Bjoern A. Zeeb
cbb3ec2523 mt76: update driver from upstream
This is a set of updates of the mt76 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
  This adds support for mt7996 as well.
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

The current version of LinuxKPI lacks support for "page pool" which
needs enhancing and updating a decade or so old shortcut mapping
struct page directly to struct vm_page.

MFC after:	20 days
2023-08-21 01:34:03 +00:00
Bjoern A. Zeeb
5c1def83a4 ath12k: import driver from upstream
Import BSD-3-Clause-Clear ath12k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1)
with further updates based on
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4),
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working (as does ath11k).
There was interest by various people to enhance support further
for ath11k which will equally benefit ath12k.

Given the lack of full license texts on the files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:	core (jhb, 2023-05-11) [1]
MFC after:      20 days
2023-08-21 01:33:04 +00:00
Bjoern A. Zeeb
28348caeee ath11k: update driver from upstream
This is a set of updates of the ath11k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after:	20 days
2023-08-21 01:32:46 +00:00
Bjoern A. Zeeb
07724ba62b ath10k: update driver from upstream
This is a set of updates of the ath10k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after:	20 days
2023-08-21 01:32:10 +00:00
Bjoern A. Zeeb
eb50aa680f ath1xk_common: update common athk files from upstream
Update ath1xk_common based on wireless-testing (wt-2023-05-11)
711dca0ca3d77414f8f346e564e9c8640147f40d (right after v6.4-rc1).

MFC after:	20 days
2023-08-21 01:31:57 +00:00
Bjoern A. Zeeb
734e82fe33 ath10k: specifically mark a debug workaround for an early firmware crash
During the last import a (debug) workaround to avoid an early firmware
crash was imported.  In order to remember and to separate it from
upstream sources put it under #ifdef

MFC after:	20 days
2023-08-21 01:30:50 +00:00
Bjoern A. Zeeb
adff403fe7 LinuxKPI: 802.11: update compat code for updated drivers
Adjust and add structs, fields, functions to make more modern versions
of LinuxKPI based wireless drivers (based on wireless-testing (
wt-2023-06-09, wt-2023-07-24, and later)) compile.

Some of these changes can only be applied once all drivers get
updated to not break the old versions currently in the tree.
Mark those changes with __FOR_LATER_DRV_UPDATE for now and flip the
switch at a later point.

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-08-21 00:39:57 +00:00
Konstantin Belousov
89e17c6ea0 libc/gen/_pthread_stubs.c: Remove stray whitespaces
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-21 01:44:18 +03:00
Minsoo Choo
0dc52b7210 libc: export pthread_getname_np stub
pthread_getname_np needs to be provided by libc in order to import
jemalloc 5.3.0.

A stub implementation for libc pthread_getname_np() is added for
_pthread_stubs.c, which always reports empty name for the main thread.

Internal _pthread_getname_np() is not exported, but provided for libc
own use.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41461
2023-08-21 01:44:17 +03:00
Daniel Engberg
ed3fb74e44 share/mk/bsd.cpu.mk: Add AMD Zen 4 for x86
Main difference between older Zen variants is that this supports AVX-512

Reviewed by:	imp (previous version), emaste
Approved by:	emaste
Differential Revision:	https://reviews.freebsd.org/D41331
2023-08-20 23:54:29 +02:00
Ed Maste
1b91d634a5 ssh: fix OpenSSH 9.4 regression with multiplexed sessions
Upstream commit message:
upstream: fix regression in OpenSSH 9.4 (mux.c r1.99) that caused
multiplexed sessions to ignore SIGINT under some circumstances.
Reported by / feedback naddy@, ok dtucker@

OpenBSD-Commit-ID: 4d5c6c894664f50149153fd4764f21f43e7d7e5a

Fixes: 535af610a4 ("ssh: Update to OpenSSH 9.4p1")
Obtained from:	OpenSSH 803e22eabd3b
Sponsored by:	The FreeBSD Foundation
2023-08-20 15:20:49 -04:00
Konstantin Belousov
b1d3e2b771 rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method
The method might require resolving and binding symbols, which means
recursing on the bind lock. It is safe to unlock the bind lock,
since we operate on the private object list, and user attempting to
unload an object from the list of not yet fully loaded objects caused
self-inflicted race.

It is similar to how we treat user' init/fini methods.

Reported by:	stevek
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-20 15:30:13 +03:00
Val Packett
64fbda90da Add atopcase, the Apple HID over SPI input driver
The driver provides support for Human Interface Devices (HID) on
Serial Peripheral Interface (SPI) buses on Apple Intel Macs
produced in 2015-2018.

The driver appears to work more stable after installation of Darwin OSI
in acpi(4) driver.
To install Darwin OSI insert following lines into /boot/loader.conf:

hw.acpi.install_interface="Darwin"
hw.acpi.remove_interface="Windows 2009, Windows 2012"

Reviewed by:	wulf
Differential revision:	https://reviews.freebsd.org/D39863
2023-08-20 12:53:32 +03:00
Val Packett
1c4edee342 bcm5974(4): add support for devices attached over SPI bus
Reviewed by:	wulf
2023-08-20 12:53:32 +03:00
Vladimir Kondratyev
62aa7ab939 Add plug and play information macro for SPI bus.
Matching table format is compatible with ACPI_ID_PROBE bus method.
2023-08-20 12:53:32 +03:00
Dmitry Salychev
58983e4b02
dpaa2: Clean up channels in separate tasks
Each channel gets its own DMA resources, cleanup and "bufferpool"
tasks, and a separate cleanup taskqueue to isolate channels operation
as much as possible to avoid various kernel panics under heavy network
load.

As a side-effect of this work, dpaa2_buf structure is simplified and
all of the functions to re-seed those buffers are gathered now in
dpaa2_buf.h and .c files; functions to work with channels are
extracted into dpaa2_channel.h and .c files as well.

Reported by:		dch
Reviewed by:		bz
Approved by:		bz (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D41296
2023-08-20 10:17:26 +02:00
Xin LI
83d941e0af Bump __FreeBSD_version for zlib 1.3. 2023-08-20 01:13:19 -07:00
Dmitry Chagin
524c9accdc linux(4): Replace linux32_copyiniov by freebsd32_copyiniov
MFC after:		1 month
2023-08-20 10:36:32 +03:00
Dmitry Chagin
c987ff4d7b linux(4): Replace linux32_copyinuio by freebsd32_copyinuio
MFC after:		1 month
2023-08-20 10:36:32 +03:00
Dmitry Chagin
4e5f2eb0b6 Regen for readv syscall 2023-08-20 10:36:32 +03:00
Dmitry Chagin
5585afe642 linux(4): Prepare to retire linux32_copyinuio
MFC after:		1 month
2023-08-20 10:36:31 +03:00
Dmitry Chagin
d6cb9e728b linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwrite
MFC after:		1 month
2023-08-20 10:36:31 +03:00
Dmitry Chagin
dfbb3e2aae linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwritev
MFC after:		1 month
2023-08-20 10:36:31 +03:00
Dmitry Chagin
4231b825ac linux(4): Add a dedicated writev syscall wrapper
Adding a writev syscall wrapper is needed due to Linux family of write
syscalls doesn't distinguish between in kernel blocking operations
and always returns EAGAIN while FreeBSD can return ENOBUFS.

MFC after:		1 month
2023-08-20 10:36:31 +03:00
Dmitry Chagin
1f9d71ee32 Regen for writev syscall 2023-08-20 10:36:31 +03:00
Dmitry Chagin
aad4b799f7 linux(4): Add a writev syscall wrapper
Adding a writev syscall wrapper is needed due to Linux family of write
syscalls doesn't distinguish between in kernel blocking operations
and always returns EAGAIN while FreeBSD can return ENOBUFS.

MFC after:		1 month
2023-08-20 10:36:30 +03:00
Dmitry Chagin
e58ff66464 linux(4): Add a write syscall wrapper
Adding a write syscall wrapper is needed due to Linux family of write
syscalls doesn't distinguish between in kernel blocking operations
and always returns EAGAIN while FreeBSD can return ENOBUFS.

MFC after:		1 month
2023-08-20 10:36:29 +03:00
Dmitry Chagin
89d270b28d Regen for write syscall 2023-08-20 10:36:29 +03:00
Dmitry Chagin
510f5c88f0 linux(4): Modify write syscall to match Linux
Adding a write syscall wrapper is needed due to Linux family of write
syscalls doesn't distinguish between in kernel blocking operations
and always returns EAGAIN while FreeBSD can return ENOBUFS.

MFC after:		1 month
2023-08-20 10:36:28 +03:00
Xin LI
4717628ed8 MFV: zlib 1.3
Relnotes:	yes
MFC after:	2 weeks
2023-08-19 23:06:49 -07:00
Colin Percival
6feeb67bf8 Bump __FreeBSD_version for struct sysinit change
The layout of struct sysinit changed in cedc82c046 to add a
"SLIST_ENTRY(sysinit) next" field so that sysinits can be placed
into a linked list.

Reported by:	jrtc27
2023-08-19 23:03:30 -07:00
Kyle Evans
79e6ffb695 netbsd-tests: libc: fix strvis(3) overflow tests
These tests weren't run on x86 until CI grabbed them.  It turns out,
there's a sign extension bug that surfaces on x86 with char being a
signed type.

NetBSD unearthed this when they took and improved the patch, so just
grab their solution until we get to merging in the latest version of
the test.

Reported by:	CI (via ngie)
Fixes:	2f489a509e ("libc: fix some overflow scenarios in vis(3)")
2023-08-20 00:36:23 -05:00
Colin Percival
9a7add6d01 init_main: Switch from sysinit array to SLIST
This has two effects:
1. We can mergesort the sysinits instead of bubblesorting them, which
shaves about 2 ms off the boot time in Firecracker.
2. Adding more sysinits (e.g. from a KLD) can be performed by sorting
them and then merging the sorted lists, which is both faster than
the previous "append and sort" approach and avoids needing malloc.

Reviewed by:	jhb (previous version)
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41075
2023-08-19 22:04:56 -07:00
Colin Percival
cedc82c046 struct sysinit: Add SLIST_ENTRY(sysinit) next
This will be used to put SYSINITs onto a linked list.

Reviewed by:	jhb, emaste
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41074
2023-08-19 22:04:55 -07:00