Commit Graph

285928 Commits

Author SHA1 Message Date
John Baldwin
7a56f5af71 libcrypto: Don't embed $FreeBSD$ in generated assembly files
Reviewed by:	gallatin, ngie, emaste
Differential Revision:	https://reviews.freebsd.org/D41536
2023-08-21 21:01:48 -07:00
John Baldwin
834f73d253 build{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submake
This fixes make UNIVERSE_TOOLCHAIN=yes with libcompats.

Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D41535
2023-08-21 21:00:45 -07:00
John Baldwin
7ccaf76a27 riscv db_trace: Ensure trapframe pointer is suitably aligned.
Suggested by:	jrtc27
Reviewed by:	jrtc27
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41534
2023-08-21 21:00:26 -07:00
Warner Losh
682d5a87e5 Delete trailing whitespace from $FreeBSD$ removal
Fixes: d4bf8003ee
Sponsored by: Netflix
2023-08-21 19:37:28 -06:00
Warner Losh
b376ef36f5 Update freebsd-yeet for mfc 2023-08-21 19:37:20 -06:00
Ed Maste
4258eb5a0d x86: handle domains with no CPUs usable for intr delivery
We can end up with a domain having no CPUs capable of receiving I/O
interrupts.  This can occur, for example, when all APIC IDs in a given
domain are 256 or greater, and we have no IOMMU.

In this case disable per-domain interrupt support, effectively reverting
to the behaviour before commit a48de40bcc ("Only use CPUs in the
domain the device is attached to for default").  This has a performance
impact but at least allows the system to be functional.  It is a stop-
gap until we can rely on the presence of an IOMMU on all x86 platforms.

Thanks to AMD for providing the high-thread-count machine I used for
testing this change, and to cperciva for testing on other hardware.

Reviewed by:	jhb
Tested by:	cperciva, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41501
2023-08-21 15:52:10 -04:00
Robert Clausecker
b404e03007 share/man/man7/simd.7: document new amd64 memcmp/bcmp baseline routines
Sponsored by:	The FreeBSD Foundation

bcmp(3) is implemented as a variant of memcmp(3) and benefits
from the same optimisations.

Sponsored by:	The FreeBSD Foundation
Approved by:	kib
Differential Revision:	https://reviews.freebsd.org/D41442
2023-08-21 21:19:46 +02:00
Robert Clausecker
8803f01e93 lib/libc/amd64/string/memcmp.S: add baseline implementation
This changeset adds a baseline implementation of memcmp and bcmp
for amd64. The same code is used for both functions with conditional
code were the behaviour differs (we need more precise output for the
memcmp case).

FreeBSD documents that memcmp returns the difference between the
mismatching characters. Slightly faster code would be possible could
we relax this requirement to the ISO/IEC 9899:1999 requirement of
merely returning a negative/positive integer or zero.

Performance is better than bionic and glibc, except for long strings
were the two are 13% faster. This could be because they use SSE4
ptest which we cannot use in a baseline kernel.

Sponsored by:	The FreeBSD Foundation
Approved by:	mjg
Differential Revision:	https://reviews.freebsd.org/D41442
2023-08-21 21:19:46 +02:00
Robert Clausecker
245fee96c0 share/man/man7/simd.7: document SIMD-enhanced stpcpy()
Sponsored by:	The FreeBSD Foundation
Approved by:	mjg kib
Differential Revision:	https://reviews.freebsd.org/D41349
2023-08-21 21:04:07 +02:00
Robert Clausecker
9fbea87028 lib/libc/amd64/string/stpcpy.S: add baseline implementation
This commit adds a baseline implementation of stpcpy(3) for amd64.
It performs quite well in comparison to the previous scalar implementation
as well as agains bionic and glibc (though glibc is faster for very long
strings).  Fiddle with the Makefile to also have strcpy(3) call into the
optimised stpcpy(3) code, fixing an oversight from D9841.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp ngie emaste
Approved by:	mjg kib
Fixes:		D9841
Differential Revision:	https://reviews.freebsd.org/D41349
2023-08-21 20:59:38 +02:00
Dag-Erling Smørgrav
7addfafe73 unifdef: Vendorize. 2023-08-21 19:52:27 +02:00
Dag-Erling Smørgrav
049b7608f4 unifdef: Reapply our 7102ec5226. 2023-08-21 19:52:25 +02:00
Dag-Erling Smørgrav
343b776fd0 unifdef: Reapply our 61287be181. 2023-08-21 19:52:06 +02:00
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