Commit graph

288683 commits

Author SHA1 Message Date
Stefan Eßer aa339f1d5d vendor/bc: upgrade to version 6.7.2
This update improves the implementation of the power function p() and
adds 3 new functions to the extended math library: min(), max(), and
i2rand().

(cherry picked from commit 0b4a06ab29a0da80f6cb5c99189054cb8e2f756c)
2024-01-10 17:34:49 +01:00
Yoshihiro Takahashi 1fa4ddcc6d periodic: Fix periodic reports when log files are not compressed.
The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR:		253168
Reviewed by:	delphij
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43357
2024-01-10 20:48:56 +09:00
Martin Matuska f552d7adeb zfs: merge openzfs/zfs@a382e2119
Notable upstream pull request merges:
 #15693 a382e2119 Add Gotify notification support to ZED
 #15732 e78aca3b3 Fix livelist assertions for dedup and cloning
 #15733 7ecaa0758 make zdb_decompress_block check decompression reliably
 #15735 255741fc9 Improve block sizes checks during cloning

Obtained from:	OpenZFS
OpenZFS commit:	a382e21194
2024-01-10 09:18:25 +01:00
Michael Tuexen 13720136fb tcpsso: fix when used without -i option
Since fdb987bebd it is not possible anymore to use inp_next
iterator for bound, but unconnected sockets. This applies
to TCP listening sockets. Therefore the metioned commit broke
tcpsso on listening sockets if the -i option was not used.
Fix this by iterating through all endpoints instead of only
through the bound, but unconnected ones.

Reviewed by:		markj
Fixes:			fdb987bebd ("inpcb: Split PCB hash tables")
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43353
2024-01-10 08:33:09 +01:00
David E. O'Brien dafd0d6855 History for arc4random_*() 2024-01-09 22:09:47 -08:00
Gleb Smirnoff 8338ea1d3c tests/netlink: add minimal test for a group writer
Subscribe a socket for RTNLGRP_IPV4_ROUTE announcements, add & delete
a route and check that announcements came in.
2024-01-09 16:56:51 -08:00
Brooks Davis 13f345cdec powerpc64/SYS.h: implement _SYSCALL_BODY() macro
Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and
calls cerror as required.  Use to implement PSEUDO() and RSYSCALL().

Reviewed by:	jhibbits
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D43322
2024-01-09 22:59:29 +00:00
Brooks Davis 8e2c2992da socket_msg_trunc: allocate a large enough buffer
Allocate 9000 bytes to match the largest requsted size.  Add a check to
prevent the list of sizes and buffer size from getting out of sync
again.

Reviewed by:	markj
Found with:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D43340
2024-01-09 22:59:29 +00:00
Marius Strobl f221d35be7 igb(4): Remove disconnected SYSCTL
The global hw.igb.rx_process_limit knob never was adhered to by the
in-tree version of this driver but similar functionality is available
via the device-specific dev.igb.N.iflib.rx_budget.

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.
2024-01-09 23:15:44 +01:00
Marius Strobl 0d6d28ce56 e1000(4): Remove disconnected SYSCTL
The global hw.em.rx_process_limit knob has been replaced by the device-
specific dev.IF.N.iflib.rx_budget along with the conversion to iflib(4).

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.
2024-01-09 23:15:44 +01:00
Navdeep Parhar 9ea86c8f67 cxgbe(4): Use the correct size for the CIM LA on the T6.
The logic analyzer in the T6 CIM block has a different capture size than
previous chips.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-01-09 13:27:00 -08:00
Andrew Gallatin 5cd08d9ecf apei: Mark ReadAckRegister resource as shareable
Work around vendors who use the same address for multiple
ReadAckRegisters in their ACPI HEST table.  This
allows apei to attach cleanly on Ampere Altra servers.
Note the issue is not specific to Ampere, I've run into
it with at least one other vendor (whose server is not
yet released).

Sponsored by: Netflix
Reviewed by: jhb
2024-01-09 16:07:34 -05:00
Gleb Smirnoff 09fa78d438 netlink: fix regression with group writers
Refactoring of argument list to nl_send_one() led to derefercing
wrong union member.  Rename nl_send_one() to a more generic name,
isolate anew nl_send_one() as the callback only for the normal
writer and provide correct argument to nl_send() from nl_send_group().

Fixes:	ff5ad900d2
2024-01-09 13:01:28 -08:00
Robert Wing 0013741108 powerpc_mmu_radix: add leaf page for wired mappings when pmap_enter(psind=1)
This applies the fix to powerpc's pmap as was done in commit aa3bcaad51
and d0941ed9b5 for amd64 and riscv pmaps, respectively.

Reported by:    Jenkins
Reviewed by:	bojan.novkovic_fer.hr, markj
Fixes: e4078494f3
Differential Revision:	https://reviews.freebsd.org/D43339
2024-01-09 11:23:18 -09:00
John Baldwin c6a488511a acpi: Only reserve resources enumerated via _CRS
In particular, don't reserve resources added by drivers via other
means (e.g. acpi_bus_alloc_gas which calls bus_alloc_resource
right after adding the resource).

The intention of reserved resources is to ensure that a resource range
that a bus driver knows is assigned to a device is reserved by the
system even if no driver is attached to the device.  This prevents
other "wildcard" resource requests from conflicting with these
resources.  For ACPI, the only resources the bus driver knows about
for unattached devices are the resources returned from _CRS.  All of
these resources are already reserved now via acpi_reserve_resources
called from acpi_probe_children.

As such, remove the logic from acpi_set_resource to try to reserve
resources when they are set.  This permits RF_SHAREABLE to work with
acpi_bus_alloc_gas without requiring hacks like the current one for
CPU device resources in acpi_set_resource.

Reported by:	gallatin (RF_SHAREABLE not working)
Diagnosed by:	jrtc27
2024-01-09 11:23:10 -08:00
John Baldwin a9b6151206 memdesc: Helper function to construct mbuf chain backed by memdesc buffer
memdesc_alloc_ext_mbufs constructs a chain of external (M_EXT or
M_EXTPG) mbufs backed by a data buffer described by a memory
descriptor.

Since memory descriptors are not an actual buffer just a description
of a buffer, the caller is required to supply a couple of helper
routines to manage allocation of the raw mbufs and associating them
with a reference to the underlying buffer.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D42933
2024-01-09 11:09:43 -08:00
John Baldwin 8cb9b68f58 sys: Use mbufq_empty instead of comparing mbufq_len against 0
Reviewed by:	bz, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43338
2024-01-09 11:00:46 -08:00
John Baldwin 76f405ed63 mbuf: Add mbufq_empty
Complement to the existing mbufq_full

Reviewed by:	bz
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43337
2024-01-09 11:00:19 -08:00
John Baldwin 6977311633 net80211 amdpu: Simplify a few loops that drain an mbufq
These loops already handled a NULL return from mbufq_dequeue when the
queue was empty, so remove a redundant check of mbufq_len before
dequeueing.

Reviewed by:	bz
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43336
2024-01-09 10:59:48 -08:00
John Baldwin 6631e2f9b4 kldxref: Workaround incorrect PT_DYNAMIC in existing powerpc kernels
Existing powerpc kernels include additional sections beyond .dynamic
in the PT_DYNAMIC segment.  Relax the requirement for an exact size
match of the section and segment for PowerPC files as a workaround.

Reported by:	jrtc27
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D43123
2024-01-09 10:57:48 -08:00
Michael Gmelin 731704f5ea bsdinstall: Fix installation script splitting
This allows writing setup scripts that contain lines starting with
"#!", e.g., a shebang when creating a shell script using cat:

    #!/bin/sh
    echo "Populate rc.local"
    cat >/etc/rc.local<<EOF
    #!/bin/sh
    echo booted | logger -s -t 'example'
    EOF

Prevent accidentally running a setup script left behind by a
previous invocation of bsdinstall.

Reviewed by:	imp, jrtc27
Differential Revision:	https://reviews.freebsd.org/D43350
2024-01-09 19:14:17 +01:00
gofaster a382e21194
Add Gotify notification support to ZED
This commit adds the zed_notify_gotify() function and hooks it
into zed_notify(). This will allow ZED to send notifications
to a self-hosted Gotify service, which can be received
on a desktop or mobile device. It is configured with ZED_GOTIFY_URL,
ZED_GOTIFY_APPTOKEN and ZED_GOTIFY_PRIORITY variables in zed.rc.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: gofaster <felix.gofaster@gmail.com>
Closes #15693
2024-01-09 09:49:30 -08:00
Alexander Motin e78aca3b33
Fix livelist assertions for dedup and cloning
Two block pointers in livelist pointing to the same location may
be caused not only by dedup, but also by block cloning. We should
not assert D bit set in them.

Two block pointers in livelist pointing to the same location may
have different logical birth time in case of dedup or cloning. We
should assert identical physical birth time instead.

Assert identical physical block size between pointers in addition
to checksum, since that is what checksums are calculated on.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15732
2024-01-09 09:48:40 -08:00
Alexander Motin 255741fc97
Improve block sizes checks during cloning
- Fail if source block is smaller than destination.  We can only
grow blocks, not shrink them.
 - Fail if we do not have full znode range lock.  In that case grow
is not even called.  We should improve zfs_rangelock_cb() somehow
to know when cloning needs to grow the block size unlike write.
 - Fail of we tried to resize, but failed.  There are many reasons
for it to fail that we can not predict at this level, so be ready
for them.  Unlike write, that may proceed after growth failure,
block cloning can't and must return error.

This fixes assertion inside dmu_brt_clone() when it sees different
number of blocks held in destination than it got block pointers.
Builds without ZFS_DEBUG returned EXDEV, so are not affected much.

Reviewed-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15724 
Closes #15735
2024-01-09 09:46:43 -08:00
Kent Ross 7ecaa07580
make zdb_decompress_block check decompression reliably
This function decompresses to two buffers and then compares them to
check whether the (opaque) decompression process filled the whole
buffer. Previously it began with lbuf uninitialized and lbuf2 filled
with pseudorandom data. This neither guarantees that any bytes not
written by the compressor would be different, nor seems incredibly
sound otherwise!

After these changes, instead of filling one buffer with generated
pseudorandom data we overwrite each buffer with completely different
data. This should remove the possibility of low-probability failures,
as well as make the process simpler and cheaper.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Kent Ross <k@mad.cash>
Closes #15733
2024-01-09 09:13:52 -08:00
Dag-Erling Smørgrav c2356a440d asa: Rewrite to fix line termination issue.
The standard is somewhat unclear, but on the balance, I believe that the
phrase “the rest of the input line” should be interpreted to mean the
rest of the input line including the terminating newline if and only if
there is one.  This means the current implementation is incorrect on two
points:

- First, it suppresses the previous line's newline in the '1' case.

- Second, it unconditionally emits a newline at the end of the output
  for non-empty input, even if the input did not end with a newline.

Resolve this by rewriting the main loop.  Instead of special-casing the
first line and then assuming that every line ends with a newline, we
remember how each line ends and emit that either at the beginning of
the next line or at the end of the file except in the one case ('+')
where the standard explicitly says not to.

While here, try to reduce diff to upstream a little and update their
RCS tag to reflect the fact that while we've diverged significantly
from them, we've incorporated all their changes.  Remove the useless
second RCS tag.

We also update the tests to account for the change in interpretation
of the '1' case and add a test case for unterminated input.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43326
2024-01-09 17:27:15 +01:00
Ruslan Bukin ddf7fbbb57 Intel FPGA: Support programming larger bitfiles.
Issue data claim command after every chunk of data programmed,
so we can reuse the SVC buffer for the next chunk.

Tested on Terasic DE10 Pro.

Sponsored by: UKRI
2024-01-09 14:18:53 +00:00
Olivier Certner 15bb0300ee
libhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc()
Using calloc() instead of malloc() is useless here since the allocated
memory is to be wholly crushed by the memcpy() call that follows.

Suggested by:           kib
Reviewed by:            emaste, kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D43328
2024-01-09 14:29:26 +01:00
Olivier Certner 4d312aa051
libthr: thr_attr.c: More style and clarity fixes
The change of argument for sizeof() (from a type to an object) is to be
consistent with the change done for the malloc() code just above in the
preceding commit touching this file.

Consider bit flags as integers and test whether they are set with an
explicit comparison with 0.

Use an explicit flag value (PTHREAD_SCOPE_SYSTEM) in place of a variable
that has this value at point of substitution.

All other changes are straightforward.

Suggested by:           kib
Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D43327
2024-01-09 14:29:25 +01:00
Daniel Ebdrup Jensen 45486372ca nfsv4(4): Reflow lines to 80 character limit
In belatedly fixing a mistake made in fbbdfa2b8a, I noticed that igor
and mandoc -Tlint had a few more things to say.

As such, I'm reflowing a few lines and fixing a contraction.

MFC with:	fbbdfa2b8a
2024-01-09 12:14:57 +01:00
Daniel Ebdrup Jensen c925f0720f nfsv4(4): Belatedly bump .Dd
I forgot to do it when making the commit, so hat-tip to asomers@

Reported by:	asomers@
Fixes:		fbbdfa2b8a (nfsv4(4): mention the nfsv4_server_only..)
MFC with:	fbbdfa2b8a
2024-01-09 12:14:56 +01:00
Peter Holm bd9ddbc9cd stress2: Remove useless test scenario 2024-01-09 11:31:05 +01:00
Peter Holm f1bc2f67a3 stress2: Reduce idle time. Remove debug output 2024-01-09 11:28:26 +01:00
Kyle Evans 5d1ecf0b61 build: only inspect the first word of toolchain tools
CC/CXX/CPP/LD may all have arguments supplied in various circumstances,
which break the logic here.  We only need to determine which of these
tools we're expecting to invoke from PATH, which just requires
examination of the first word.  Limit our scope to exactly that.

Patch suggested by:	jrtc27
Reviewed by:		imp, jrtc27
Differential Revision:	https://reviews.freebsd.org/D43372
2024-01-08 22:22:25 -06:00
Kyle Evans cef5e56f3f bhyveload: add CAP_SEEK to our dirfd rights
In the case of hostbase_fd, this is infact a bug fix; we have a seek
callback that the host: filesystem may use in loader, and we really
don't have a good excuse to break it.

bootfd-derived fds will only be used with fdlopen(3) and rtld doesn't
seem to need pread / lseek at all for it today, but there's no reason to
break if it finds a good reason to later.

Suggested by:	markj
2024-01-08 21:08:16 -06:00
Gleb Smirnoff 59ce044a78 sockets: on shutdown(2) do sorflush() only in case of generic sockbuf
This is a quick plug to fix panic with Netlink which has protocol specific
buffers.  Note that PF_UNIX/SOCK_DGRAM, which also has its own buffers,
avoids the panic due to being SOCK_DGRAM.  A correct but more complicated
fix that needs to be done is to merge pr_shutdown, pr_flush and dom_dispose
into one protocol method that may call sorflush for generic sockets or do
their own stuff for protocol which has own buffers.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D43367
Reported-by: syzbot+a58e1615881c01a51653@syzkaller.appspotmail.com
2024-01-08 17:20:31 -08:00
Gleb Smirnoff af9f4ac57a netlink: just return EOPNOTSUPP on shutdown(2)
This matches what Linux does.

Reviewed by:		melifaro, tuexen
Differential Revision:	https://reviews.freebsd.org/D43366
2024-01-08 17:20:30 -08:00
Jose Luis Duran bd3f90c0c1
zpoolprops.7: Remove unnecessary .Ns
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
Closes #15727
2024-01-08 17:03:15 -08:00
John Baldwin 78258ee013 kldxref: Correct contract number in license ACK
Reviewed by:	brooks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D43371
2024-01-08 17:01:05 -08:00
Alexander Motin 9e0d12e310
ZIL: Update Linux tracing after #15635
While picking parts from #14909 I've missed Linux tracing specific
ones, that went unnoticed in default configurations, but breaks the
build in some.

Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15730
2024-01-08 16:49:39 -08:00
Shengqi Chen 7b89149c9f
Linux 6.2 compat: add check for kernel_neon_* availability
This patch adds check for `kernel_neon_*` symbols on arm and arm64
platforms to address the following issues:

1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
   license compatibility must be checked before use.
2. On both arm and arm64, the definitions of these symbols are guarded
   by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
   present. Checking in configuration phase only leads to MODPOST
   errors (undefined references).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #15711 
Closes #14555 
Closes: #15401
2024-01-08 16:05:24 -08:00
Navdeep Parhar df8a58b17a cxgbe(4): Add support for netmap offsets.
PR:		253069
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-01-08 12:04:07 -08:00
Ed Maste 20010b86fe netlink: Add sysctl descriptions for net.netlink tree
Reviewed by:	markj, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43368
2024-01-08 14:31:31 -05:00
Richard Scheffenegger 429f14f83a tcp: clean PRR state after ECN congestion recovery.
PRR state was not properly reset on subsequent ECN CE
events. Clean up after local transmission failures too.

Reviewed by:           tuexen, cc, #transport
MFC after:             3 days
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43170
2024-01-08 10:53:04 +01:00
Richard Scheffenegger f4574e2dc5 tcp: prevent spurious empty segments and fix uncommon panic
Only try sending more data on pure ACKs when there is
more data available in the send buffer.

In the case of a retransmitted SYN not being sent due to
an internal error, the snd_una/snd_nxt accounting could
be off, leading to a panic. Pulling snd_nxt up to snd_una
prevents this from happening.

Reported by:           fengdreamer@126.com
Reviewed by:           cc, tuexen, #transport
MFC after:             1 week
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43343
2024-01-08 10:52:49 +01:00
Kyle Evans a4a838a31a bhyveload: make error printing consistent
Previously we used a mix of perror(3) + exit(3) and err(3); standardize
on the latter instead.  This does remove one free() in an error path,
because we're decidedly leaking a lot more than just the loader name
there (loader handle, vcpu, vmctx...) anyways.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43331
2024-01-08 11:49:40 -06:00
Tom Hukins ba719a0fec Fix "version introduced" in numerous manual pages
MFC after:	1 week
Pull request:	https://github.com/freebsd/freebsd-src/pull/853
2024-01-08 11:35:16 -05:00
Wolfram Schneider 1e82d882ed fix using man(1) with multiple pages
PR: 275978
Reported by: Mohamed Akram
Fixes: 789480702e
MFC after: 1 week
2024-01-08 16:05:50 +00:00
Bjoern A. Zeeb c8e7f78a3d ath10k/rtw89: make compile again after LinuxKPI changes
Both drivers are not yet attached to the build so this change is
for people currently trying them out.

In 96ab16ebab the sys/rman.h include
was removed.  In various wireless drivers we prefer to directly use
bus_dma functions rather than io* LinuxKPI once.  In order to cast
the pointer we need sys/rman.h back for our native 'struct resource'
in their pci.c implementations.
Long-term we should consider providing some lkpi_-FreeBSD-specific
wrapper functions to avoid this problem.

MFC after:	3 days
2024-01-08 15:38:22 +00:00
Bjoern A. Zeeb 118d0ff54d rtw89: improve debugging and fix a sleep issue
Improve log messages to be more helpful in error cases.
Change one LinuxKPI sleep function as we cannot call the original
one from a context we cannot sleep.
Both cases were hit during testing.

MFC after:	3 days
2024-01-08 15:38:22 +00:00