Commit Graph

285928 Commits

Author SHA1 Message Date
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
Colin Percival
5f3587169a 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
2023-08-19 22:04:55 -07:00
Colin Percival
79fafc0974 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
2023-08-19 22:04:55 -07:00
Stephen J. Kiernan
332af8c25d 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.
2023-08-19 20:05:45 -04:00
Xin LI
b37eb25116 Vendor import of zlib 1.3. 2023-08-19 14:55:24 -07:00
Dmitry Chagin
a129642ced linux(4): Fix linker warning about undefined vdso symbols
Pointed out by:		bz
MFC after:		3 days
2023-08-20 00:48:36 +03:00
Dmitry Chagin
4f9fac78d4 linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfile
MFC after:		1 month
2023-08-19 21:55:23 +03:00
Dmitry Chagin
da5a6738d5 linux(4): Allow in fd to be a socket in sendfile
In this case sendfile fallback is used.

MFC after:		1 month
2023-08-19 21:55:23 +03:00
Michael Tuexen
1095da7503 sctp: fix a warning
Fix an unused-but-set-variable warning for builds without INVARIANTS.

Reported by:	O. Hartmann
MFC after:	1 week
2023-08-19 13:24:02 +02:00
Michael Tuexen
4f14d4b6b7 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
2023-08-19 12:35:49 +02:00
Peter Holm
0d30f3afa6 stress2: No need to write to the console. Add revision to log string 2023-08-19 09:29:09 +02:00
Peter Holm
f322816aaf stress2: Added a syzkaller reproducer 2023-08-19 09:28:10 +02:00
Bjoern A. Zeeb
e039b38d46 LinuxKPI: skbuff: add skb_cow_head()
Add dummy implementation of skb_cow_head().

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-08-19 04:55:56 +00:00
Bjoern A. Zeeb
149c457de1 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
2023-08-19 04:53:00 +00:00
Ed Maste
d8bb58586d Cirrus-CI: restore amd64-gcc12 build/test on main
The Cirrus-CI log length issue was addressed by commit 5f72ceb2c5
("Cirrus-CI: for *-gcc12, build world with make -s"), and the failure
itself by commit 0c785f0602 ("Fix GoogleTest 1.14.0 import").

This reverts commit 0ed2e7e889.

Reported by:	Jose Luis Duran
Sponsored by:	The FreeBSD Foundation
2023-08-18 22:35:39 -04:00
Dag-Erling Smørgrav
2ba1d4970a 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
2023-08-19 01:44:58 +00:00
Mateusz Guzik
64e881f2db vfs: track how many times vn_alloc blocked on hitting the vnode limit 2023-08-18 23:56:58 +00:00
Ed Maste
57a3b81785 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
2023-08-18 16:15:48 -04:00
John Baldwin
5aacf339f6 sys: Remove SND_DECLARE_FILE
Reviewed by:	kbowling, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41499
2023-08-18 13:05:12 -07:00
John Baldwin
cbe53bd975 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
2023-08-18 13:04:33 -07:00
Enji Cooper
0c785f0602 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:	28f6c2f292
2023-08-18 19:33:58 -07:00
Ed Maste
e5e6a86535 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
2023-08-18 14:56:22 -04:00
Bartosz Sobczak
01fbb86991
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
2023-08-18 11:28:58 -07:00
Graham Perrin
edacf4b482 UPDATING: fix a typo, adjust a white space
From:

> … chagned.  boot0sio …

to:

> … changed. boot0sio …

Fixes: 4722ceb7d5 Use 115200 bps by default for serial communication
2023-08-18 17:55:25 +01:00
Konstantin Belousov
04f683b25a subr_unit.c: another attempt to fix the build
Reported by:	cy
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-18 19:28:42 +03:00
Marius Strobl
ae6d496358 sym(4): Add __diagused to nseg of getbaddrcb()
The parameter is only used when compiling with INVARIANTS.
2023-08-18 16:33:27 +02:00
Konstantin Belousov
4318843250 std.nodebug: remove DIAGNOSTIC from debug configs
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-18 16:39:22 +03:00
Konstantin Belousov
1384a0b940 kern/subr_unit.c: fix non-debug build
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-18 16:37:16 +03:00
Konstantin Belousov
5f452214f2 vm_map.c: fix syntax
Fixes:	c718009884
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-08-18 16:37:16 +03:00
Michael Tuexen
c3179e6660 sctp: cleanup cdefs.h include 2023-08-18 15:25:34 +02:00
Michael Tuexen
e416c81923 sctp: whitespace change to improve consistency
MFC after:	1 week
2023-08-18 15:06:23 +02:00
Michael Tuexen
fb259f62bb 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
2023-08-18 15:01:35 +02:00
Dmitry Chagin
0541653520 linux(4): Remove sys/cdefs.h inclusion under x86/linux due to 685dc743 2023-08-18 15:58:32 +03:00
Dmitry Chagin
110be11ac9 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.
2023-08-18 15:58:32 +03:00
Dmitry Chagin
2be88e2cca linux(4): Follow style(9), don't include both sys/param.h and sys/types.h 2023-08-18 15:58:32 +03:00
Konstantin Belousov
c718009884 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
2023-08-18 15:43:35 +03:00
Dmitry Salychev
2a9021898c
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
2023-08-18 12:40:11 +02:00
Dmitry Chagin
7bbdcdc9b7 linprocfs(5): Follow style(9), sort includes 2023-08-18 13:12:02 +03:00