Stefan Eßer [Wed, 15 Jun 2022 09:54:13 +0000 (11:54 +0200)]
contrib/bc: merge from vendor release 5.3.3
This update fixes a build issue of release 5.3.2 on the FreeBSD base
system.
Merge commit '
3f739b0595b7d6ac4bac9aaa1cae0910f11f92e2'
MFC after: 2 weeks
Stefan Eßer [Wed, 15 Jun 2022 09:34:25 +0000 (11:34 +0200)]
vendor/bc: import version 5.3.3
This version fixes a build issue caused by the strict compiler
warnings used when building FreeBSD base system components.
Mark Johnston [Tue, 14 Jun 2022 20:37:35 +0000 (16:37 -0400)]
vm_fault: Avoid unnecessary object relocking in vm_fault_copy_entry()
Suggested by: alc
Reviewed by: alc, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35485
Mark Johnston [Tue, 14 Jun 2022 20:36:54 +0000 (16:36 -0400)]
vm_fault: Fix a racy copy of page valid bits
We do not hold the object lock or a page busy lock when copying src_m's
validity state. Prior to commit
45d72c7d7fca we marked dst_m as fully
valid.
Use the source object's read lock to ensure that valid bits are not
concurrently cleared.
Reviewed by: alc, kib
Fixes:
45d72c7d7fca ("vm_fault_copy_entry: accept invalid source pages.")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35471
Rick Macklem [Tue, 14 Jun 2022 20:35:25 +0000 (13:35 -0700)]
nfscl: Clean up the code by removing unused arguments
The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port. For FreeBSD, this argument
is always NULL, so remove it to clean up the code.
This commit gets rid of "stuff" for assorted functions
defined in nfs_clrpcops.c and called in nfs_clvnops.c.
Future commits will do the same for other functions.
This commit should not result in a semantics change.
Stefan Eßer [Tue, 14 Jun 2022 20:06:28 +0000 (22:06 +0200)]
vendor/bc: import version 5.3.2
This update restores support for suppression of the prompt with -P
when using the libedit or libreadline libraries for command line
editing and history.
John Baldwin [Tue, 14 Jun 2022 17:52:54 +0000 (10:52 -0700)]
pmcannotate: Don't increment end address passed to objdump -d.
libpmc already returns an end address that is after the end of the
last instruction of a function (on both amd64 and arm64) as the end
address written to the annotate map file is computed as the start
address of the symbol plus the size.
Adding one could result in a curious failure where an entire
function's contents in assembly was reduced instead to only the first
instruction. The reason is that when the end instruction is bumped by
one, objdump -d can append the first instruction of the next function
in its output. However, since pmcannotate concatenates all of the
objdump -d output from various functions into a single file which it
then searches to find the assembly for a given file, if this
additional trailer was earlier in the file than the full function, the
trailer was chosen to represent the entire function resulting in the
truncated listing of the function.
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D35399
John Baldwin [Tue, 14 Jun 2022 17:51:39 +0000 (10:51 -0700)]
newvers.sh: Don't use return to exit.
Commit
acfb506b3d00 replaced an exit 0 when using -V with a return
instead. FreeBSD's sh treats a return outside of a function like
exit, but this is a non-portable extension. Other Bourne shells only
permit return to be used within a function and continue execution
(possibly with a warning).
To fix, don't reuse VARS_ONLY (which is intended to be set by other
scripts before sourcing newvers.sh directly) and instead use a new
variable (VARS_ONLY_EXIT) to restore the use of exit for the
non-sourced case.
Reviewed by: emaste
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35481
John Baldwin [Tue, 14 Jun 2022 17:50:51 +0000 (10:50 -0700)]
firmware: Map '@' in filenames to '_' in symbols.
'@' is not a valid character in symbol names and can sometimes appear
in path names.
Reviewed by: imp, markj
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35480
John Baldwin [Tue, 14 Jun 2022 17:42:51 +0000 (10:42 -0700)]
rc.d/ntpd: Restart ntpd when resuming from sleep.
ntpd does not always gracefully handle clock steps during resume.
This is probably most useful in conjunction with
ntpd_sync_on_start=YES which will work around any clock skew while
suspended.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D35479
John Baldwin [Tue, 14 Jun 2022 17:35:01 +0000 (10:35 -0700)]
ktls_test: Permit an option to skip tests not using ifnet TLS.
If ktls.require_ifnet is set to true, then check the TLS offload mode
for tests sending and receiving records and skip the test if the
offload mode is not ifnet mode.
This can be used along with ktls.host to run KTLS tests against a NIC
supporting ifnet TLS and verify that expected cipher suites and
directions used ifnet TLS rather than software TLS. Receive tests may
result in a false positive as receive ifnet TLS can use software as a
fallback.
Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D35427
John Baldwin [Tue, 14 Jun 2022 17:34:51 +0000 (10:34 -0700)]
ktls_test: Permit connecting to a remote echo server for tests.
Previously ktls tests always executed over a local socket pair.
ktls.host can be set to a host to connect to with a single socket
instead. The remote end is expected to echo back any data received
(such as the echo service). The port can be set with ktls.port which
defaults to "echo".
This is primarily useful to permit testing NIC TLS offload use cases
where the traffic needs to transit the NIC.
Note that the variables must be set via
'kyua -v test_suites.FreeBSD.ktls.host=host'.
Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D35426
John Baldwin [Tue, 14 Jun 2022 17:34:38 +0000 (10:34 -0700)]
ktls_test: Add a helper function to close sockets.
Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D35425
Mitchell Horne [Tue, 14 Jun 2022 16:09:11 +0000 (13:09 -0300)]
ddb: namespacing of struct command
'command' is too generic for something specific to the kernel debugger;
change this so it is less likely to collide with local variable names.
Also rename struct command_table to struct db_command_table.
Reviewed by: markj
MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35367
Mitchell Horne [Tue, 14 Jun 2022 16:07:30 +0000 (13:07 -0300)]
modules: Only build MAC modules if options MAC is set
They are not loadable otherwise.
Reviewed by: emaste
MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35369
Mark Johnston [Tue, 14 Jun 2022 15:36:00 +0000 (11:36 -0400)]
mount: Fix an incorrect assertion in kernel_mount()
The pointer to the mount values may be null if an error occurred while
copying them in, so fix the assertion condition to reflect that
possibility.
While here, move some initialization code into the error == 0 block. No
functional change intended.
Reported by: syzkaller
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Mark Johnston [Tue, 14 Jun 2022 15:35:20 +0000 (11:35 -0400)]
vm_object: Use the vm_object_(set|clear)_flag() helpers
... rather than setting and clearing flags inline. No functional change
intended.
Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35469
Mark Johnston [Tue, 14 Jun 2022 15:34:57 +0000 (11:34 -0400)]
truss: Make control message header parsing more robust
print_cmsg() was assuming that the control message chain is well-formed,
but that isn't necessarily the case for sendmsg(2). In particular, if
cmsg_len is zero, print_cmsg() will loop forever. Check for truncated
headers and try to recover if possible.
Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35476
Mark Johnston [Tue, 14 Jun 2022 15:27:38 +0000 (11:27 -0400)]
rip6: Fix a lock order reversal in rip6_bind()
See also commit
71a1539e3783.
Reported by: syzbot+
9b461b6a07a83cc10daa@syzkaller.appspotmail.com
Reported by: syzbot+
b6ce0aec16f5fdab3282@syzkaller.appspotmail.com
Reviewed by: glebius
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35472
Mark Johnston [Tue, 14 Jun 2022 14:52:03 +0000 (10:52 -0400)]
pipe: Use a distinct wait channel for I/O serialization
Suppose a thread tries to read from an empty pipe. pipe_read() does the
following:
1. pipelock(), possibly sleeping
2. check for buffered data
3. pipeunlock()
4. set PIPE_WANTR and sleep
5. goto 1
pipelock() is an open-coded mutex; if a thread blocks in pipelock(), it
sleeps until the lock holder calls pipeunlock().
Both sleeps use the same wait channel. So if there are multiple threads
in pipe_read(), a thread T1 in step 3 can wake up a thread T2 sleeping
in step 4. Then T1 goes to sleep in step 4, and T2 acquires and
releases the pipelock, waking up T1 again. This can go on indefinitely,
livelocking the process (and potentially starving a would-be writer).
Fix the problem by using a separate wait channel for pipelock().
Reported by: Paul Floyd <paulf2718@gmail.com>
Reviewed by: mjg, kib
PR: 264441
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35415
Cy Schubert [Sun, 12 Jun 2022 19:02:47 +0000 (12:02 -0700)]
rc.d/wpa_supplicant: Remove the sleep to improve boot time
bapt@ had discovered a noticeable boot improvement without the sleep.
Without the sleep does not affect warm or cold boot however a
service netif restart may cause dhclient to spend a few extra seconds
to rerequest the DHCP request.
Reported by: bapt
Reviewed by: bapt
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D35457
Mitchell Horne [Mon, 13 Jun 2022 13:21:18 +0000 (10:21 -0300)]
Remove mips-specific Makefiles for /sbin and /usr/sbin
They are no longer needed, but were likely missed simply because they
don't show up in a grep for 'mips'.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D35475
Konstantin Belousov [Fri, 10 Jun 2022 11:35:45 +0000 (14:35 +0300)]
null_vptocnp(): busy nullfs mp instead of refing it
null_nodeget() needs a valid mount point data, otherwise we might
race and dereference NULL.
Using MBF_NOWAIT makes non-forced unmount non-transparent for
vn_fullpath() over nullfs, but we make no guarantee that fullpath
calculation succeeds anyway.
Reported and tested by: pho
Reviewed by: jah
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35477
Doug Moore [Tue, 14 Jun 2022 05:47:22 +0000 (00:47 -0500)]
iommu_gas: use to first-fit search for lowermatch
Reverse the order of the search for a free space in lowermatch, to
make it a first-fit search. Iommu_gas_match_one always allocates from
the beginning of the free gap discovered from searching the tree, so
the current code isn't really allocating in a reverse first-fit
anyway, and making the search first-fit reduces the number of iommu
page table pages that are used.
Reported by: alc
Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35458
Peter Holm [Tue, 14 Jun 2022 04:59:32 +0000 (06:59 +0200)]
stress2: Added a syzkaller reproducer. Enable all reaper tests
Alexander Motin [Tue, 14 Jun 2022 04:24:39 +0000 (00:24 -0400)]
CTL: Fix double command completions on HA failover.
I've found couple cases when CTL_FLAG_SENT_2OTHER_SC flags were not
cleared on commands return from active node or the send failure. It
created races when ctl_failover_lun() call before ctl_process_done()
could cause second ctl_done() and ctl_process_done() calls, causing
all sorts of problems.
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Cy Schubert [Tue, 14 Jun 2022 02:31:01 +0000 (19:31 -0700)]
kern_thread.c: Fix i386 build
Chase
4493a13e3bfbbdf8488993843281ec688057ee0f by updating static
assertions of struct proc.
Jung-uk Kim [Tue, 14 Jun 2022 01:40:30 +0000 (21:40 -0400)]
ACPICA: Revert an upstream patch to appease useless warnings
This patch removes warnings messages like the following added in ACPICA
20220331:
ACPI Warning: Firmware issue: Excessive sleep time (0xxx ms > 10 ms)
in ACPI Control Method (
20220331/exsystem-347)
Note the original author of this patch wants to back it out:
https://github.com/acpica/acpica/pull/780
Rick Macklem [Mon, 13 Jun 2022 22:57:42 +0000 (15:57 -0700)]
nfscl: Clean up the code by removing unused arguments
The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port. For FreeBSD, this argument
is always NULL, so remove it to clean up the code.
This commit gets rid of "stuff" for assorted functions
defined in nfs_clrpcops.c and called in nfs_clvnops.c.
Future commits will do the same for other functions.
This commit should not result in a semantics change.
Brooks Davis [Mon, 13 Jun 2022 20:37:34 +0000 (21:37 +0100)]
include/i386: fix release builds
Add a target to ensure the presence of /usr/include/i386
before we try to install files. In the buildworld/installworld path
it gets created different ways, but for distribute (used in releases)
we need it in the subdir.
(Creating of this the x86, pc, powerpc directories is far too complex.
We should look for ways to simplify it.)
Reported by: lwhsu
Fixes:
a09ea2bbc3053d3b2afdb2f7444e5e57a96bb891
Konstantin Belousov [Mon, 16 May 2022 23:47:20 +0000 (02:47 +0300)]
reap_kill_proc(): avoid singlethreading any other process if we are exiting
This is racy because curproc process lock is not used, but allows the
process to exit faster. It is userspace issue to create such race
anyway, and not fullfilling the guarantee that all reaper descendants
are signalled should be fine.
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Sun, 15 May 2022 22:52:09 +0000 (01:52 +0300)]
reap_kill_subtree(): hold the reaper when entering it into the queue to handle later
We drop proctree_lock, which allows the process to exit while memoized
in the list to proceed.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Mon, 9 May 2022 21:41:23 +0000 (00:41 +0300)]
reap_kill_subtree_once(): handle proctree_lock unlock in reap_kill_proc()
Recorded reaper might loose its reaper status, so we should not assert
it, but check and avoid signalling if this happens.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Tue, 3 May 2022 19:49:37 +0000 (22:49 +0300)]
reap_kill_proc: do not retry on thread_single() failure
The failure means that the process does single-threading itself, which
makes our action not needed.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Sat, 30 Apr 2022 23:29:25 +0000 (02:29 +0300)]
Make stop_all_proc_block interruptible to avoid deadlock with parallel suspension
If we try to single-thread a process which thread entered
procctl(REAP_KILL_SUBTREE), and sleeping waiting for us unlocking
stop_all_proc_blocker, we must be able to finish single-threading. This
requires the sleep to be interruptible.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Mark Johnston [Thu, 9 Jun 2022 04:17:32 +0000 (07:17 +0300)]
thread_single_end(): consistently maintain p_boundary_count for ALLPROC mode
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Wed, 8 Jun 2022 01:27:30 +0000 (04:27 +0300)]
thread_unsuspend(): do not unuspend the suspended leader thread doing SINGLE_ALLPROC
markj wrote:
tdsendsignal() may unsuspend a target thread. I think there is at least
one bug there: suppose thread T is suspended in
thread_single(SINGLE_ALLPROC) when trying to kill another process with
REAP_KILL. Suppose a different thread sends SIGKILL to T->td_proc. Then,
tdsendsignal() calls thread_unsuspend(T, T->td_proc). thread_unsuspend()
incorrectly decrements T->td_proc->p_suspcount to -1.
Later, when T->td_proc exits, it will wait forever in
thread_single(SINGLE_EXIT) since T->td_proc->p_suspcount never reaches 1.
Since the thread suspension is bounded by time needed to do
thread_single(), skipping the thread_unsuspend_one() call there should
not affect signal delivery if this thread is selected as target.
Reported by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Thu, 12 May 2022 11:47:40 +0000 (14:47 +0300)]
thread_single(): remove already checked conditional expression
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Sun, 15 May 2022 21:55:32 +0000 (00:55 +0300)]
Do not single-thread itself when the process single-threaded some another process
Since both self single-threading and remote single-threading rely on
suspending the thread doing thread_single(), it cannot be mixed: thread
doing thread_suspend_switch() might be subject to thread_suspend_one()
and vice versa.
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Tue, 10 May 2022 23:37:58 +0000 (02:37 +0300)]
weed_inhib(): correct the condition to re-suspend a thread
suspended for SINGLE_ALLPROC mode. There is no need to check for
boundary state. It is only required to see that the suspension comes
from the ALLPROC mode.
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Sat, 30 Apr 2022 23:30:13 +0000 (02:30 +0300)]
weed_inhib(): do not double-suspend already suspended thread if the loop reiterates
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Tue, 3 May 2022 19:48:50 +0000 (22:48 +0300)]
thread_single: wait for P_STOPPED_SINGLE to pass
to avoid ALLPROC mode to try to race with any other single-threading
mode.
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Thu, 26 May 2022 19:18:57 +0000 (22:18 +0300)]
issignal(): ignore signals when process is single-threading for exit
Places that will wait for curproc->p_singlethr to become zero (in the
next commit, the counter of number of external single-threading is
to be introduced), must wait for it interruptible, otherwise we
deadlock. On the other hand, a signal delivered during this window,
if directed to the waiting thread, would cause the wait loop to become
a busy loop.
Since we are exiting, it is safe to ignore the signals.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Konstantin Belousov [Wed, 4 May 2022 23:57:26 +0000 (02:57 +0300)]
P2_WEXIT: avoid thread_single() for exiting process earlier
before the process itself does thread_single(SINGLE_EXIT). We cannot
single-thread such process in ALLPROC (external) mode, and properly
detect and report the failure to do so due to the process becoming
zombie is easier to prevent than handle.
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D35310
Alan Somers [Thu, 26 May 2022 21:39:20 +0000 (15:39 -0600)]
bsdinstall: allow an install script to access packages on the DVD
If installing from the DVD, mount its packages in the chroot at
/dist/packages. That way they'll be accessible to an install script.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D35330
Ed Maste [Thu, 9 Jun 2022 23:53:24 +0000 (19:53 -0400)]
pkg-bootstrap: use latest package set on arm64 stable branches
As with i386 and amd64, "latest" packages are available on stable
branches for arm64/aarch64.
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35445
Dmitry Ovsyannikov [Mon, 13 Jun 2022 13:34:44 +0000 (08:34 -0500)]
rpcbind: get contact addr from xprt members
Addition to D31491 in order to actually resolve the top root cause.
Currently rpcbind gets contact address from connectionless xprt->xp_p2
member of a transport and will fail to get it when working over
connection oriented transport, leading to a guess game in terms of
contact address on rpcinfo requests like RPCBPROC_GETVERSADDR or
RPCBPROC_GETADDRLIST and poor returns which may influence a user
of a call and specifically reported on OSX clients, which tend to
not provide address hint from rpcinfo request to a server.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D35220
Brooks Davis [Mon, 13 Jun 2022 17:35:40 +0000 (18:35 +0100)]
amd64: -m32 support for machine/md_var.h
Install the i386 md_var.h under /usr/include/i386 on amd64 and include
when targeting i386.
This is a mostly kernel-only header required by procstat's ZFS support.
It is pulled in by the i386 machine/counter.h.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:40 +0000 (18:35 +0100)]
amd64: -m32 support for machine/counter.h
Install the i386 counter.h under /usr/include/i386 on amd64 and include
when targeting i386.
This is a kernel-only header required by procstat's ZFS support.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:40 +0000 (18:35 +0100)]
amd64: -m32 support for machine/pcpu_aux.h
Install the i386 pcpu_aux.h under /usr/include/i386 on amd64 and include
when targeting i386.
This is a kernel-only header that is required by procstat's ZFS support.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:40 +0000 (18:35 +0100)]
amd64: -m32 support for machine/pcpu.h
Install the i386 pcpu.h under /usr/include/i386 on amd64 and include
when targeting i386.
This is a kernel-only header and should not be required, but
procstat's zfs support includes this with _KERNEL defined.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/sb_buf.h
The contents of the amd64 version are kernel-only and incompatible with
other headers when compiled for i386 userspace with _KERNEL defined.
Just ifdef the whole file out in that case rather than giving this file
the full x86 treatment since it's not needed for current use cases
(procstat zfs support).
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/vmparam.h
Install the i386 vmparam.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/proc.h
Install the i386 proc.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/pmap.h
Install the i386 pmap.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/segments.h
Install the i386 segments.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/atomic.h
Install the i386 atomic.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/asm(macros).h
Install the i386 versions under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:39 +0000 (18:35 +0100)]
amd64: -m32 support for machine/profile.h
Install the i386 profile.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:38 +0000 (18:35 +0100)]
amd64: -m32 support for machine/cpufunc.h
Install the i386 cpufunc.h under /usr/include/i386 on amd64 and include
when targeting i386.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:38 +0000 (18:35 +0100)]
x86: cleanup in machine/cpufunc.h
Reduce diffs between amd64 and i386 and improve whitespace
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:38 +0000 (18:35 +0100)]
amd64: symlink i386 includes into build dir
By creating an i386 symlink, this allows code compiled with -m32 to
build (32-bit vdso and linux bits) when -m32 support requires files
in the i386 hierarchy.
Reviewed by: jhb, imp
Brooks Davis [Mon, 13 Jun 2022 17:35:38 +0000 (18:35 +0100)]
amd64: add an i386 include directory
This directory will hold i386-specific headers that are needed for
-m32 support on amd64 and where the amd64 and i386 cases have too
little in common for combining them to make sense. Files to be
installed will come in later commits.
With the currently required set of files, this could be done with
another INCGROUP in include/Makefile, but at least one file that
might want -m32 support (ieeefp.h) conflicts with a files installed
in /usr/include.
Reviewed by: jhb, imp
Andrew Gallatin [Mon, 13 Jun 2022 15:32:10 +0000 (11:32 -0400)]
lacp: Remove racy kassert
In lacp_select_tx_port_by_hash(), we assert that the selected port is
DISTRIBUTING. However, the port state is protected by the LACP_LOCK(),
which is not held around lacp_select_tx_port_by_hash(). So this
assertion is racy, and can result in a spurious panic when links
are flapping.
It is certainly possible to fix it by acquiring LACP_LOCK(),
but this seems like an early development assert, and it seems best
to just remove it, rather than add complexity inside an ifdef
INVARIANTS.
Sponsored by: Netflix
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D35396
Hans Petter Selasky [Mon, 13 Jun 2022 14:55:14 +0000 (16:55 +0200)]
ibcore: Fix use-after-free access in ucma_close()
The error in ucma_create_id() left ctx in the list of contexts belong
to ucma file descriptor. The attempt to close this file descriptor causes
to use-after-free accesses while iterating over such list.
Linux commit:
ed65a4dc22083e73bac599ded6a262318cad7baf
PR: 264650
MFC after: 1 week
Sponsored by: NVIDIA Networking
Hans Petter Selasky [Mon, 13 Jun 2022 14:46:47 +0000 (16:46 +0200)]
mlx5ib: Fix memory leak in clean_mr() error path
In the clean_mr() error path the 'mr' should be freed.
Linux commit:
5942d8ae411775b76e5e1ab0cce57b0666516f2d
PR: 264653
MFC after: 1 week
Sponsored by: NVIDIA Networking
Doug Ambrisko [Mon, 13 Jun 2022 14:56:38 +0000 (07:56 -0700)]
mount: add vnode usage per file system with mount -v
This avoids the need to drop into the ddb to figure out vnode
usage per file system. It helps to see if they are or are not
being freed. Suggestion to report active vnode count was from
kib@
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35436
Bjoern A. Zeeb [Mon, 13 Jun 2022 13:57:42 +0000 (13:57 +0000)]
rtw88: update Realtek's rtw88 driver
Update rtw88 based on wireless-testing at
4e051428044d5c47cd2c81c3b154788efe07ee11 (tag: wt-2022-06-10).
This is in preparation to apply USB changes to work on these and
LinuxKPI for them over the next weeks, as well to debug a
reported issue, and possibly extract and upstream some local fixes.
MFC after: 3 days
Sergey Kandaurov [Thu, 9 Jun 2022 21:02:01 +0000 (01:02 +0400)]
utimensat(2): Remove description of compatibility code
Commit
e0e0323354c55335775e3a55b1af0f93967fb412 removed compat stubs for
kernels that did not have futimens() and utimensat() system calls, but
removed the documentation for them in the manual page only partially.
Remove the rest of the documentation of the compatibility code.
MFC after: 1 week
Dimitry Andric [Sun, 12 Jun 2022 18:51:09 +0000 (20:51 +0200)]
Merge llvm-project release/14.x llvmorg-14.0.5-0-gc12386ae247c
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.5-0-gc12386ae247c, aka 14.0.5 release.
PR: 261742
MFC after: 3 days
Bjoern A. Zeeb [Sun, 12 Jun 2022 18:35:58 +0000 (18:35 +0000)]
rtw88: split driver up into a core and pci part
Split the driver up into two modules (if_rtw88_pci.ko and rtw88_core.ko).
This is in preparation for the hopefully eventually upcoming USB support
using the same driver core.
Note: this changes the module name to load to if_rtw88_pci.ko instead of
if_rtw88.ko. If using devmatch(8) everything should stay the same as
the driver name (used for net.wlan.devices) stays rtw88. If using
kld_list in rc.conf or loader.conf you will need to adjust the name.
Update man page for this.
MFC after: 3 days
Dimitry Andric [Sun, 12 Jun 2022 14:46:17 +0000 (16:46 +0200)]
Remove yet another incorrect .. level from BSD.usr.dist
Since the spacing was off, it was not clear that it descended one level
too many.
Fixes:
695052e240c7
MFC after: 3 days
Hans Petter Selasky [Sun, 12 Jun 2022 14:40:36 +0000 (16:40 +0200)]
uchcom(4): Add new USB ID.
PR: 260783
PR: 264634
MFC after: 1 week
Sponsored by: NVIDIA Networking
Dimitry Andric [Sun, 12 Jun 2022 14:03:02 +0000 (16:03 +0200)]
Vendor import of llvm-project branch release/14.x llvmorg-14.0.5-0-gc12386ae247c.
Peter Holm [Sun, 12 Jun 2022 09:52:55 +0000 (11:52 +0200)]
stress2: Added an explanation to failure mode
Xin LI [Sun, 12 Jun 2022 04:39:00 +0000 (21:39 -0700)]
Account for missing `..' in BSD.usr.dist for clang 14.0.3.
MFC after: 3 days
Xin LI [Sun, 12 Jun 2022 04:37:15 +0000 (21:37 -0700)]
Fix mtree for usr/
MFC after: 3 days
Baptiste Daroussin [Sat, 11 Jun 2022 20:04:56 +0000 (22:04 +0200)]
rc.d/wpa_supplicant: remove support for NDIS
ndis drivers have been remove long ago (early 2021)
Hans Petter Selasky [Sat, 11 Jun 2022 19:29:42 +0000 (21:29 +0200)]
ktls: Remove the KERN_TLS option from the i386 and amd64 LINT-NOIP kernel configurations.
Kernel TLS depends on INET or INET6 being enabled.
Reported by: bz@
MFC after: 1 week
Sponsored by: NVIDIA Networking
Kirk McKusick [Sat, 11 Jun 2022 18:04:19 +0000 (11:04 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.
One of the checks was that the cylinder group size (fs_cgsize)
matched that calculated by CGSIZE(). The value calculated by CGSIZE()
has changed over time as the filesystem has evolved. Thus comparing
the value of CGSIZE() of the current generation filesystem may not
match the size as computed by CGSIZE() that was in effect at the
time an older filesystem was created. Therefore the check for
fs_cgsize is changed to simply ensure that it is not larger than
the filesystem blocksize (fs_bsize).
Reported by: Martin Birgmeier
Tested by: Martin Birgmeier
MFC after: 1 month (with
076002f24d35)
PR: 264450
Differential Revision: https://reviews.freebsd.org/D35219
Bjoern A. Zeeb [Sat, 11 Jun 2022 16:38:00 +0000 (16:38 +0000)]
LinuxKPI: 802.11: fix compiling with DEBUG
Fix a build with DEBUG after
d0d2911035192473e8bd3f6b99ed5ca9b1b29e47
which lost the __func__, __LINE__ argument in an updated tracing line.
Reported by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
MFC after: 2 days
X-MFC with:
d0d2911035192473e8bd3f6b99ed5ca9b1b29e47
Bjoern A. Zeeb [Sat, 11 Jun 2022 12:49:40 +0000 (12:49 +0000)]
LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets
A problem which showed up on 13.1 between BETA3 and RC1 was that on older
chipsets the fw would crash. While some 0x18 ADD_STA problems were seen
before,
d9f59799fc3e was the actual trigger for this problem
(in 0x28 MAC_CONTEXT command) in a squashed merge to the releng branch.
Strangely there were no changes to assoc_to_run in that revision so other
circumstances may be the actual cause but swapping the bss_info update and
the sta_state in that function seem to make my 8265 happy while AX200 and
AX210 stay good.
Thanks to everyone who helped debug this.
Sponsored by: The FreeBSD Foundation (partially)
MFC after: 3 days
Stefan Eßer [Sat, 11 Jun 2022 11:03:06 +0000 (13:03 +0200)]
usr.bin/bc: update to version 5.3.1
This version adds support for command line editing and history using
the libedit or readline libraries in addition to the line editing
features available in previous versions.
The version in the base system is configured to use libedit.
This allows to choose between emacs and vi line editing commands and
to use command overrides via a ~/.editrc file.
Merge commit '
bd54318046bfee055b140705a5cfd4148e78da07'
PR: 264010
MFC after: 2 weeks
Stefan Eßer [Sat, 11 Jun 2022 09:54:23 +0000 (11:54 +0200)]
vendor/bc: import of version 5.3.1
This update does not contain any functional change, but fixes two
minor build issues:
- Temporary files were created in the source directory, causing build
failures if the sources were not writable at build time.
- A message catalogue contained extra characters that were ignored but
made gencat print warning messages.
Stefan Eßer [Sat, 11 Jun 2022 09:50:28 +0000 (11:50 +0200)]
vendor/bc: import of version 5.3.0
This version adds support for command line editing and history using
the editline or readline libraries in addition to the line editing
features available in previous versions.
Doug Moore [Fri, 10 Jun 2022 21:53:16 +0000 (16:53 -0500)]
rb_tree: drop needless tests from rb_next, rb_prev
In RB_NEXT, when there is no RB_RIGHT node, the search must proceed
through the parent node.
There is code written to handle the case when the parent is non-NULL
and the current element is the left child of that parent. If you
assume that the current element is either the left child of its
parent, or the right child of its parent, but not both, then this test
is not necessary. Instead of assigning RB_PARENT(elm, field) to elm
when elm == RB_LEFT, removing the test has the code assign
RB_PARENT(elm, field) to elm when elm != RB_RIGHT. There's no need to
examine the RB_LEFT field at all.
This change removes that needless RB_LEFT test, and makes a similar
change to the RB_PREV implementation.
Reviewed by: alc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35450
Doug Moore [Fri, 10 Jun 2022 18:56:54 +0000 (13:56 -0500)]
iommu_gas: pass size to iommu_map without rounding
Let the caller to iommu_map pass the size parameter without rounding
it up to a multiple of page size. Let iommu_map round it up when
necessary, which is not all of the time, so that in some cases less
space is reserved.
Reviewed by: alc, kib (previous version)
Tested by: pho, br
Discussed with: andrew
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35424
Muhammad Moinur Rahman [Fri, 10 Jun 2022 17:11:45 +0000 (12:11 -0500)]
Update organization.dot with new CORE.12 members
Approved by: core (bofh with core-secretary@ hat on)
Bjoern A. Zeeb [Fri, 10 Jun 2022 14:18:57 +0000 (14:18 +0000)]
LinuxKPI: 802.11: rework handling of the special IEEE80211_NUM_TIDS queue
Rework the way we are dealing with the last queue. If the driver
opts in to STA_MMPDU_TXQ then preferably send all non-data frames
via the last (IEEE80211_NUM_TIDS) queue which otherwise is not used
in station mode.
If we do not have that queue we do individual tx() calls for non-data
frames now.
Everything else goes via the selected queue if possible for as long as
we have a ni (sta) and otherwise resorts to direct tx.
Tested on: Intel AX200 and AX210
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Eugene Grosbein [Fri, 10 Jun 2022 14:03:07 +0000 (21:03 +0700)]
ftpd(8): do not refer to now unused libxo(3)
In 2018, the commit r328100 (
0fdf7fa846b1a1b1679e86812a1b08b8cb623604)
removed libxo(3) support from ls(1), so ftpd has no reasons to link
with libxo since then.
ls(1) does not depend on libxo in both of stable/12 and stable/13.
MFC after: 2 weeks
Bjoern A. Zeeb [Fri, 20 May 2022 21:50:01 +0000 (21:50 +0000)]
LinuxKPI: move pm_message_t from kernel.h to pm.h
Move pm_message_t from kernel.h to pm.h and remove a private define
in usb.h as well as adjust the implementation in linux_usb.c.
This cleans up what I believe to be a historic shortcut and is
needed for future wireless driver updates.
Leave a note in UPDATING that drm-kmod users need to update to the
latest version before re-compiling a new kernel to avoid errors
(see PR).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
PR: 264449 (drm-kmod port update, thanks wulf)
Obtained from: bz_git_iwlwifi (Dec 2020) (partly)
Reviewed by: hselasky, imp
Differential Revision: https://reviews.freebsd.org/D35276
Baptiste Daroussin [Fri, 10 Jun 2022 10:55:43 +0000 (12:55 +0200)]
pci_vendors: udpate to 2022-05-18
Toomas Soome [Wed, 25 May 2022 18:53:57 +0000 (21:53 +0300)]
loader: add support for gzip compression
As we do have zlib code in loader, we should also support gzip
compression in zfs.
PR: 153173
Submitted by: Mikhail Zakharov <zmey20000@yahoo.com>
Reviewed by: imp, markj, delphij
Differential Revision: https://reviews.freebsd.org/D35320
MFC after: 1 month
John Baldwin [Thu, 9 Jun 2022 18:05:34 +0000 (11:05 -0700)]
hwpmc: Permit the minimum sampling count to be set as a sysctl.
A rarely occurring event (e.g. an event that occurs less than 1000
times during execution of a program) may require a lower minimum
threshold than 1000. Replace the hardcoded 1000 with a sysctl that
the administrator can use to permit smaller sampling count values.
Reviewed by: mhorne, mav
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D35400
John Baldwin [Thu, 9 Jun 2022 17:20:03 +0000 (10:20 -0700)]
.github: Add a build on Ubuntu 22.04 using llvm 14.
Reviewed by: uqs
Pull Request: https://github.com/freebsd/freebsd-src/pull/599
John Baldwin [Thu, 9 Jun 2022 17:20:03 +0000 (10:20 -0700)]
usr.bin/dtc: Include <limits> for std::numeric_limits<>.
This is needed when building natively as a cross-tool on hosts such as
Linux using more recent versions of libstdc++.
Co-authored-by: Alexander Richardson <arichardson@FreeBSD.org>
Obtained from: CheriBSD
John Baldwin [Thu, 9 Jun 2022 17:20:03 +0000 (10:20 -0700)]
.github: Cross-build aarch64 as well as amd64 kernels.
This required adding an explicit os list to the matrix.
Reviewed by: uqs
Pull Request: https://github.com/freebsd/freebsd-src/pull/599
John Baldwin [Thu, 9 Jun 2022 17:20:02 +0000 (10:20 -0700)]
.github: Update compilers used for cross-build testing.
- Drop clang 9 build, and switch the remaining ubuntu build to
the more modern clang 12.
- Update the label for the macos-latest builds which are now using
clang 13 rather than clang 12.
Reviewed by: uqs
Pull Request: https://github.com/freebsd/freebsd-src/pull/599
Ed Maste [Thu, 9 Jun 2022 14:39:24 +0000 (10:39 -0400)]
Sort SPLIT_KERNEL_DEBUG correctly in kern.opts.mk
Fixes:
e3709cfe6a2a ("Add SPLIT_KERNEL_DEBUG knob")
Hans Petter Selasky [Thu, 9 Jun 2022 13:14:17 +0000 (15:14 +0200)]
upgt(4): Adjust all pause calls to use milliseconds instead of ticks.
MFC after: 1 week
Sponsored by: NVIDIA Networking