]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoiwlwifi: clarify page update
Bjoern A. Zeeb [Sat, 1 Jan 2022 18:08:31 +0000 (18:08 +0000)]
iwlwifi: clarify page update

Based on some feedback clarify the man page for
- how to load the driver currently
- status of the driver with respect to iwm(4)
and leave a comment to (automatically) add a full list of chipsets
to the man page.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: debdrup
Differential Revision: https://reviews.freebsd.org/D33713

2 years agobsddialog: convert bsdinstall/distextract
Alfonso Siciliano [Sat, 1 Jan 2022 20:50:44 +0000 (21:50 +0100)]
bsddialog: convert bsdinstall/distextract

Differential Revision: https://reviews.freebsd.org/D33581

2 years agosctp: improve counting of incoming chunks
Michael Tuexen [Sat, 1 Jan 2022 19:59:47 +0000 (20:59 +0100)]
sctp: improve counting of incoming chunks

MFC after: 3 days

2 years agoudp6: remove assignments not being used
Michael Tuexen [Sat, 1 Jan 2022 18:25:47 +0000 (19:25 +0100)]
udp6: remove assignments not being used

MFC after: 3 days
Sponsored by: Netflix, Inc.

2 years agoudp: use appropriate pcbinfo when signalling EHOSTDOWN
Michael Tuexen [Sat, 1 Jan 2022 18:17:17 +0000 (19:17 +0100)]
udp: use appropriate pcbinfo when signalling EHOSTDOWN

MFC after: 3 days
Sponsored by: Netflix, Inc.

2 years agoin_pcb: improve inp_next()
Michael Tuexen [Sat, 1 Jan 2022 17:59:47 +0000 (18:59 +0100)]
in_pcb: improve inp_next()

If there is no inp to check, exit the loop iterating through them.

Reported by: syzbot+403406a9cbf082b36ea4@syzkaller.appspotmail.com
Reviewed by: glebius
Sponsored by: Netflix, Inc.

2 years agoroute: use NULL for null ptr in getaddr call, not 0
Ed Maste [Fri, 31 Dec 2021 18:21:13 +0000 (13:21 -0500)]
route: use NULL for null ptr in getaddr call, not 0

Style(9) prefers NULL.

Sponsored by: The FreeBSD Foundation

2 years agoWelcome 2022, update copyrights.
Warner Losh [Sat, 1 Jan 2022 16:49:49 +0000 (09:49 -0700)]
Welcome 2022, update copyrights.

Sponsored by: Netflix

2 years agosys/kern/sched_4bsd.c: fix typo introduced in previous commit
Stefan Eßer [Sat, 1 Jan 2022 14:33:38 +0000 (15:33 +0100)]
sys/kern/sched_4bsd.c: fix typo introduced in previous commit

2 years agoRestore variable aliasing in the context of cpu set operations
Stefan Eßer [Sat, 1 Jan 2022 10:41:54 +0000 (11:41 +0100)]
Restore variable aliasing in the context of cpu set operations

A simplification of set operations removed side-effects of the
previous code, which are restored by this commit.

2 years agofusefs: implement VOP_ALLOCATE
Alan Somers [Sat, 1 Jan 2022 04:04:12 +0000 (21:04 -0700)]
fusefs: implement VOP_ALLOCATE

Now posix_fallocate will be correctly forwarded to fuse file system
servers, for those that support it.

MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33389

2 years agoamd64 get_mcontext(): third argument to get_fpcontext() is a pointer
Konstantin Belousov [Sat, 1 Jan 2022 03:55:59 +0000 (05:55 +0200)]
amd64 get_mcontext(): third argument to get_fpcontext() is a pointer

Use NULL instead of raw 0

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agofusefs: fix .. lookups when the parent has been reclaimed.
Alan Somers [Thu, 2 Dec 2021 02:50:47 +0000 (19:50 -0700)]
fusefs: fix .. lookups when the parent has been reclaimed.

By default, FUSE file systems are assumed not to support lookups for "."
and "..".  They must opt-in to that.  To cope with this limitation, the
fusefs kernel module caches every fuse vnode's parent's inode number,
and uses that during VOP_LOOKUP for "..".  But if the parent's vnode has
been reclaimed that won't be possible.  Previously we paniced in this
situation.  Now, we'll return ESTALE instead.  Or, if the file system
has opted into ".." lookups, we'll just do that instead.

This commit also fixes VOP_LOOKUP to respect the cache timeout for ".."
lookups, if the FUSE file system specified a finite timeout.

PR: 259974
MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33239

2 years agofusefs: move common code from forget.cc to utils.cc
Alan Somers [Thu, 2 Dec 2021 02:50:26 +0000 (19:50 -0700)]
fusefs: move common code from forget.cc to utils.cc

MFC after: 2 weeks

2 years agofusefs: in the tests, always assume debug.try_reclaim_vnode is available
Alan Somers [Thu, 2 Dec 2021 02:38:04 +0000 (19:38 -0700)]
fusefs: in the tests, always assume debug.try_reclaim_vnode is available

In an earlier version of the revision that created that sysctl (D20519)
the sysctl was gated by INVARIANTS, so the test had to check for it.
But in the committed version it is always available.

MFC after: 2 weeks

2 years agofusefs: copy_file_range must update file timestamps
Alan Somers [Mon, 29 Nov 2021 02:50:56 +0000 (19:50 -0700)]
fusefs: copy_file_range must update file timestamps

If FUSE_COPY_FILE_RANGE returns successfully, update the atime of the
source and the mtime and ctime of the destination.

MFC after: 2 weeks
Reviewers: pfg
Differential Revision: https://reviews.freebsd.org/D33159

2 years agoFix a race in fusefs that can corrupt a file's size.
Alan Somers [Mon, 29 Nov 2021 02:17:34 +0000 (19:17 -0700)]
Fix a race in fusefs that can corrupt a file's size.

VOPs like VOP_SETATTR can change a file's size, with the vnode
exclusively locked.  But VOPs like VOP_LOOKUP look up the file size from
the server without the vnode locked.  So a race is possible.  For
example:

1) One thread calls VOP_SETATTR to truncate a file.  It locks the vnode
   and sends FUSE_SETATTR to the server.
2) A second thread calls VOP_LOOKUP and fetches the file's attributes from
   the server.  Then it blocks trying to acquire the vnode lock.
3) FUSE_SETATTR returns and the first thread releases the vnode lock.
4) The second thread acquires the vnode lock and caches the file's
   attributes, which are now out-of-date.

Fix this race by recording a timestamp in the vnode of the last time
that its filesize was modified.  Check that timestamp during VOP_LOOKUP
and VFS_VGET.  If it's newer than the time at which FUSE_LOOKUP was
issued to the server, ignore the attributes returned by FUSE_LOOKUP.

PR: 259071
Reported by: Agata <chogata@moosefs.pro>
Reviewed by: pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33158

2 years agomips: remove forgotten options file too
Warner Losh [Fri, 31 Dec 2021 22:08:16 +0000 (15:08 -0700)]
mips: remove forgotten options file too

Sponsored by: Netflix

2 years agonetfpga10: mips only, remove
Warner Losh [Fri, 31 Dec 2021 22:06:56 +0000 (15:06 -0700)]
netfpga10: mips only, remove

Sponsored by: Netflix

2 years agomips: Remove dtrace build support
Warner Losh [Fri, 31 Dec 2021 22:04:30 +0000 (15:04 -0700)]
mips: Remove dtrace build support

Sponsored by: Netflix

2 years agomips: Remove system module support
Warner Losh [Fri, 31 Dec 2021 22:02:35 +0000 (15:02 -0700)]
mips: Remove system module support

Remove all mips .if conditionals. Since _sym was now set
unconditionally, just add it to the right place w/o a variable.

Sponsored by: Netflix

2 years agocallout: Wait for the softclock thread to switch before rescheduling
Mark Johnston [Fri, 31 Dec 2021 22:01:39 +0000 (17:01 -0500)]
callout: Wait for the softclock thread to switch before rescheduling

When a softclock thread prepares to go off-CPU, the following happens in
the context of the thread:

1. callout state is locked
2. thread state is set to IWAIT
3. thread lock is switched from the tdq lock to the callout lock
4. tdq lock is released
5. sched_switch() sets td_lock to &blocked_lock
6. sched_switch() releases old td_lock (callout lock)
7. sched_switch() removes td from its runqueue
8. cpu_switch() sets td_lock back to the callout lock

Suppose a timer interrupt fires while the softclock thread is switching
off, and callout_process() schedules the softclock thread.  Then there
is a window between steps 5 and 8 where callout_process() can call
sched_add() while td_lock is &blocked_lock, but this is not correct
since the thread is not logically locked.

callout_process() thus needs to spin waiting for the softclock thread to
finish switching off (i.e., after step 8 completes) before rescheduling
it, since callout_process() does not acquire the thread lock directly.

Reported by: syzbot+fb44dbf6734ff492c337@syzkaller.appspotmail.com
Fixes: 74cf7cae4d22 ("softclock: Use dedicated ithreads for running callouts.")
Reviewed by: mav, kib, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33709

2 years agoAdd lio back to NOTES
Warner Losh [Fri, 31 Dec 2021 21:56:16 +0000 (14:56 -0700)]
Add lio back to NOTES

lio appears to be partially removed from this file. It's a modern enough
card, so add it back. It builds everywhere.

Sponsored by: Netflix

2 years agorescue: include ping iff at least one of INET & INET6 is enabled
Ed Maste [Fri, 31 Dec 2021 01:11:31 +0000 (20:11 -0500)]
rescue: include ping iff at least one of INET & INET6 is enabled

Ping does not build (and serves no purpose) if neither is enabled
(i.e., building WITHOUT_INET and WITHOUT_INET6).

This is equvalent to a4ef9e58bc0c but for rescue/.

PR: 260082
Fixes: a4ef9e58bc0c ("sbin: build ping if at least one of...")
Sponsored by: The FreeBSD Foundation

2 years agolibc: Some enhancements to syslog(3)
Dmitry Wagin [Tue, 23 Mar 2021 16:01:15 +0000 (12:01 -0400)]
libc: Some enhancements to syslog(3)

This is a re-application of commit
2d82b47a5b4ef18550565dd55628d51f54d0af2e, which was reverted since it
broke with syslog daemons that don't adjust the /dev/log recv buffer
size.  Now that the default is large enough to accomodate 8KB messages,
restore support for large messages.

PR: 260126

2 years agoctfconvert: Handle arrays of empty structs
Mark Johnston [Fri, 31 Dec 2021 17:55:01 +0000 (12:55 -0500)]
ctfconvert: Handle arrays of empty structs

Members with such a type will legitimately have a size of zero, so don't
emit a warning.

PR: 260818
Reviewed by: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33700

2 years agoexec: Simplify sv_copyout_strings implementations a bit
Mark Johnston [Fri, 31 Dec 2021 17:50:15 +0000 (12:50 -0500)]
exec: Simplify sv_copyout_strings implementations a bit

Simplify control flow around handling of the execpath length and signal
trampoline.  Cache the sysentvec pointer in a local variable.

No functional change intended.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33703

2 years agoCAM: List few missed opcodes.
Alexander Motin [Fri, 31 Dec 2021 16:46:58 +0000 (11:46 -0500)]
CAM: List few missed opcodes.

MFC after: 1 weeks

2 years agosys/cpuset.h: fix macro definition
Stefan Eßer [Fri, 31 Dec 2021 13:09:44 +0000 (14:09 +0100)]
sys/cpuset.h: fix macro definition

The _s parameter was missing in the paramater list.

Reported by: gljennjohn at gmail.com (Gary Jennejohn)

2 years agoiwlwifi: import correct firmware versions for select Intel iwlwifi/mvm
Bjoern A. Zeeb [Fri, 31 Dec 2021 11:51:18 +0000 (11:51 +0000)]
iwlwifi: import correct firmware versions for select Intel iwlwifi/mvm

The firmware files for 3160, 7260, and 7265 imported contain old versions
no longer supported by the driver.
Replace with latest versions from linux-firmware to possibly also
support these chip revisions.

Reported by: FreeBSD User (freebsd walstatt-de.de) on wireless (2021-12-30)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11 fix queue wait
Bjoern A. Zeeb [Fri, 31 Dec 2021 11:47:14 +0000 (11:47 +0000)]
LinuxKPI: 802.11 fix queue wait

We are using a bandaid to wait for queues after station creation
looping and pausing.
The abort condition was looping in the wrong direction so we were
potentially waiting forever if queues never became ready.
From initial user test data we also found that the wait time was
too low in some cases so increase the length.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agosys/cpuset.h: add 3 more macros provided by GLIBC
Stefan Eßer [Fri, 31 Dec 2021 10:08:34 +0000 (11:08 +0100)]
sys/cpuset.h: add 3 more macros provided by GLIBC

The lang/python* ports failed since they expected CPU_COUNT_S() to be
provided by sys/cpuset.h. Add this function plus 2 more in a way that
is compatible with GLIBC.

Reported by: ler at lerctr.org (Larry Rosenman)

2 years agox86-busdma - Add missing paren
Doug Moore [Fri, 31 Dec 2021 08:33:54 +0000 (02:33 -0600)]
x86-busdma - Add missing paren

Reported by: jenkins
Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere

2 years agoriscv-busdma: Balance parens.
Doug Moore [Fri, 31 Dec 2021 07:59:53 +0000 (01:59 -0600)]
riscv-busdma: Balance parens.
Reported by: jenkins
Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere

2 years agoar71xx: Remove atheros modules
Warner Losh [Fri, 31 Dec 2021 07:50:10 +0000 (00:50 -0700)]
ar71xx: Remove atheros modules

These are mips only for the atheros MIPS-based SoCs.

Sponsored by: Netflix

2 years agoiommu_gas: Rename a function missed earlier
Doug Moore [Fri, 31 Dec 2021 07:48:11 +0000 (01:48 -0600)]
iommu_gas: Rename a function missed earlier

Reported by: jenkins
Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere

2 years agohwpmc: deorbit mips support
Warner Losh [Fri, 31 Dec 2021 07:46:56 +0000 (00:46 -0700)]
hwpmc: deorbit mips support

Sponsored by: Netflix

2 years agoremove octeon sdk
Warner Losh [Fri, 31 Dec 2021 07:28:12 +0000 (00:28 -0700)]
remove octeon sdk

Octeon is a mips-only target.

Sponsored by: Netflix

2 years agomips: Remove thread_db support
Warner Losh [Fri, 31 Dec 2021 05:51:48 +0000 (22:51 -0700)]
mips: Remove thread_db support

Sponsored by: Netflix

2 years agomips: remove pthread support
Warner Losh [Fri, 31 Dec 2021 05:51:07 +0000 (22:51 -0700)]
mips: remove pthread support

Sponsored by: Netflix

2 years agomips: remove libc
Warner Losh [Fri, 31 Dec 2021 05:50:28 +0000 (22:50 -0700)]
mips: remove libc

Remove mips specific libc code and build infrasturcture.

Sponsored by: Netflix

2 years agomips: Remove msun support
Warner Losh [Fri, 31 Dec 2021 05:48:55 +0000 (22:48 -0700)]
mips: Remove msun support

Decommision msun (libm) support for mips.

Sponsored by: Netflix

2 years agomips: Remove CSU
Warner Losh [Fri, 31 Dec 2021 05:48:17 +0000 (22:48 -0700)]
mips: Remove CSU

Remove the CSU support for mips.

Sponsored by: Netflix

2 years agovm_reserv: #include vm_extern.h explicitly, for arm.
Doug Moore [Fri, 31 Dec 2021 06:40:25 +0000 (00:40 -0600)]
vm_reserv: #include vm_extern.h explicitly, for arm.

Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere

2 years agovm_phys: convert error back to warning
Doug Moore [Fri, 31 Dec 2021 06:23:46 +0000 (00:23 -0600)]
vm_phys: convert error back to warning

Move an assignment back to where it was before, to turn the
defined-but-not-used error back into a set-but-not-used warning.

Fixes: 01e115ab83a4 vm_phys: #include vm_extern

2 years agovm_phys: #include vm_extern
Doug Moore [Fri, 31 Dec 2021 05:31:18 +0000 (23:31 -0600)]
vm_phys: #include vm_extern

Arm64 and powerpc don't include vm_extern.h indirectly in vm_phys.c, which
means that for the sake of those architectures, it must be included explicitly.

Also, fix a set-unused warning that jenkins also found.

Reported by: Jenkins
Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere

2 years agoRemove discarded mips source.
Doug Moore [Fri, 31 Dec 2021 04:12:46 +0000 (22:12 -0600)]
Remove discarded mips source.

2 years agovm_extern: use standard address checkers everywhere
Doug Moore [Fri, 31 Dec 2021 04:09:08 +0000 (22:09 -0600)]
vm_extern: use standard address checkers everywhere

Define simple functions for alignment and boundary checks and use them
everywhere instead of having slightly different implementations
scattered about. Define them in vm_extern.h and use them where
possible where vm_extern.h is included.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D33685

2 years agomips: Remove sys/mips
Warner Losh [Fri, 31 Dec 2021 03:56:09 +0000 (20:56 -0700)]
mips: Remove sys/mips

Remove sys/mips as the next step of decomissioning mips from the tree.
Remove mips special cases from the kernel make files. Remove the mips
specific linker scripts.

Sponsored by: Netflix

2 years agolibkvm: Remove mips support
Warner Losh [Thu, 30 Dec 2021 23:45:17 +0000 (16:45 -0700)]
libkvm: Remove mips support

libkvm references files in sys/mips, so remove it ahead of removing
sys/mips.

Sponsored by: Netflix

2 years agoFix kernel build without INET6
Ed Maste [Thu, 30 Dec 2021 21:49:35 +0000 (16:49 -0500)]
Fix kernel build without INET6

Reported by: Gary Jennejohn
Fixes: ff3a85d32411 ("[lltable] Add per-family lltable ...")
Sponsored by: The FreeBSD Foundation

2 years agokboot: move to generic syscall interface
Warner Losh [Thu, 30 Dec 2021 23:07:20 +0000 (16:07 -0700)]
kboot: move to generic syscall interface

Just have the MD code provide syscall and have generic code for the
rest.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33515

2 years agokboot: Split out powerpc build
Warner Losh [Thu, 30 Dec 2021 23:07:13 +0000 (16:07 -0700)]
kboot: Split out powerpc build

Split the powerpc specific parts into kboot/arch/powerpc64. More may be
needed here.

Sponsored by: Netflix
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D33514

2 years agokboot: Move powerpc kboot to top level
Warner Losh [Thu, 30 Dec 2021 23:07:06 +0000 (16:07 -0700)]
kboot: Move powerpc kboot to top level

As the first step at making this more generic, move kboot to top level.

Sponsored by: Netflix
Reviewed by: luporl, tsoome
Differential Revision: https://reviews.freebsd.org/D33513

2 years agokboot: Add docs for WITH/WITHOUT LOADER_KBOOT
Warner Losh [Thu, 30 Dec 2021 23:06:53 +0000 (16:06 -0700)]
kboot: Add docs for WITH/WITHOUT LOADER_KBOOT

Sponsored by: Netflix
Suggestion by: emaste
Differential Revision: https://reviews.freebsd.org/D33512

2 years agokboot: Add MK_LOADER_KBOOT
Warner Losh [Thu, 30 Dec 2021 23:06:28 +0000 (16:06 -0700)]
kboot: Add MK_LOADER_KBOOT

Control building of KBOOT same as we do for uboot.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D33511

2 years agotinybsd: Remove
Warner Losh [Thu, 30 Dec 2021 22:56:57 +0000 (15:56 -0700)]
tinybsd: Remove

This hasn't been updated in 10 years in any real way. It's time to
retire it. It hasn't worked in some time due to drivers being removed
starting in FreeBSD 10.  All the interesting bits have already been
hoisted into other parts of base. The google code site hasn't had any
commits since 2011 and claims to Target FreeBSD 5, 6, 7, and 8.

Should someone fix the numerous issues, it can be restored.

Sponsored by: Netflix
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D33450

2 years agosoftclock: Use dedicated ithreads for running callouts.
John Baldwin [Thu, 30 Dec 2021 22:54:29 +0000 (14:54 -0800)]
softclock: Use dedicated ithreads for running callouts.

Rather than using the swi infrastructure, rewrite softclock() as a
thread loop (softclock_thread()) and use it as the main routine of the
softclock threads.  The threads use the CC_LOCK as the thread lock
when idle.

Reviewed by: mav, imp, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33683

2 years agodepend-cleanup.sh: Handle stale libc++.so ldscripts.
John Baldwin [Thu, 30 Dec 2021 22:10:05 +0000 (14:10 -0800)]
depend-cleanup.sh: Handle stale libc++.so ldscripts.

libc++ was moved from /usr/lib to /lib, but the libc++.so linker
script is not regenerated when the value of SHLIB changes.

Reported by: cy

2 years agoWhen parsing a rule to rotate log files on a specific week day,
Garance A Drosehn [Thu, 30 Dec 2021 20:45:13 +0000 (20:45 +0000)]
When parsing a rule to rotate log files on a specific week day,
parseDWM() can advance the time to the next week. If the next week is
in the next month, then tm_mon is incremented. However, the increment
was failing to handle the wraparound from December to January, so when
parsing a rule during the last week of the December, the month would
advance to month 12. This triggered an out-of-bounds read of the
mtab[] array in days_pmonth() after parseDWM() returned.  To fix,
this change resets the month to January and increment the year when
the month increment wraps.

The default rule for /var/log/weekly.log triggers this during the
last week of December each year.
Reported by: CHERI
Obtained from: CheriBSD
Reviewed by: jhb
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: <https://reviews.freebsd.org/D33687>

2 years agoReapply: move libc++ from /usr/lib to /lib
Dimitry Andric [Thu, 30 Dec 2021 16:03:10 +0000 (17:03 +0100)]
Reapply: move libc++ from /usr/lib to /lib

As with other runtime components like libc or libcxxrt.

If desired we can stop linking devd statically after this change (to
achive approximately no net change in required root filesystem size).

We must set SHLIBDIR with ?= before including <src.opts.mk>, otherwise
that will have set SHBLIDIR to its default value of /usr/lib.

Otherwise, "make delete-old-libs" would suggest to delete libc++.so.1
from /usr/lib, while there was not yet a copy in /lib.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33123

2 years agoloader: tftp: Copy the first block into the cache
Emmanuel Vadot [Thu, 30 Dec 2021 08:47:06 +0000 (09:47 +0100)]
loader: tftp: Copy the first block into the cache

tftp_open reads the first block so copy it in the cached data.
If we have more than one block (i.e. we called tftp_read before
tftp_preload) simply just reset the transfer.

Reported by: mmel
Reviewed by: mmel, tsoome
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33697

2 years agoRevert "Move libc++ from /usr/lib to /lib"
Ed Maste [Thu, 30 Dec 2021 15:25:08 +0000 (10:25 -0500)]
Revert "Move libc++ from /usr/lib to /lib"

This reverts commit 6b1c5775d1c29c7c42201254df82aca9f3820bc8.
There are reports of errors with this change.

Reported by: antoine

2 years agosctp: retire sctp_mtu_size_reset()
Michael Tuexen [Thu, 30 Dec 2021 14:30:11 +0000 (15:30 +0100)]
sctp: retire sctp_mtu_size_reset()

Thanks to Timo Voelker for making me aware that sctp_mtu_size_reset()
is very similar to sctp_pathmtu_adjustment().

MFC after: 3 days

2 years agosctp: improve sctp_pathmtu_adjustment()
Michael Tuexen [Thu, 30 Dec 2021 14:16:05 +0000 (15:16 +0100)]
sctp: improve sctp_pathmtu_adjustment()

Allow the resending of DATA chunks to be controlled by the caller,
which allows retiring sctp_mtu_size_reset() in a separate commit.
Also improve the computaion of the overhead and use 32-bit integers
consistently.
Thanks to Timo Voelker for pointing me to the code.

MFC after: 3 days

2 years agosys/sys/cpuset.h
Stefan Eßer [Thu, 30 Dec 2021 12:14:43 +0000 (13:14 +0100)]
sys/sys/cpuset.h

Fix typo in source file.

Reported by: pluknet at gmail.com (Sergey Kandaurov)

2 years agoMake CPU_SET macros compliant with other implementations
Stefan Eßer [Thu, 30 Dec 2021 11:20:32 +0000 (12:20 +0100)]
Make CPU_SET macros compliant with other implementations

The introduction of <sched.h> improved compatibility with some 3rd
party software, but caused the configure scripts of some ports to
assume that they were run in a GLIBC compatible environment.

Parts of sched.h were made conditional on -D_WITH_CPU_SET_T being
added to ports, but there still were compatibility issues due to
invalid assumptions made in autoconfigure scripts.

The differences between the FreeBSD version of macros like CPU_AND,
CPU_OR, etc. and the GLIBC versions was in the number of arguments:
FreeBSD used a 2-address scheme (one source argument is also used as
the destination of the operation), while GLIBC uses a 3-adderess
scheme (2 source operands and a separately passed destination).

The GLIBC scheme provides a super-set of the functionality of the
FreeBSD macros, since it does not prevent passing the same variable
as source and destination arguments. In code that wanted to preserve
both source arguments, the FreeBSD macros required a temporary copy of
one of the source arguments.

This patch set allows to unconditionally provide functions and macros
expected by 3rd party software written for GLIBC based systems, but
breaks builds of externally maintained sources that use any of the
following macros: CPU_AND, CPU_ANDNOT, CPU_OR, CPU_XOR.

One contributed driver (contrib/ofed/libmlx5) has been patched to
support both the old and the new CPU_OR signatures. If this commit
is merged to -STABLE, the version test will have to be extended to
cover more ranges.

Ports that have added -D_WITH_CPU_SET_T to build on -CURRENT do
no longer require that option.

The FreeBSD version has been bumped to 1400046 to reflect this
incompatible change.

Reviewed by: kib
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D33451

2 years agoAvoid emitting popcnt in libclang_rt.fuzzer*.a if unsupported
Dimitry Andric [Thu, 30 Dec 2021 09:53:25 +0000 (10:53 +0100)]
Avoid emitting popcnt in libclang_rt.fuzzer*.a if unsupported

Since popcnt is only supported by CPUTYPE=nehalem and later, ensure that
this instruction is only emitted when appropriate. Otherwise, programs
using the library can abort with SIGILL.

See also: https://github.com/llvm/llvm-project/issues/52893

PR: 258156
Reported by: Eric Rucker <bhtooefr@bhtooefr.org>
MFC after: 3 days

2 years agouma: with KTR trace allocs/frees from SMR zones
Gleb Smirnoff [Thu, 30 Dec 2021 07:08:15 +0000 (23:08 -0800)]
uma: with KTR trace allocs/frees from SMR zones

2 years agouma: with KTR report item being freed in uma_zfree_arg()
Gleb Smirnoff [Thu, 30 Dec 2021 07:08:15 +0000 (23:08 -0800)]
uma: with KTR report item being freed in uma_zfree_arg()

2 years agoktrdump: properly parse %% in the format string
Gleb Smirnoff [Thu, 30 Dec 2021 07:08:15 +0000 (23:08 -0800)]
ktrdump: properly parse %% in the format string

Discovered by: 27ca37acb7c25

2 years agoImprove extents verification logic
Fedor Uporov [Fri, 24 Dec 2021 14:18:15 +0000 (17:18 +0300)]
Improve extents verification logic

Add functionality for extents validation inside the filesystem
extents block. The main logic is implemented under
ext4_validate_extent_entries() function, which verifies extents
or extents indexes depending of extent depth value.

PR:                     259112
Reported by:            Robert Morris
Reviewed by:            pfg
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D33375

2 years agoAdd more accurate check for root inode
Fedor Uporov [Fri, 24 Dec 2021 14:11:25 +0000 (17:11 +0300)]
Add more accurate check for root inode

Check that root inode has links and is directory.

PR:             259105
Reported by:    Robert Morris
MFC after:      2 weeks

2 years agoAdd more accurate directory entries check
Fedor Uporov [Fri, 29 Oct 2021 12:45:50 +0000 (15:45 +0300)]
Add more accurate directory entries check

Rename ext2_dirbadentry() to ext2_check_direntry(). Add directory
entry inode value check, and call ext2_check_direntry() in all cases.
The dirchk sysctl is removed.

PR:                     259024,259041
Reported by:            Robert Morris
Reviewed by:            pfg
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D33374

2 years agoRemove unnecessary e2fs_first_dblock value check
Fedor Uporov [Fri, 24 Dec 2021 14:05:04 +0000 (17:05 +0300)]
Remove unnecessary e2fs_first_dblock value check

MFC after:      2 weeks

2 years agoCTL: Allow I/Os up to 8MB, depending on maxphys value.
Alexander Motin [Thu, 30 Dec 2021 03:58:52 +0000 (22:58 -0500)]
CTL: Allow I/Os up to 8MB, depending on maxphys value.

For years CTL block backend limited I/O size to 1MB, splitting larger
requests into sequentially processed chunks.  It is sufficient for
most of use cases, since typical initiators rarely use bigger I/Os.

One of known exceptions is VMWare VAAI offload, by default sending up
to 8 4MB EXTENDED COPY requests same time.  CTL internally converted
those into 32 1MB READ/WRITE requests, that could overwhelm the block
backend, having finite number of processing threads and making more
important interactive I/Os to wait in its queue.  Previously it was
partially covered by CTL core serializing sequential reads to help
ZFS speculative prefetcher, but that serialization was significantly
relaxed after recent ZFS improvements.

With the new settings block backend receives 8 4MB requests, that
should be easier for both CTL itself and the underlying storage.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

2 years ago/dev/crypto: Store blocksize in cse rather than txform pointer.
John Baldwin [Thu, 30 Dec 2021 01:50:23 +0000 (17:50 -0800)]
/dev/crypto: Store blocksize in cse rather than txform pointer.

Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33614

2 years ago/dev/crypto: Minimize cipher-specific logic.
John Baldwin [Thu, 30 Dec 2021 01:50:03 +0000 (17:50 -0800)]
/dev/crypto: Minimize cipher-specific logic.

Rather than duplicating the switches in crypto_auth_hash() and
crypto_cipher(), copy the algorithm constants from the new session
ioctl into a csp directly which permits using the functions in
crypto.c.

Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33613

2 years agoOCF: Hook up plain RIPEMD160 in cryptosoft and /dev/crypto.
John Baldwin [Thu, 30 Dec 2021 00:46:48 +0000 (16:46 -0800)]
OCF: Hook up plain RIPEMD160 in cryptosoft and /dev/crypto.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33612

2 years agoiscsi: Handle large Text responses.
John Baldwin [Wed, 29 Dec 2021 22:36:04 +0000 (14:36 -0800)]
iscsi: Handle large Text responses.

Text requests and responses can span multiple PDUs.  In that case, the
sender sets the Continue bit in non-final PDUs and the Final bit in
the last PDU.  The receiver responds to non-final PDUs with an empty
text PDU.

To support this, add a more abstract API in libiscsi which accepts and
receives key sets rather than PDUs.  These routines internally send or
receive one or more PDUs.  Use these new functions to replace the
handling of TextRequest and TextResponse PDUs in discovery sessions in
both ctld and iscsid.

Note that there is not currently a use case for large Text requests
and those are still always sent as a single PDU.  However, discovery
sessions can return a text response listing targets that spans
multiple PDUs, so the new API supports sending and receiving multi-PDU
responses.

Reported by: Jithesh Arakkan @ Chelsio
Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33548

2 years agobhyve smbios type 3 structure is incorrect
Toomas Soome [Sun, 26 Dec 2021 09:01:16 +0000 (11:01 +0200)]
bhyve smbios type 3 structure is incorrect

If you look at the SMBIOS specification, we'll find something is
missing. In particular at offset 0Dh is supposed to be the OEM-defined
field. This should go between security and height. It is not legal to
actually skip this and will lead to other folks not properly
interpreting later parts of the table.

https://www.illumos.org/issues/14312

Reviewed by: jhb
Submitted by: Robert Mustacchi <rm@fingolfin.org>
Obtained from: ilumos
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33682

2 years agobhyve: clean up trailing whitespaces
Toomas Soome [Sun, 26 Dec 2021 07:52:38 +0000 (09:52 +0200)]
bhyve: clean up trailing whitespaces

Clean up trailing whitespaces. No functional changes.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33681

2 years agolibc: Fix build with -DNS_REREAD_CONF.
Alexander Motin [Wed, 29 Dec 2021 22:00:17 +0000 (17:00 -0500)]
libc: Fix build with -DNS_REREAD_CONF.

MFC after: 3 days

2 years agorouting: Add unified level-based logging support for the routing subsystem.
Alexander V. Chernikov [Sun, 26 Dec 2021 18:42:12 +0000 (18:42 +0000)]
routing: Add unified level-based logging support for the routing subsystem.

Summary: MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33664

2 years agonhops: split nh_family into nh_upper_family and nh_neigh_family.
Alexander V. Chernikov [Sun, 26 Dec 2021 18:07:37 +0000 (18:07 +0000)]
nhops: split nh_family into nh_upper_family and nh_neigh_family.

With IPv4 over IPv6 nexthops and IP->MPLS support, there is a need
 to distingush "upper" e.g. traffic family and "neighbor" e.g. LLE/gateway
 address family. Store them explicitly in the private part of the nexthop data.

While here, store nhop fibnum in nhop_prip datastructure to make it self-contained.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33663

2 years ago[lltable] Add per-family lltable getters.
Alexander V. Chernikov [Sun, 26 Dec 2021 12:39:26 +0000 (12:39 +0000)]
[lltable] Add per-family lltable getters.

Introduce a new function, lltable_get(), to retrieve lltable pointer
 for the specified interface and family.
Use it to avoid all-iftable list traversal when adding or deleting
 ARP/ND records.

Differential Revision: https://reviews.freebsd.org/D33660
MFC after: 2 weeks

2 years agovfs_mountroot: Check for root dev before waiting
Colin Percival [Mon, 20 Dec 2021 17:55:36 +0000 (09:55 -0800)]
vfs_mountroot: Check for root dev before waiting

If GEOM is idle but the root device is not yet present when we enter
vfs_mountroot_wait_if_necessary, we call vfs_mountroot_wait to wait
for root holds (e.g. CAM or USB initialization).  Upon returning from
vfs_mountroot_wait, we wait 100 ms at a time until the root device
shows up.

Since the root device most likely appeared during vfs_mountroot_wait
-- waiting for subsystems which may be responsible for the root
device is the whole purpose of that function -- it makes sense to
check if the device is now present rather than printing a warning
and pausing for 100 ms before checking.

Reviewed by: trasz
Fixes: a3ba3d09c248 Make root mount wait mechanism smarter
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33593

2 years agovfs_mountroot: Wait for GEOM idle post root holds
Colin Percival [Mon, 20 Dec 2021 17:51:34 +0000 (09:51 -0800)]
vfs_mountroot: Wait for GEOM idle post root holds

In the case of a root hold related to the initialization of a disk
device, a flurry of GEOM tasting is likely to take place as soon as
the device is initialized and the root hold is released.  If we
don't wait for GEOM idle it's easy for vfs_mountroot to "win" the
race and proceed before the root filesystem GEOM is ready.

Reviewed by: imp
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33592

2 years agovfs_mountroot: Skip 'Root mount waiting' < 1 s
Colin Percival [Mon, 20 Dec 2021 15:17:25 +0000 (07:17 -0800)]
vfs_mountroot: Skip 'Root mount waiting' < 1 s

While the message is technically correct, it's not particularly
helpful in the case where we're only waiting a few ms; this case
occurs frequently on EC2 arm64 instances with CAM initialization
racing to release its root hold before vfs_mountroot reaches this
point.  Only print the message if we end up waiting for more than
one second.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33591

2 years agoreadelf: add Go Build ID ELF note support
Ed Maste [Fri, 10 Dec 2021 20:11:45 +0000 (15:11 -0500)]
readelf: add Go Build ID ELF note support

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33379

2 years agoar: deprecate -T option
Ed Maste [Wed, 29 Dec 2021 19:59:06 +0000 (14:59 -0500)]
ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR: 260523 [exp-run]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoMove libc++ from /usr/lib to /lib
Ed Maste [Wed, 29 Dec 2021 19:50:03 +0000 (14:50 -0500)]
Move libc++ from /usr/lib to /lib

As with other runtime components like libc or libcxxrt.

If desired we can stop linking devd statically after this change (to
achive approximately no net change in required root filesystem size).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33123

2 years agovm_phys: hide vm_phys_set_pool
Doug Moore [Wed, 29 Dec 2021 17:10:31 +0000 (11:10 -0600)]
vm_phys: hide vm_phys_set_pool

It is only called in the file that defines it, so make it static and
remove the declaration from the header.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D33688

2 years agobhyve: passthru: enable BARs before possibly mmap(2)ing them
Bjoern A. Zeeb [Thu, 23 Dec 2021 14:59:49 +0000 (14:59 +0000)]
bhyve: passthru: enable BARs before possibly mmap(2)ing them

The first time we start bhyve with a passthru device everything is fine
as on boot we do enable BARs.  If a driver (unload) inside bhyve disables
the BAR(s) as some Linux drivers do, we need to make sure we re-enable
them on next bhyve start.

If we are trying to mmap a disabled BAR for MSI-X (PCIOCBARMMAP)
the kernel will give us an EBUSY.
While we were re-enabling the BAR(s) in the current code loop
cfginit() was writing the changes out too late to the real hardware.

Move the call to init_msix_table() after the register on the real
hardware was updated.  That way the kernel will be happy and the
mmap will succeed and bhyve will start.
Also simplify the code given the last argument to init_msix_table()
is unused we do not need to do checks for each bar. [1]

MFC after: 3 days
PR: 260148
Pointed out by: markj [1]
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D33628

2 years agoigc: Remove redundant IFCAP_VLAN_HWTAGGING check
Kevin Bowling [Wed, 29 Dec 2021 16:37:34 +0000 (09:37 -0700)]
igc: Remove redundant IFCAP_VLAN_HWTAGGING check

Match igb(4) as in f7926a6d0c10. From Vincenzo, this check is redundant
to setup providing us an IGC_RXD_STAT_VP bit and would make for an
unexpected condition if IFCAP_VLAN_HWTAGGING were not set but the tag
was stripped, which would be passed up the stack breaking isolation.

PR: 260068
Approved by: vmaffione
MFC after: 1 month

2 years agoMove fork_rfppwait() check into ast()
Edward Tomasz Napierala [Sun, 26 Dec 2021 17:22:16 +0000 (17:22 +0000)]
Move fork_rfppwait() check into ast()

This will always sleep at least once, so it's a slow path by definition.

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D33387

2 years agoLet powerpc64le live as not experimental architecture.
Piotr Kubaj [Tue, 21 Dec 2021 23:10:09 +0000 (00:10 +0100)]
Let powerpc64le live as not experimental architecture.

Summary: It's currently just as stable as powerpc64, with more ports working.

Reviewers: alfredo, bdragon, luporl, jhibbits, #manpages

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D33610

2 years agoAdd the missing terminator to the bcm_xhci methods
Andrew Turner [Wed, 29 Dec 2021 12:18:10 +0000 (12:18 +0000)]
Add the missing terminator to the bcm_xhci methods

Sponsored by: The FreeBSD Foundation

2 years agoocs_fc: Updated man page date.
Ram Kishore Vegesna [Wed, 29 Dec 2021 10:45:13 +0000 (16:15 +0530)]
ocs_fc: Updated man page date.

MFC after: 3 days

2 years agoocs_fc: Add lancer G7 to the supported hardware in the man page.
Ram Kishore Vegesna [Fri, 24 Dec 2021 07:24:27 +0000 (12:54 +0530)]
ocs_fc: Add lancer G7 to the supported hardware in the man page.

Reviewed by: mav
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33668