]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 months agoAdd 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:51:03 +0000 (19:51 +0200)]
Add 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'

git-subtree-dir: contrib/unifdef
git-subtree-mainline: 3b7ffacdee49f90716cba2bcf8af3fc1971ae031
git-subtree-split: 0da44885831dc0a43c4ca6ff04a2430993cc0a80

9 months agoAdd missing version.h.
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:48:44 +0000 (19:48 +0200)]
Add missing version.h.

9 months agoImport unifdef 2.12
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:33:42 +0000 (19:33 +0200)]
Import unifdef 2.12

9 months agoImport unifdef 2.11
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:33:26 +0000 (19:33 +0200)]
Import unifdef 2.11

9 months agopctrie: change for vm_radix compatibility
Doug Moore [Mon, 21 Aug 2023 17:28:51 +0000 (12:28 -0500)]
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

9 months agoe6000sw: support building without FDT
Luiz Otavio O Souza [Mon, 21 Aug 2023 09:59:25 +0000 (11:59 +0200)]
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")

9 months agortld: switch from malloc_aligned() to __crt_aligned_alloc()
Konstantin Belousov [Sun, 30 Jul 2023 01:51:52 +0000 (04:51 +0300)]
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

9 months agortld_malloc: add __crt_aligned_alloc_offset()
Konstantin Belousov [Sat, 22 Jul 2023 04:21:45 +0000 (07:21 +0300)]
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

9 months agortld_malloc: increase overhead index to uint16
Konstantin Belousov [Tue, 25 Jul 2023 12:54:45 +0000 (15:54 +0300)]
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

9 months agortld_malloc.c: change return type of cp2op() to void
Konstantin Belousov [Sun, 30 Jul 2023 01:58:01 +0000 (04:58 +0300)]
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

9 months agohwpmc: on process exit, ensure that the owned log is closed
Konstantin Belousov [Sun, 13 Aug 2023 13:42:49 +0000 (16:42 +0300)]
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

9 months agopf tests: test syncookies on IPv6
Kristof Provost [Mon, 21 Aug 2023 06:06:50 +0000 (08:06 +0200)]
pf tests: test syncookies on IPv6

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

9 months agopf: enable the syncookie feature for IPv6
Kajetan Staszkiewicz [Mon, 21 Aug 2023 06:01:29 +0000 (08:01 +0200)]
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

9 months agopf: reduce indentation
Kajetan Staszkiewicz [Mon, 21 Aug 2023 05:59:49 +0000 (07:59 +0200)]
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

9 months agoPMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags
Konstantin Belousov [Sun, 20 Aug 2023 20:16:58 +0000 (23:16 +0300)]
PMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags

Reported by: pho
Fixes: 8e63e787abbd69d29e55e2e0b2aa0aa624339f3b
Sponsored by: The FreeBSD Foundation

9 months agortw89: update driver from upstream
Bjoern A. Zeeb [Tue, 16 May 2023 23:44:56 +0000 (23:44 +0000)]
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

9 months agomt76: update driver from upstream
Bjoern A. Zeeb [Tue, 23 May 2023 23:03:09 +0000 (23:03 +0000)]
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

9 months agoath12k: import driver from upstream
Bjoern A. Zeeb [Sun, 11 Jun 2023 00:23:44 +0000 (00:23 +0000)]
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

9 months agoath11k: update driver from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:36:03 +0000 (00:36 +0000)]
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

9 months agoath10k: update driver from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:37:02 +0000 (00:37 +0000)]
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

9 months agoath1xk_common: update common athk files from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:38:12 +0000 (00:38 +0000)]
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

9 months agoath10k: specifically mark a debug workaround for an early firmware crash
Bjoern A. Zeeb [Wed, 17 May 2023 20:21:14 +0000 (20:21 +0000)]
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

9 months agoLinuxKPI: 802.11: update compat code for updated drivers
Bjoern A. Zeeb [Tue, 16 May 2023 22:07:53 +0000 (22:07 +0000)]
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

9 months agolibc/gen/_pthread_stubs.c: Remove stray whitespaces
Konstantin Belousov [Sun, 20 Aug 2023 22:32:43 +0000 (01:32 +0300)]
libc/gen/_pthread_stubs.c: Remove stray whitespaces

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 months agolibc: export pthread_getname_np stub
Minsoo Choo [Mon, 14 Aug 2023 22:21:24 +0000 (18:21 -0400)]
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

9 months agoshare/mk/bsd.cpu.mk: Add AMD Zen 4 for x86
Daniel Engberg [Sun, 20 Aug 2023 21:54:19 +0000 (23:54 +0200)]
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

9 months agossh: fix OpenSSH 9.4 regression with multiplexed sessions
Ed Maste [Sun, 20 Aug 2023 19:16:54 +0000 (15:16 -0400)]
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: 535af610a4fd ("ssh: Update to OpenSSH 9.4p1")
Obtained from: OpenSSH 803e22eabd3b
Sponsored by: The FreeBSD Foundation

9 months agortld: unlock bind lock when calling into crt __pthread_distribute_static_tls method
Konstantin Belousov [Fri, 18 Aug 2023 19:52:24 +0000 (22:52 +0300)]
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

9 months agoAdd atopcase, the Apple HID over SPI input driver
Val Packett [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
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

9 months agobcm5974(4): add support for devices attached over SPI bus
Val Packett [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
bcm5974(4): add support for devices attached over SPI bus

Reviewed by: wulf

9 months agoAdd plug and play information macro for SPI bus.
Vladimir Kondratyev [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
Add plug and play information macro for SPI bus.

Matching table format is compatible with ACPI_ID_PROBE bus method.

9 months agodpaa2: Clean up channels in separate tasks
Dmitry Salychev [Sun, 18 Jun 2023 15:03:24 +0000 (17:03 +0200)]
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

9 months agoBump __FreeBSD_version for zlib 1.3.
Xin LI [Sun, 20 Aug 2023 08:13:19 +0000 (01:13 -0700)]
Bump __FreeBSD_version for zlib 1.3.

9 months agolinux(4): Replace linux32_copyiniov by freebsd32_copyiniov
Dmitry Chagin [Sun, 20 Aug 2023 07:36:32 +0000 (10:36 +0300)]
linux(4): Replace linux32_copyiniov by freebsd32_copyiniov

MFC after: 1 month

9 months agolinux(4): Replace linux32_copyinuio by freebsd32_copyinuio
Dmitry Chagin [Sun, 20 Aug 2023 07:36:32 +0000 (10:36 +0300)]
linux(4): Replace linux32_copyinuio by freebsd32_copyinuio

MFC after: 1 month

9 months agoRegen for readv syscall
Dmitry Chagin [Sun, 20 Aug 2023 07:36:32 +0000 (10:36 +0300)]
Regen for readv syscall

9 months agolinux(4): Prepare to retire linux32_copyinuio
Dmitry Chagin [Sun, 20 Aug 2023 07:36:31 +0000 (10:36 +0300)]
linux(4): Prepare to retire linux32_copyinuio

MFC after: 1 month

9 months agolinux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwrite
Dmitry Chagin [Sun, 20 Aug 2023 07:36:31 +0000 (10:36 +0300)]
linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwrite

MFC after: 1 month

9 months agolinux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwritev
Dmitry Chagin [Sun, 20 Aug 2023 07:36:31 +0000 (10:36 +0300)]
linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwritev

MFC after: 1 month

9 months agolinux(4): Add a dedicated writev syscall wrapper
Dmitry Chagin [Sun, 20 Aug 2023 07:36:31 +0000 (10:36 +0300)]
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

9 months agoRegen for writev syscall
Dmitry Chagin [Sun, 20 Aug 2023 07:36:31 +0000 (10:36 +0300)]
Regen for writev syscall

9 months agolinux(4): Add a writev syscall wrapper
Dmitry Chagin [Sun, 20 Aug 2023 07:36:30 +0000 (10:36 +0300)]
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

9 months agolinux(4): Add a write syscall wrapper
Dmitry Chagin [Sun, 20 Aug 2023 07:36:29 +0000 (10:36 +0300)]
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

9 months agoRegen for write syscall
Dmitry Chagin [Sun, 20 Aug 2023 07:36:29 +0000 (10:36 +0300)]
Regen for write syscall

9 months agolinux(4): Modify write syscall to match Linux
Dmitry Chagin [Sun, 20 Aug 2023 07:36:28 +0000 (10:36 +0300)]
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

9 months agoMFV: zlib 1.3
Xin LI [Sun, 20 Aug 2023 06:06:49 +0000 (23:06 -0700)]
MFV: zlib 1.3

Relnotes: yes
MFC after: 2 weeks

9 months agoBump __FreeBSD_version for struct sysinit change
Colin Percival [Sun, 20 Aug 2023 06:01:27 +0000 (23:01 -0700)]
Bump __FreeBSD_version for struct sysinit change

The layout of struct sysinit changed in cedc82c0466a to add a
"SLIST_ENTRY(sysinit) next" field so that sysinits can be placed
into a linked list.

Reported by: jrtc27

9 months agonetbsd-tests: libc: fix strvis(3) overflow tests
Kyle Evans [Sun, 20 Aug 2023 05:28:08 +0000 (00:28 -0500)]
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: 2f489a509e61 ("libc: fix some overflow scenarios in vis(3)")

9 months agoinit_main: Switch from sysinit array to SLIST
Colin Percival [Tue, 18 Jul 2023 02:29:20 +0000 (19:29 -0700)]
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

9 months agostruct sysinit: Add SLIST_ENTRY(sysinit) next
Colin Percival [Tue, 18 Jul 2023 02:20:05 +0000 (19:20 -0700)]
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

9 months agoAdd <sys/queue_mergesort.h>
Colin Percival [Tue, 18 Jul 2023 00:07:44 +0000 (17:07 -0700)]
Add <sys/queue_mergesort.h>

Thie file provides macros for performing mergesorts and merging two
sorted lists implemented by <sys/queue.h>.  The mergesort operates
in guaranteed O(n log n) time and uses constant additional space:
3 or 4 pointers (depending on list type) and 4 size_t values.  The
merge operates in guaranteed O(n + m) time and uses constant
additional space: 3 pointers.

In memoriam: hselasky
Reviewed by: jhb (previous version)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D41073

9 months agoqueue.h: Define {LIST,TAILQ}_REMOVE_HEAD
Colin Percival [Mon, 17 Jul 2023 23:42:50 +0000 (16:42 -0700)]
queue.h: Define {LIST,TAILQ}_REMOVE_HEAD

The LIST and TAILQ structures have fast _REMOVE macros (since each
element has a pointer to the previous element); we implement the
_REMOVE_HEAD macros for them by simply finding the first element and
then removing it.

Reviewed by: jhb, emaste
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D41072

9 months agoxhci: Add support for 64-bit DMA in generic XHCI controller driver
Stephen J. Kiernan [Fri, 11 Aug 2023 16:06:02 +0000 (12:06 -0400)]
xhci: Add support for 64-bit DMA in generic XHCI controller driver

The XHCI controller on 64-bit SoCs need to use 64-bit DMA.
Add a quirk to tell the generic XHCI driver that 32-bit DMA needs
to be used, if there are any that may need to use 32-bit DMA only.

Reviewed by: andrew
Obtained from: Juniper Networks, Inc.

9 months agoVendor import of zlib 1.3.
Xin LI [Sat, 19 Aug 2023 21:55:24 +0000 (14:55 -0700)]
Vendor import of zlib 1.3.

9 months agolinux(4): Fix linker warning about undefined vdso symbols
Dmitry Chagin [Sat, 19 Aug 2023 21:48:36 +0000 (00:48 +0300)]
linux(4): Fix linker warning about undefined vdso symbols

Pointed out by: bz
MFC after: 3 days

9 months agolinux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile
Dmitry Chagin [Sat, 19 Aug 2023 18:55:23 +0000 (21:55 +0300)]
linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile

MFC after: 1 month

9 months agolinux(4): Allow in fd to be a socket in sendfile
Dmitry Chagin [Sat, 19 Aug 2023 18:55:23 +0000 (21:55 +0300)]
linux(4): Allow in fd to be a socket in sendfile

In this case sendfile fallback is used.

MFC after: 1 month

9 months agosctp: fix a warning
Michael Tuexen [Sat, 19 Aug 2023 11:24:02 +0000 (13:24 +0200)]
sctp: fix a warning

Fix an unused-but-set-variable warning for builds without INVARIANTS.

Reported by: O. Hartmann
MFC after: 1 week

9 months agosctp: cleanup handling of graceful shutdown of the peer
Michael Tuexen [Sat, 19 Aug 2023 10:35:49 +0000 (12:35 +0200)]
sctp: cleanup handling of graceful shutdown of the peer

Don't handle a graceful shutdown of the peer as an implicit signal
that all partial messages are complete. First, this is not implemented
correctly and second this should not be done by the peer. It is more
appropriate to handle this as a protocol violation.
Remove the incorrect code and leave detecting the protocol violation
and its handling in a followup commit.

MFC after: 1 week

9 months agostress2: No need to write to the console. Add revision to log string
Peter Holm [Sat, 19 Aug 2023 07:29:09 +0000 (09:29 +0200)]
stress2: No need to write to the console.  Add revision to log string

9 months agostress2: Added a syzkaller reproducer
Peter Holm [Sat, 19 Aug 2023 07:28:10 +0000 (09:28 +0200)]
stress2: Added a syzkaller reproducer

9 months agoLinuxKPI: skbuff: add skb_cow_head()
Bjoern A. Zeeb [Thu, 10 Aug 2023 02:07:41 +0000 (02:07 +0000)]
LinuxKPI: skbuff: add skb_cow_head()

Add dummy implementation of skb_cow_head().

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

9 months agoLinuxKPI: skbuff: fix tracing
Bjoern A. Zeeb [Sat, 19 Aug 2023 04:50:03 +0000 (04:50 +0000)]
LinuxKPI: skbuff: fix tracing

Fix arguments to a trace line and remove another trace line until we
actually will have the skb to trace along with a future implementation.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

9 months agoCirrus-CI: restore amd64-gcc12 build/test on main
Ed Maste [Sat, 19 Aug 2023 01:27:26 +0000 (21:27 -0400)]
Cirrus-CI: restore amd64-gcc12 build/test on main

The Cirrus-CI log length issue was addressed by commit 5f72ceb2c50d
("Cirrus-CI: for *-gcc12, build world with make -s"), and the failure
itself by commit 0c785f06020f ("Fix GoogleTest 1.14.0 import").

This reverts commit 0ed2e7e88984aa4ad01a41e9350c5870b271c0c3.

Reported by: Jose Luis Duran
Sponsored by: The FreeBSD Foundation

9 months agounbound: Move config.h to lib directory.
Dag-Erling Smørgrav [Sat, 19 Aug 2023 01:44:39 +0000 (01:44 +0000)]
unbound: Move config.h to lib directory.

It was originally in contrib, and moved to usr.sbin in 6692aa840c1f; I always thought lib would make more sense but never got around to moving it.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D41504

9 months agovfs: track how many times vn_alloc blocked on hitting the vnode limit
Mateusz Guzik [Fri, 18 Aug 2023 23:56:58 +0000 (23:56 +0000)]
vfs: track how many times vn_alloc blocked on hitting the vnode limit

9 months agolibcrypto: add rsa_depr.c to the build
Ed Maste [Fri, 18 Aug 2023 19:03:40 +0000 (15:03 -0400)]
libcrypto: add rsa_depr.c to the build

It provides the RSA_generate_key function, which is deprecated as of
3.0 but is used by various ports.

Reviewed by: kbowling
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41506

9 months agosys: Remove SND_DECLARE_FILE
John Baldwin [Fri, 18 Aug 2023 20:05:12 +0000 (13:05 -0700)]
sys: Remove SND_DECLARE_FILE

Reviewed by: kbowling, imp, emaste
Differential Revision: https://reviews.freebsd.org/D41499

9 months agopcm: Turn SND_DECLARE_FILE into a no-op.
John Baldwin [Fri, 18 Aug 2023 20:04:33 +0000 (13:04 -0700)]
pcm: Turn SND_DECLARE_FILE into a no-op.

SND_DECLARE_FILE originally added lines to the output of /dev/sndstat
listing the $FreeBSD$ strings for individual files, but only if the
value of hw.snd.verbose was raised to 3.  With the switch to Git these
strings became meaningless as they were now all identical and no longer
contained the path (which was implicitly included previously via the
keyword expansion).

This commit removes all of the infrastructure to support file version
strings from /dev/sndstat, but preserves the KPI/KBI by turning the
SND_DECLARE_FILE macro into a nop and changing the backing sysinit
functions into null functions and is suitable for merging to
stable/13.

A future commit will remove SND_DECLARE_FILE entirely.

Reviewed by: kbowling, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41498

9 months agoFix GoogleTest 1.14.0 import
Enji Cooper [Fri, 18 Aug 2023 11:28:13 +0000 (04:28 -0700)]
Fix GoogleTest 1.14.0 import

- Prune headers and tests no longer installed after the upgrade.
- Remove GoogleTest-related files when MK_GOOGLETEST == no.
- Disable `-Werror` with gcc to unbreak the gcc12 CI run with
  `lib/googletest`. Any issues found by g++ will be filed
  upstream and hopefully resolved in a future version.
- Remove clang -Werror issues which are resolved in version 1.14.0 to
  avoid masking valid issues.

MFC after: 1 week
MFC with: 28f6c2f292806bf31230a959bc4b19d7081669a7

9 months agolibcrypto: add err_all_legacy.c to the build
Ed Maste [Fri, 18 Aug 2023 18:28:42 +0000 (14:28 -0400)]
libcrypto: add err_all_legacy.c to the build

It provides the ERR_load_*_strings routines, which are deprecated as of
3.0 but are used by various ports.

PR: 272580
Reviewed by: kbowling
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41505

9 months agoirdma(4): upgrade to 1.2.17-k
Bartosz Sobczak [Fri, 18 Aug 2023 18:14:33 +0000 (11:14 -0700)]
irdma(4): upgrade to 1.2.17-k

Update Intel irdma driver to version 1.2.17-k

Notable changes:
- pf-reset handling improvements, including fixes in communication with if_ice(4)
- avoid racing when handling various events
- adding sw stats sysctls
- hand over pe_criterr handling from ice(4) to irdma(4)
- debug prints adjustments
- fix crash after changes in irdma_add_mqh_ifa_cb

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
MFC after: 1 month
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41425

9 months agoUPDATING: fix a typo, adjust a white space
Graham Perrin [Fri, 18 Aug 2023 16:55:25 +0000 (17:55 +0100)]
UPDATING: fix a typo, adjust a white space

From:

> … chagned.  boot0sio …

to:

> … changed. boot0sio …

Fixes: 4722ceb7d53e Use 115200 bps by default for serial communication
9 months agosubr_unit.c: another attempt to fix the build
Konstantin Belousov [Fri, 18 Aug 2023 15:42:59 +0000 (18:42 +0300)]
subr_unit.c: another attempt to fix the build

Reported by: cy
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 months agosym(4): Add __diagused to nseg of getbaddrcb()
Marius Strobl [Fri, 18 Aug 2023 14:29:10 +0000 (16:29 +0200)]
sym(4): Add __diagused to nseg of getbaddrcb()

The parameter is only used when compiling with INVARIANTS.

9 months agostd.nodebug: remove DIAGNOSTIC from debug configs
Konstantin Belousov [Fri, 18 Aug 2023 13:39:22 +0000 (16:39 +0300)]
std.nodebug: remove DIAGNOSTIC from debug configs

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 months agokern/subr_unit.c: fix non-debug build
Konstantin Belousov [Fri, 18 Aug 2023 13:36:06 +0000 (16:36 +0300)]
kern/subr_unit.c: fix non-debug build

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 months agovm_map.c: fix syntax
Konstantin Belousov [Fri, 18 Aug 2023 13:35:25 +0000 (16:35 +0300)]
vm_map.c: fix syntax

Fixes: c718009884b3d65528deaff24712cbf98e3be656
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 months agosctp: cleanup cdefs.h include
Michael Tuexen [Fri, 18 Aug 2023 13:25:34 +0000 (15:25 +0200)]
sctp: cleanup cdefs.h include

9 months agosctp: whitespace change to improve consistency
Michael Tuexen [Fri, 18 Aug 2023 13:06:23 +0000 (15:06 +0200)]
sctp: whitespace change to improve consistency

MFC after: 1 week

9 months agosctp: unbreak congestion control dtrace support
Michael Tuexen [Fri, 18 Aug 2023 13:01:35 +0000 (15:01 +0200)]
sctp: unbreak congestion control dtrace support

Fix a typo and improve consistency of handling variables only used
when compiling with dtrace support.

MFC after: 1 week

9 months agolinux(4): Remove sys/cdefs.h inclusion under x86/linux due to 685dc743
Dmitry Chagin [Fri, 18 Aug 2023 12:58:32 +0000 (15:58 +0300)]
linux(4): Remove sys/cdefs.h inclusion under x86/linux due to 685dc743

9 months agolinux(4): Remove include of sys/types.h from linux_vdso.h
Dmitry Chagin [Fri, 18 Aug 2023 12:58:32 +0000 (15:58 +0300)]
linux(4): Remove include of sys/types.h from linux_vdso.h

Due to sys/param.h includes sys/types.h and the fact that the sys/param.h
is included everywhere where linux_vdso.h is needed.

9 months agolinux(4): Follow style(9), don't include both sys/param.h and sys/types.h
Dmitry Chagin [Fri, 18 Aug 2023 12:58:32 +0000 (15:58 +0300)]
linux(4): Follow style(9), don't include both sys/param.h and sys/types.h

9 months agovm_map.c: plug several more places which might modify entry->offset
Konstantin Belousov [Tue, 15 Aug 2023 19:05:33 +0000 (22:05 +0300)]
vm_map.c: plug several more places which might modify entry->offset

for the GUARD entries protecting stacks gaps.

syzkaller: https://syzkaller.appspot.com/bug?extid=c325d6a75e4fd0a68714
Reviewed by: dougm, markj (previous version)
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41475

9 months agosff: Add SFP driver (fdt-based draft)
Dmitry Salychev [Fri, 18 Aug 2023 09:17:31 +0000 (11:17 +0200)]
sff: Add SFP driver (fdt-based draft)

This basic version of the driver obtains properties of the "sff,sfp"
compatible devices and implements a simple interface to provide an I2C
bus device for the rest of the drivers (e.g. to implement SIOCGI2C).

Both of the interface and driver are subjects for a further
generalization to be used in case of non-FDT and non-arm64 platforms.

Reviewed by: bz, manu
Approved by: bz (mentor)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D41440

9 months agolinprocfs(5): Follow style(9), sort includes
Dmitry Chagin [Fri, 18 Aug 2023 10:12:02 +0000 (13:12 +0300)]
linprocfs(5): Follow style(9), sort includes

9 months agolinprocfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743
Dmitry Chagin [Fri, 18 Aug 2023 10:12:02 +0000 (13:12 +0300)]
linprocfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743

9 months agolinsysfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743
Dmitry Chagin [Fri, 18 Aug 2023 10:12:02 +0000 (13:12 +0300)]
linsysfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743

9 months agolinux(4): Follow style(9), include sys/systm.h after sys/param.h
Dmitry Chagin [Fri, 18 Aug 2023 10:12:02 +0000 (13:12 +0300)]
linux(4): Follow style(9), include sys/systm.h after sys/param.h

9 months agolinux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743
Dmitry Chagin [Fri, 18 Aug 2023 10:12:02 +0000 (13:12 +0300)]
linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743

9 months agolinuxkpi math: fix kassert in math64.h
Doug Moore [Fri, 18 Aug 2023 05:31:03 +0000 (00:31 -0500)]
linuxkpi math: fix kassert in math64.h

Include <sys/systm.h> in math64.h, so that KASSERT and bool are
defined, to allow compilation to succeed after
b80ea452375f52a3ab7d82a9aef10da0d89985d9 and dabbbebcb0f5...

9 months agoUpdate `make delete-old`
Enji Cooper [Fri, 18 Aug 2023 12:15:14 +0000 (05:15 -0700)]
Update `make delete-old`

This change updates `make delete-old` to account for files installed by the
following options:
- MK_BSDINSTALL
- MK_DMAGENT
- MK_EXAMPLES
- MK_SENDMAIL

MFC after: 2 weeks

9 months agolinuxkpi: fix buildkernel after b80ea452375f
Kyle Evans [Fri, 18 Aug 2023 05:12:37 +0000 (00:12 -0500)]
linuxkpi: fix buildkernel after b80ea452375f

Unbalanced parentheses broke the build; re-balance.

Fixes: b80ea452375f ("LinuxKPI: implement mul_u64_u64_div_u64()")

9 months agoUse proper convention for relative path linking
Enji Cooper [Fri, 18 Aug 2023 11:13:06 +0000 (04:13 -0700)]
Use proper convention for relative path linking

The change made in e835ee68e13361b841c983fa4a49dd6c19dcdec4 did not
follow the convention for relative path symlinks. Per the convention,
paths be prefixed with `${BINDIR}`, not `/bin/`. `${BINDIR}` can be
modified from the Makefile, on the command line, or in the
environment. This convention is the canonically correct way to do
things.

This follows the convention used in `bin/pkill/Makefile`,
`bin/timeout/Makefile`, etc.

MFC after: 1 week
MFC with: f05948d4e98d3abd0965a2994e9e42add6908ff3
MFC with: e835ee68e13361b841c983fa4a49dd6c19dcdec4
Requested by: jrtc27, kevans

9 months agokern: osd: stop downsizing arrays when the last slot deregisters
Kyle Evans [Fri, 18 Aug 2023 04:05:55 +0000 (23:05 -0500)]
kern: osd: stop downsizing arrays when the last slot deregisters

It was noted in D41404 that these reallocations aren't actually
guaranteed to succeed, despite assertions to the contrary.  We're
talking relatively small allocations, so just free up the individual
slot to be reused later as needed.

Note that this doesn't track the last active slot as of this moment, but
this could be done later if we find it's worth the complexity for what
little that would allow to be optimized (osd_call, slightly).

While we're here, fix the debug message that indicates which slot we
just allocated when we find an unused one; the slot # is actually one
higher than the index.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41409

9 months agofwget: fix installing multiple firmware files
Bjoern A. Zeeb [Tue, 15 Aug 2023 20:29:03 +0000 (20:29 +0000)]
fwget: fix installing multiple firmware files

Remove quotes around the list of packages to install.
Otherwise pkg is only fed one argument which results in a
non-working solution:
pkg: No packages available to install matching 'wifi-firmware-ath10k-kmod wifi-firmware-mt76-kmod wifi-firmware-ath11k-kmod' have been found in the repositories

MFC after: 10 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41474

9 months agoLinuxKPI: implement mul_u64_u64_div_u64()
Bjoern A. Zeeb [Tue, 16 May 2023 20:55:00 +0000 (20:55 +0000)]
LinuxKPI: implement mul_u64_u64_div_u64()

Implement mul_u64_u64_div_u64() for an updated iwlwifi driver (though
we do not yet use it there; it is used for in-kernel ptp on wifi).

Sponsored by: The FreeBSD Foundation
Submitted by: cperciva
MFC after: 10 days
Reviewed by: cperciva, dwmalone
Differential Revision: https://reviews.freebsd.org/D40120

9 months agoRemove confDH_PARAMETERS settings in favor of using sendmail's built-in
Gregory Neil Shapiro [Fri, 18 Aug 2023 00:32:56 +0000 (00:32 +0000)]
Remove confDH_PARAMETERS settings in favor of using sendmail's built-in
default which was added in sendmail 8.15.2 (the config line predates
that 8.15.2 feature).  This also alleviates the need for admins
to create the DH parameters file if they opt to use Diffie-Hellman.

PR: 248387
MFC after: 2 weeks

9 months agorelease: update main to ALPHA2
Glen Barber [Fri, 18 Aug 2023 00:08:32 +0000 (20:08 -0400)]
release: update main to ALPHA2

Due to an issue being investigated, the branch of stable/14 will
be delayed a week.  This should not impact the rest of the schedule
for this cycle.

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd