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.
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.
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.
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.
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.
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.
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.
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").
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.
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.
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
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.
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
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.
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.
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
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.
Ed Maste [Mon, 14 Aug 2023 16:56:12 +0000 (12:56 -0400)]
msi: handle error from BUS_REMAP_INTR in msi_assign_cpu
Previously errors from BUS_REMAP_INTR were silently ignored, and we
ended up with non-functional interrupts.
Now we allocate and enable new vectors, but postpone assignment of new
APIC IDs and vectors where we can, until after BUS_REMAP_INTR is
successful. We then disable and free the old vectors.
If BUS_REMAP_INTR fails we restore the old configuration, and disable
and free the new, unused vectors.
Thanks to AMD for providing hardware (with APIC IDs above 255) for
testing.
Reviewed by: jhb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41455
Mark Johnston [Thu, 17 Aug 2023 18:49:54 +0000 (14:49 -0400)]
vmm: Fix VM_GET_CPUS compatibility
bhyve in a 13.x jail fails to boot guests with more than one vCPU
because they pass too small a buffer to VM_GET_CPUS, causing the ioctl
handler to return ERANGE. Handle this the same way as cpuset system
calls: make sure that the result can fit in the truncated space, and
relax the check on the cpuset buffer.
As a side effect, fix an insufficient bounds check on "size". The
signed/unsigned comparison with sizeof(cpuset_t) fails to exclude
negative values, so we can end up allocating impossibly large amounts of
memory.
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41496
Elliott Mitchell [Fri, 20 Jan 2023 02:24:32 +0000 (18:24 -0800)]
intr: merge interrupt table uses of MAXCOMLEN into INTRNAME_LEN
The repeated uses of `MAXCOMLEN + 1` seem a bit hazardous. If there was
a future need to change the size, the repeats will be troublesome.
Merge everything into `#define INTRNAME_LEN` (matches the name used by
INTRNG).
Elliott Mitchell [Sun, 19 Jun 2022 15:05:20 +0000 (08:05 -0700)]
intr: move MAX_STRAY_LOG to interrupt.h
The two interrupt controllers which implement squelching of reports
after a maximum use the same limit. Move the limit to interrupt.h, the
better to encourage other interrupt controllers to implement the same.
James McLaughlin [Thu, 17 Aug 2023 19:57:17 +0000 (22:57 +0300)]
linux(4): Add sendfile fallback for non-socket fds
Before Linux 2.6.33, out_fd must refer to a socket. Since Linux 2.6.33
it can be any file.
The patch was originally provided by James McLaughlin and adapted by me
for copy_file_range.
Marius Strobl [Wed, 16 Aug 2023 16:49:34 +0000 (18:49 +0200)]
iflib drivers: Constify PCI ID LUTs
Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.
John Baldwin [Thu, 17 Aug 2023 18:30:50 +0000 (11:30 -0700)]
bhyve: Store the FreeBSD OUI in little-endian in the controller data
Section 7.10.3 of the NVME 1.4b specification states that the IEEE OUI
in the identify controller structure is stored in little-endian format
(unlike the embedded OUI in EUI64 identifiers).
Ed Maste [Thu, 17 Aug 2023 17:43:39 +0000 (13:43 -0400)]
share/examples: clarify BOOT_COMCONSOLE_SPEED
Give an example of why one may want to override BOOT_COMCONSOLE_SPEED so
that it's clear why the default (in a comment) and the commented-out
example setting have different values.
Reported by: otis Fixes: 4722ceb7d53e ("Use 115200 bps by default for serial communication")
Mateusz Pacuszka [Thu, 17 Aug 2023 11:30:54 +0000 (13:30 +0200)]
ixl: fix multicast filters handling
Summary:
Hardware supports up to 128 entries of multicast filters. If there is more,
filters should be removed and multicast promiscuous enabled. In case
user deletes the multicast address and overall count is less than 128,
multicast promiscuous mode should be disabled and all the filters
reapplied into the HW.
Currently driver only enables multicast promiscuous mode and deletes
the entries without any information to the user and it's not capable of
reapplying the filters once count is less than 128.
Address that by:
1. Add logging
2. Add logic in case multicast promiscuous is enabled and user lowers
the number of multicast entries to <128.
3. Fix a bug where driver removes different MAC entries along with the one
that's being deleted by the user.
Andrew Turner [Thu, 17 Aug 2023 11:26:57 +0000 (12:26 +0100)]
Add a virtio-gpu 2D driver
Add a driver to connect vt to the VirtIO GPU device in 2D mode. This
provides a output on the display when a qemu virtio gpu device is
added, e.g. with -device virtio-gpu-pci.
Tested on qemu using UTM, and a Hetzner arm64 VM instance.
Ed Maste [Wed, 16 Aug 2023 20:26:49 +0000 (16:26 -0400)]
Cirrus-CI: temporarily disable amd64-gcc12 build/test on main
The amd64-gcc12 job is failing at present. Unfortunately Cirrus-CI
appears to have a 100MB log limit and we exceed this before the error
is reported. Disable the job for now until we can address the log
length issue.
See also https://github.com/cirruslabs/cirrus-ci-docs/issues/1176.
Brooks Davis [Wed, 16 Aug 2023 18:16:51 +0000 (19:16 +0100)]
libc: regoranize malloc build
Create a stdlib/malloc to hold the definition of the malloc interface
(e.g., the Symbol.map file) and make jemalloc a subdirectory. This will
make it easier to integrate alternative allocators such as snmalloc
while making it clear that the current jemalloc symbols are the FreeBSD
API/ABI (for better or worse).