Commit Graph

258425 Commits

Author SHA1 Message Date
Warner Losh
6d6cca3633 nvmecontrol: update copyright on passthru command
I wrote this code, not Intel, so put my copyright on this. I mistakenly
copied it for the initial commit.

Sponsored by:		Netflix
2021-05-06 16:09:31 -06:00
Warner Losh
510a3da147 nvmecontrol: Report status from passthru commands
Report status from dword0 for passthru commands. Many commands report
some status or information here, so reporting it can help know what's
going on.

Sponsored by:		Netflix
2021-05-06 16:09:31 -06:00
Warner Losh
e713d3a013 boot: fix OBJS to not include BTX's crt0.o
According to comments in the Makefile, to make pxeboot work we need to
have crt0.o first. This is needed because the simplified loader in
pxeboot assumes that the startup code is at offset 0 in this binary. In
normal booting, the start address can be obtained from headers of the
binary, but since pxeboot encodes this as a pure binary, it has no way
of knowing where that is and assumes 0. Added comments to that effect
in the Makefile.

We've done this by adding it to OBJS before all the other .o's are
added. However, there's a problem. This also adds it to the CLEANFILES
variable, which causes it to be removed from multiple places. The
dependencies may also cause it to be re-built at a time that's after
boot2 is built. This causes installs to fail because at install time
boot2 is considered to be out of date and the programs to rebuild it are
no longer in the path.

Cope with this problem by just adding it to LDFLAGS instead.

Glanced at by:		kevans ("I thought that went in ages ago")
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D28876
2021-05-06 13:08:30 -06:00
Andriy Gapon
12588ce02d PCI hot-plug: use dedicated taskqueue for device attach / detach
Attaching and detaching devices can be heavy-weight and detaching can
sleep waiting for events.  For that reason using the system-wide
single-threaded taskqueue_thread is not really appropriate.
There is even a possibility for a deadlock if taskqueue_thread is used
for detaching.

In fact, there is an easy to reproduce deadlock involving nvme, pass
and a sudden removal of an NVMe device.
A pass peripheral would not release a reference on an nvme sim until
pass_shutdown_kqueue() is executed via taskqueue_thread.  But the
taskqueue's thread is blocked in nvme_detach() -> ... -> cam_sim_free()
because of the outstanding reference.

MFC after:	10 days
Sponsored by:	CyberSecure
Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D30144
2021-05-06 21:49:37 +03:00
Alan Somers
420dbe763f gmultipath: make physpath distinct from the underlying providers'
zfsd uses a device's physical path attribute to automatically replace a
missing ZFS disk when a blank disk is inserted into the same physical
slot.  Currently gmultipath passes through its underlying providers'
physical path attribute.  That may cause zfsd to replace a missing
gmultipath provider with a newly arrived, single-path disk.  That would
be bad.

This commit fixes that problem by simply appending "/mp" to the
underlying providers' physical path, in a manner similar to what geli
already does.

Sponsored by:	Axcient
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D29941
2021-05-06 12:32:27 -06:00
Gleb Smirnoff
be578b67b5 tcp_twcheck(): use correct unlock macro.
This crippled in due to conflict between two last commits 1db08fbe3f
and 9e644c2300.

Submitted by:	Peter Lei
2021-05-06 10:19:21 -07:00
Randall Stewart
5d8fd932e4 This brings into sync FreeBSD with the netflix versions of rack and bbr.
This fixes several breakages (panics) since the tcp_lro code was
committed that have been reported. Quite a few new features are
now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the
largest). There is also support for ack-war prevention. Documents
comming soon on rack..

Sponsored by:           Netflix
Reviewed by:		rscheff, mtuexen
Differential Revision:	https://reviews.freebsd.org/D30036
2021-05-06 11:22:26 -04:00
Andrew Turner
0ec3e99111 Use '.arch_extension crc' in the arm64 crc32 code
We don't care about the base architecture here, just that the crc
extension is enabled.

Sponsored by:	Innovate UK
2021-05-06 07:42:35 +00:00
Edward Tomasz Napierala
916f3dba45 linux(4): make arch_prctl(2) support GET_CET_STATUS, report unknown codes
This is largely a no-op, to make future debugging slightly easier.

Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30035
2021-05-06 09:33:42 +01:00
Justin Hibbits
49c894ddce powerpc64: Split out DMAP and non-DMAP implementations of some methods
Summary:
Some methods are split between DMAP and non-DMAP, conditional on
hw_direct_map variable.  Rather than checking this variable every time,
use it to install different functions via IFUNCs.

Reviewed By: luporl
Differential Revision: https://reviews.freebsd.org/D30071
2021-05-05 20:57:33 -05:00
Justin Hibbits
6640579610 msun fixes for SPE
Summary:
Fix FPU exception management for powerpcspe.  Bits are in a different place from
the standard FPSCR, so we need to handle the shifting differences.  Also,
there's no concept of a "software exception" raise, so we need to do exceptional
math to trigger the exception from software.

Reviewed By: alfredo
Differential Revision: https://reviews.freebsd.org/D22824
2021-05-05 20:57:33 -05:00
Michael Tuexen
d1cb8d11b0 sctp: improve consistency when handling chunks of wrong size
MFC after:	3 days
2021-05-06 01:02:41 +02:00
Warner Losh
097e8701c9 fix style nit: space after if 2021-05-05 15:26:09 -06:00
Warner Losh
d00aff6278 provide easy way to disable kld_list loading
set kld_disbale=y or any value in the boot loader and that will
disable loading of the kld_list.

Differential Revision: https://reviews.freebsd.org/D26939
2021-05-05 15:19:41 -06:00
Warner Losh
f009aedae4 bsnmpd: Return the correct uptime.
Do not assume that the kernel boot time is invariant. It is not. FreeBSD
uses the formula:
	wall_time = boot_time + uptime
where uptime is monotinically increasing and boot_time is adjusted to
get the proper time of day.  FreeBSD offers a way to retrieve the uptime
directly, so use that instead of trying to compute it by subtracting
boot_time from wall_time.

Sponsored by:		Netflix
Reviewed by:		cy@
Differential Revision:	https://reviews.freebsd.org/D30114
2021-05-05 15:12:38 -06:00
Mark Johnston
6c34dde83e igmp: Avoid an out-of-bounds access when zeroing counters
When verifying, byte-by-byte, that the user-supplied counters are
zero-filled, sysctl_igmp_stat() would check for zero before checking the
loop bound.  Perform the checks in the correct order.

Reported by:	KASAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-05-05 17:12:51 -04:00
Mark Johnston
9a7c2de364 realloc: Fix KASAN(9) shadow map updates
When copying from the old buffer to the new buffer, we don't know the
requested size of the old allocation, but only the size of the
allocation provided by UMA.  This value is "alloc".  Because the copy
may access bytes in the old allocation's red zone, we must mark the full
allocation valid in the shadow map.  Do so using the correct size.

Reported by:	kp
Tested by:	kp
Sponsored by:	The FreeBSD Foundation
2021-05-05 17:12:51 -04:00
John Baldwin
1b2806931a src.conf.5: Regen.
Reviewed by:	emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30107
2021-05-05 14:11:33 -07:00
John Baldwin
0ac711e07e Add a description for WITH_SVNLITE.
Reviewed by:	emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30106
2021-05-05 14:11:32 -07:00
John Baldwin
a2bc17474b Disable building svnlite(1) by default.
Now that all repositories have switched to git, initiate the de-orbit
burn for svnlite(1).

Reviewed by:	emaste
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D30105
2021-05-05 14:11:13 -07:00
John Baldwin
9c87db4b3c Group all compat shim structures together to consolidate #ifdef's.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29894
2021-05-05 13:59:09 -07:00
John Baldwin
01e9cbc4c5 Use thunks for compat ioctls using struct ifgroupreq.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29893
2021-05-05 13:59:00 -07:00
John Baldwin
d61d98f4ed Add freebsd32 compat shims for SIOC[GS]DRVSPEC.
Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29892
2021-05-05 13:58:50 -07:00
John Baldwin
d17e0940f7 Rework compat shims in ifioctl().
Centralize logic for handling compat ioctls into two blocks of code at
the start and end of the ioctl routine.  This avoids the conversion
logic being spread out both in multiple blocks in ifioctl as well as
various helper functions.

Reviewed by:	brooks, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D29891
2021-05-05 13:58:23 -07:00
Warner Losh
a512d0ab00 kern: clarify boot time
In FreeBSD, the current time is computed from uptime + boottime. Uptime
is a continuous, smooth function that's monotonically increasing. To
effect changes to the current time, boottime is adjusted.  boottime is
mutable and shouldn't be cached against future need. Document the
current implementation, with the caveat that we may stop stepping
boottime on resume in the future and will step uptime instead (noted in
the commit message, but not in the code).

Sponsored by:		Netflix
Reviewed by:		phk, rpokala
Differential Revision:	https://reviews.freebsd.org/D30116
2021-05-05 12:32:13 -06:00
Warner Losh
cb58805943 cam: Add doxygen docs to cam_sim_alloc
Add description for what each of the parameters are to the cam_sim_alloc
call. Add some additional context for the mtx and queue parameters to
explain what special values passed in mean.

MFC After:		3 days
Reviewed by:		mav@
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30115
2021-05-05 11:44:39 -06:00
Ka Ho Ng
4e1e1d667f virtio_blk: Fix issuing T_GET_ID before DRIVER_OK status
DRIVER_OK status is set after device_attach() succeeds. For now postpone
disk_create to attach_completed() method.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Reviewed by:	grehan
Approved by:	lwhsu (mentor)
Differential Revision:	https://reviews.freebsd.org/D30049
2021-05-05 23:22:16 +08:00
Ed Maste
cec2682cd2 Restore Cirrus-CI boot smoke test
This reverts commit a7d593dd1d.
We now use compute_engine_instance which allows us to specify a custom
disk size.  Also go back to using the default qemu version (rather than
qemu42 or qemu-devel) as any issues were fixed some time ago.

Reviewed by:	lwhsu, markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30082
2021-05-05 10:05:58 -04:00
Edward Tomasz Napierala
5e8caee259 linux: remove redundant SDT tracepoints
Remove all the 'entry' and 'return' probes; they clutter up the source
and are redundant to FBT.

Reviewed By:	dchagin
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30040
2021-05-05 13:59:00 +01:00
Marko Zec
2aca58e16f Introduce DXR as an IPv4 longest prefix matching / FIB module
DXR maintains compressed lookup structures with a trivial search
procedure.  A two-stage trie is indexed by the more significant bits of
the search key (IPv4 address), while the remaining bits are used for
finding the next hop in a sorted array.  The tradeoff between memory
footprint and search speed depends on the split between the trie and
the remaining binary search.  The default of 20 bits of the key being
used for trie indexing yields good performance (see below) with
footprints of around 2.5 Bytes per prefix with current BGP snapshots.

Rebuilding lookup structures takes some time, which is compensated for by
batching several RIB change requests into a single FIB update, i.e. FIB
synchronization with the RIB may be delayed for a fraction of a second.
RIB to FIB synchronization, next-hop table housekeeping, and lockless
lookup capability is provided by the FIB_ALGO infrastructure.

DXR works well on modern CPUs with several MBytes of caches, especially
in VMs, where is outperforms other currently available IPv4 FIB
algorithms by a large margin.

Synthetic single-thread LPM throughput test method:

kldload test_lookup; kldload dpdk_lpm4; kldload fib_dxr
sysctl net.route.test.run_lps_rnd=N
sysctl net.route.test.run_lps_seq=N

where N is the number of randomly generated keys (IPv4 addresses) which
should be chosen so that each test iteration runs for several seconds.

Each reported score represents the best of three runs, in million
lookups per second (MLPS), for two bechmarks (RND & SEQ) with two FIBs:

host: single interface address, local subnet route + default route
BGP: snapshot from linx.routeviews.org, 887957 prefixes, 496 next hops

Bhyve VM on an Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             40.6         20.2         N/A         N/A
radix4                7.8          3.8         1.2         0.6
radix4_lockless      18.0          9.0         1.6         0.8
dpdk_lpm4            14.4          5.0        14.6         5.0
dxr                  70.3         34.7        43.0        19.5

Intel(R) Core(TM) i5-5300U CPU @ 2.30 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             47.0         23.1         N/A         N/A
radix4                8.5          4.2         1.9         1.0
radix4_lockless      19.2          9.5         2.5         1.2
dpdk_lpm4            31.2          9.4        31.6         9.3
dxr                  84.9         41.4        51.7        23.6

Intel(R) Core(TM) i7-4771 CPU @ 3.50 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             59.5         29.4         N/A         N/A
radix4               10.8          5.5         2.5         1.3
radix4_lockless      24.7         12.0         3.1         1.6
dpdk_lpm4            29.1          9.0        30.2         9.1
dxr                 101.3         49.9        69.8        32.5

AMD Ryzen 7 3700X 8-Core Processor @ 3.60 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             70.8         35.4         N/A         N/A
radix4               14.4          7.2         2.8         1.4
radix4_lockless      30.2         15.1         3.7         1.8
dpdk_lpm4            29.9          9.0        30.0         8.9
dxr                 163.3         81.5        99.5        44.4

AMD Ryzen 5 5600X 6-Core Processor @ 3.70 GHz:
inet.algo         host, RND    host, SEQ    BGP, RND    BGP, SEQ
bsearch4             93.6         46.7         N/A         N/A
radix4               18.9          9.3         4.3         2.1
radix4_lockless      37.2         18.6         5.3         2.7
dpdk_lpm4            51.8         15.1        51.6        14.9
dxr                 218.2        103.3       114.0        49.0

Reviewed by:	melifaro
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29821
2021-05-05 13:45:52 +02:00
Marko Zec
a43104ebe7 Revise FIB lookups per second benchmarking routines.
Add a LPS benchmark variant which introduces artificial dependencies
between successive lookups. While here, instead of writing the results
from the lookups to a huge array, add them to an accumulator, in a more
lightweight attempt at preventing the CPU's OOO machinery from
discarding the lookup results if they would be completely unused.

net.route.test.run_lps_rnd measures LPS throughput with independent
uniformly random keys

net.route.test.run_lps_seq measures LPS throughput with uniformly
random keys with artificial interdependencies
Reviewed by:	melifaro
MFC after:	7 days
Differential Revision: https://reviews.freebsd.org/D30096
2021-05-05 12:28:17 +02:00
Warner Losh
122a8c7eb1 param.h: Fix typos
Submitted by:		rpokala@
Sponsored by:		Netflix
2021-05-05 00:50:35 -06:00
Warner Losh
9e0ba9536b param.h: Document __FreeBSD_version better
Document what __FreeBSD_version means a bit better by documenting the
sorts of events it should be bumped for. Also include a handy shorthand
for what it means. Add a some advice for how frequently to change this
as well.

Added a note about the approved way to parse this from the param.h file,
though that was not in the review. All in-tree users have been updated
to this method prior to this commit. Move and reword the comment that
was on the same line.

Suggestions by:		greg@unrelenting, arch@
Reviewed by:		rgrimes@ (earlier version).
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29850
2021-05-05 00:33:56 -06:00
Navdeep Parhar
f4ba035bca cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management.
The _ext event notification includes the address being added/removed and
that gives the driver an easy way to ignore non-IPv6 addresses.  Remove
'tom' from the handler's name while here, it was moved out of t4_tom a
long time ago.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-05-04 20:16:25 -07:00
Philippe Michaud-Boudreault
fe70d7b26d iwmbtfw(8): Add support for Intel 7260/7265 bluetooth adapter firmwares
To use it comms/iwmbt-firmware port should be updated to 20210315 version.

Submitted by:	Philippe Michaud-Boudreault <pitwuu@gmail.com>
Tested by:	Helge Oldach <freebsd@oldach.net>
Reviewed by:	wulf
PR:		228787
MFC after:	2 weeks
2021-05-05 02:50:32 +03:00
Ed Maste
15c0aaf517 Cirrus-CI: switch to Clang/LLVM 12
dim@ is preparing to import Clang/LLVM 12 into the base system as the
system compiler / toolchain.  Apply the same change to the Cirrus-CI
config.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30109
2021-05-04 17:07:11 -04:00
Lutz Donnerhacke
b1bd44732d netgraph/ng_bridge: learn MACs via control message
Add a new control message to move ethernet addresses to a given link
in ng_bridge(4). Send this message instead of doing the work directly.
This decouples the read-only activity from the modification under a
more strict writer lock.

Decoupling the work is a prerequisite for multithreaded operation.

Approved by:	manpages (bcr), kp (earlier version)
MFC:		3 weeks
Differential Revision:	https://reviews.freebsd.org/D28516
2021-05-04 22:14:59 +02:00
Warner Losh
36be84b966 ttys: diff reduction
Back in the day, we used to have a number of entries that were either
'on' or 'off' directly, rather than conditionally on 'onifexists'
etc. Back then, we tried to line up the 'secure' columns by using the
construct 'on secure' or 'off secure' (one space or two). Now that these
have all moved to a conditional construct, remove the second space on
the ttys that still have it. This reduces diffs between the different
ttys and is no functional change. i386 and amd64 did this a long time
ago, and those are the only ones that affected external users (who used
to sed 's/on /off /' the entires as part of the automation).

MFC After:		3 days
Sponsored by:		Netflix
2021-05-04 14:06:31 -06:00
Michael Tuexen
b621fbb1bf sctp: drop packet with SHUTDOWN-ACK chunks with wrong vtags
MFC after:	3 days
2021-05-04 18:43:31 +02:00
Edward Tomasz Napierala
1bffa44166 ptrace: document ENOMEM
Reviewed By:	emaste, markj
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D29960
2021-05-04 15:22:42 +01:00
Edward Tomasz Napierala
023bff7990 linux(4): fix ptrace(2) to properly handle orig_rax
This fixes strace(1) erroneously reporting return values
as "Function not implemented", combined with reporting the binary
ABI as X32.

Very similar code in linux_ptrace_getregs() is left as it is - it's
probably wrong too, but I don't have a way to test it.

Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D29927
2021-05-04 15:21:06 +01:00
Mark Johnston
b59851e99c path_test: Add a few new test cases
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-05-04 08:56:31 -04:00
Mark Johnston
8bde6d15d1 nfsclient: Copy only initialized fields in nfs_getattr()
When loading attributes from the cache, the NFS client is careful to
copy only the fields that it initialized.  After fetching attributes
from the server, however, it would copy the entire vattr structure
initialized from the RPC response, so uninitialized stack bytes would
end up being copied to userspace.  In particular, va_birthtime (v2 and
v3) and va_gen (v3) had this problem.

Use a common subroutine to copy fields provided by the NFS client, and
ensure that we provide a dummy va_gen for the v3 case.

Reviewed by:	rmacklem
Reported by:	KMSAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30090
2021-05-04 08:53:57 -04:00
Edward Tomasz Napierala
ee384b229d linux(4): make linkat(2) handle AT_EMPTY_PATH
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D29974
2021-05-04 13:09:46 +01:00
Baptiste Daroussin
3657010266 pci_vendors: update to 2021-05-04 2021-05-04 14:03:07 +02:00
Peter Holm
c85b57ac01 stress2: New test scenario added 2021-05-04 12:55:58 +02:00
Rick Macklem
0755df1eee nfscl: fix typo in a comment
MFC after:	2 weeks
2021-05-03 18:29:27 -07:00
Dimitry Andric
64fe4400da Add a few missed libauditd files to ObsoleteFiles.inc 2021-05-03 22:47:41 +02:00
Dimitry Andric
0dad05dd30 Add a few missed libalias_cuseeme files to ObsoleteFiles.inc 2021-05-03 22:45:08 +02:00
Dimitry Andric
1c3dcf8d57 Add a few missed libprivateevent files to ObsoleteFiles.inc 2021-05-03 22:43:39 +02:00