Commit Graph

275341 Commits

Author SHA1 Message Date
John Baldwin
83a273efce dev/amd*: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 12:22:00 -07:00
Ruslan Bukin
b7fca06bbf Split-out SID-getting code to a separate functions.
Also ensure we are dealing with PCI-class devices.

Sponsored by:	UKRI
2022-05-09 20:13:57 +01:00
Dmitry Chagin
7b76c79b0b linux(4): Regen for prctl fix.
MFC after:		2 weeks
2022-05-09 21:48:15 +03:00
Dmitry Chagin
bfae7fbaa2 linux(4): Fix 039e98e6.
The patch was about an year in my local queue and I still screwed up...

MFC after:		2 weeks
2022-05-09 21:45:51 +03:00
Dmitry Chagin
109c2bd212 linux(4); Style.
MFC after:		2 weeks
2022-05-09 21:16:48 +03:00
Dmitry Chagin
07d108932a linux(4): Return native error from futex_atomic_op to avoid conversion by the caller.
MFC after:		2 weeks
2022-05-09 21:16:31 +03:00
Dmitry Chagin
b17446281d linux(4): Fixed offset miscalculation in the preadv/pwritev syscalls.
MFC after:		2 weeks
2022-05-09 21:11:37 +03:00
Dmitry Chagin
e768576718 linux(4): Regen for prctl syscall.
MFC after:		2 weeks
2022-05-09 21:10:48 +03:00
Dmitry Chagin
039e98e60c linux(4): Change prctl syscall definition to match Linux actual one.
Otherwise argX conversion leads to an unexpected behaviour.

MFC after:		2 weeks
2022-05-09 21:09:39 +03:00
Dmitry Chagin
5eec19c8eb linux(4): The futex_wait operation should restart.
It's ok from the futex_wait perspective as umtxq_sleep method uses
absolute sleep timeout.

MFC after:		2 weeks
2022-05-09 21:08:59 +03:00
Gleb Smirnoff
9c328531f0 domains: undocument dom_destroy() and fix .Dd
Fixes:	24e1c6ae7d
2022-05-09 10:53:10 -07:00
Gleb Smirnoff
7db54446c6 sockbufs: make sbrelease_internal() private 2022-05-09 10:43:01 -07:00
Gleb Smirnoff
a982ce0442 sockets: remove the socket-on-stack hack from sorflush()
The hack can be tracked down to 4.4BSD, where copy was performed
under splimp() and then after splx() dom_dispose was called.
Stevens has a chapter on this function, but he doesn't answer why
this trick is necessary.  Why can't we call into dom_dispose under
splimp()?  Anyway, with multithreaded kernel the hack seems to be
necessary to avoid LORs between socket buffer lock and different
filesystem locks, especially network file systems.

The new socket buffers KPI sbcut() from 1d2df300e9 allow us to get
rid of the hack.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35125
2022-05-09 10:43:01 -07:00
Gleb Smirnoff
42f2fa9953 sockets: don't call dom_dispose() on a listening socket
sorflush() already did the right thing, so only sofree() needed
a fix.  Turn check into assertion in our only dom_dispose method.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35124
2022-05-09 10:42:57 -07:00
Gleb Smirnoff
c17418a0ba sockets: assert that any protocol with PR_RIGHTS has dom_dispose()
Through the entire history only PF_UNIX has this feature.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35123
2022-05-09 10:42:48 -07:00
Gleb Smirnoff
2400c536b4 tests/unix_passfd: add test for shutdown(2) on a buffer with an fd
This has two goals:
- Exercize call to unp_dispose() via soshutdown() instead of sofree()
- Make sure that shutdown indeed dereferences the fd stored

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35122
2022-05-09 10:42:48 -07:00
Gleb Smirnoff
7496792841 ng_socket: don't assign NULL in C99 sparse initializer 2022-05-09 10:42:48 -07:00
Gleb Smirnoff
607beb88af bluetooth: don't assign NULL in C99 sparse initializer 2022-05-09 10:42:48 -07:00
Gleb Smirnoff
24df85d29a unix/*: unp_internalize() can sleep, so allocate mbufs with M_WAITOK 2022-05-09 10:42:48 -07:00
Gleb Smirnoff
97f8198e95 sockets: make SO_SND/SO_RCV a enum
Not a functional change now. The enum will also be used for other socket
buffer related KPIs.
2022-05-09 10:42:47 -07:00
Alexander Motin
356155fe02 Fix bd82711aff serial number trailing spaces removal.
For devices returning 16 byte serial numbers with 8 leading spaces
this falsely removed everything due to looking at wrong offset.
2022-05-09 10:30:04 -04:00
Mike Karels
1de9aa4d4f genet: fix output packet corruption in uncommon case
The code for the "shift" block in the COPY macro set the pointer for
the next copy block to the wrong value.  In this case, the link-layer
header would be overwritten by the network-layer header.  This case is
difficult or impossible to exercise in the current driver without
changing the value of the hw.genet.tx_hdr_min sysctl.  Correct the
pointer.  While here, remove a line in the macro that was marked
"unneeded", which was actually wrong.

PR:		263824
Submitted by:	jiahali@blackberry.com
MFC after:	2 weeks
2022-05-09 08:46:06 -05:00
Adam S
dc484aed0a asmc: Update Mac Pro 6 sensor definitions
- Make descriptions a bit more human-friendly.
- Don't attempt to probe fan safe speeds, this model does not provide
  one.

PR:		260781
MFC after:	2 weeks
2022-05-09 08:56:39 -04:00
Ruslan Bukin
f224006fe1 Allocate resources selectively.
One of the SMMU interrupt lines (priq) is optional and may be ommited in FDT.

Tested on ARM Morello Board, which has three SMMU units: first two have four
interrupt lines, last one has three interrupt lines.

Sponsored by: UKRI
2022-05-09 13:30:37 +01:00
Ruslan Bukin
0a8e88fa73 Change __unused to __diagused.
Pointed out by:	jhb
Sponsored by:	UKRI
2022-05-09 11:24:47 +01:00
Dmitry Chagin
c6df217603 linux(4): Use the right function to get the bit index in vdso binuptime.
This is modeled after a1f93266 (by kib@).

MFC after:		2 weeks
2022-05-08 17:20:52 +03:00
Dmitry Chagin
5a6a4fb284 linux(4): Implement vdso getcpu for x86.
This is modeled after f2395455 (by kib@).

MFC after:		2 weeks
2022-05-08 17:20:52 +03:00
Dmitry Chagin
332eca05b5 linux(4): Refactor vdso_gettc_x86 includes.
Factor out includes from common vdso_gettc_x86 file to the corresponding
MD files.

MFC after:		2 weeks
2022-05-08 17:20:51 +03:00
Dmitry Chagin
707e567a40 linux(4): Add a helper intended for copying timespec's from the userspace.
There are many places where we copyin Linux timespec from the userspace
and then convert it to the kernel timespec. To avoid code duplication
add a tiny halper for doing this.

MFC after:		2 weeks
2022-05-08 16:16:47 +03:00
Dmitry Chagin
3dc2a06752 linux(4): Prevent time_t overflows on i386.
As native i386 time_t is still 32-bit, check that the user-provided 64-bit
tv_sec value fits to the kernel time_t, return EOVERFLOW if not.

MFC after:		2 weeks
2022-05-08 15:39:09 +03:00
Dmitry Chagin
1579b320f1 linux(4): Zero out high order bits of nanoseconds in the compat mode.
Assuming the kernel would use random data, the 64-bit Linux kernel ignores
upper 32 bits of tv_nsec of struct timespec64 for 32-bit binaries.

MFC after:		2 weeks
2022-05-08 15:38:19 +03:00
Dmitry Chagin
9a9482f874 linux(4): Add a helper intended for copying timespec's to the userspace.
There are many places where we convert natvie timespec and copyout it to
the userspace. To avoid code duplication add a tiny halper for doing this.

MFC after:		2 weeks
2022-05-08 15:37:27 +03:00
Dmitry Chagin
61f45f6733 linux(4): Regen for ppoll_time64 syscall.
MFC after:		2 weeks
2022-05-08 13:38:17 +03:00
Dmitry Chagin
94f5f150ef linux(4): Fix ppoll_time64 syscall definition.
Fixed my typo in ed61e0ce1d. Here tsp is a pointer to the 64-bit timespec.

MFC after:		2 weeks
2022-05-08 13:37:48 +03:00
Peter Holm
13aacd0c0c stress2: Added a test scenario 2022-05-08 09:54:54 +02:00
Kristof Provost
cbbce42345 epair: unbind prior to returning to userspace
If 'options RSS' is set we bind the epair tasks to different CPUs. We
must take care to not keep the current thread bound to the last CPU when
we return to userspace.

MFC after:	1 week
Sponsored by:	Orange Business Services
2022-05-07 18:17:33 +02:00
Kristof Provost
017e7d0390 in_rss: fix set but not used warning
If 'options RSS' is set.

MFC after:	1 week
Sponsored by:	Orange Business Services
2022-05-07 18:17:33 +02:00
Kristof Provost
a6b0c8d04d epair: fix set but not used warning
If 'options RSS' is set.

MFC after:	1 week
Sponsored by:	Orange Business Services
2022-05-07 18:17:32 +02:00
Warner Losh
2f44ad86f5 dmesg: Better wording from review
I pushed the last changes before I'd noticed the better wording
suggestions in the review. Also include a note that not all lines will
have a timestampe. Some multi-line messages are generated with sbuf, and
when those are pushed, only the first line will have the
timestamp. Document this quirky behavior as well since fixing it likely
won't happen soon. CAM periph drivers generate all the lines in their
announce message together so they aren't intermingled with other things,
for example.

Suggested by:		allanjude, emaste, rpokala
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D35139
Differential Revision:	https://reviews.freebsd.org/D35141
2022-05-07 09:55:40 -06:00
Warner Losh
2e32d4e41d param.h: Bump FreeBSD_Version to 1400058 for devclass newbus changes
jhb changed the newbus ABI and it's affecting some ports. Bump the
version to give them something to key off of for the removal of the
devclass arg from some macros. In theory the change should have been
ABI neutral, but there some build breakage with drm-kmod so better
to bump than not.

Sponsored by:		Netflix
2022-05-07 09:32:47 -06:00
Warner Losh
45ae223ac6 msgbuf: Allow microsecond granularity timestamps
Today, kern.msgbuf_show_timestamp=1 will give 1 second granularity
timestamps on dmesg lines. When kern.msgbuf_show_timestamp=2, we'll
produce microsecond level graunlarity.
For example:
old (== 1):
[13] Dual Console: Video Primary, Serial Secondary
[14] lo0: link state changed to UP
[15] bxe0: NIC Link is Up, 10000 Mbps full duplex, Flow control: ON - receive & transmit
[15] bxe0: link state changed to UP
new (== 2):
[13.807015] Dual Console: Video Primary, Serial Secondary
[14.544150] lo0: link state changed to UP
[15.272044] bxe0: NIC Link is Up, 10000 Mbps full duplex, Flow control: ON - receive & transmit
[15.272052] bxe0: link state changed to UP

Sponsored by:		Netflix
2022-05-07 09:32:22 -06:00
Warner Losh
6910fee62e dmesg: Document kern.msgbuf_show_timestamp
kern.msgbuf_show_timestamp=1 turns on timestamps in kernel's message
buffer which dmesg(8) prints.

Sponsored by:		Netflix
2022-05-07 09:32:21 -06:00
Ruslan Bukin
a5ec261a7c Add FDT attachment driver for ARM System MMU v3.2 controller.
Tested on ARM Morello Board.

Sponsored by:	UKRI
2022-05-07 11:18:35 +01:00
Ruslan Bukin
7d0bbf43fd Change iommu list lock to SX as we need a sleepable lock so we
can call to ofw_bus_iommu_map().

Sponsored by:	UKRI
2022-05-07 11:15:07 +01:00
Ruslan Bukin
59446e8ac0 Fix !INVARIANTS build.
Sponsored by:	UKRI
2022-05-07 10:45:33 +01:00
Ruslan Bukin
8b8e56dd5b Check if iommu ctx is valid before passing it to functions.
Differential Revision:	https://reviews.freebsd.org/D35130
Sponsored by:	UKRI
2022-05-07 10:27:17 +01:00
Ruslan Bukin
6ff004272a Return error code from IOMMU_MAP and fix build.
Sponsored by:	UKRI
2022-05-07 10:24:30 +01:00
Ruslan Bukin
b7672a7025 Add OFW_IOMMU id type for pci_get_id() so we can ask parent IOMMU
controller to map PCI RID to an IOMMU specifier.

Sponsored by:	UKRI
Discussed with:	jhb
Differential Revision: https://reviews.freebsd.org/D35129
2022-05-07 10:21:09 +01:00
Ed Maste
904c148f1c libutil: eliminate one syscall from kinfo_getproc
Previously we invoked the sysctl with a NULL buffer to query the size,
allocated a buffer, then invoked it again to fetch the data.

As we only handle the case where the sysctl provides data of the
expected size we can just allocate a correctly-sized buffer to begin
with.

Reported by:	Thomas Hurst via Twitter
Reviewed by:	kevans
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35140
2022-05-06 20:06:09 -04:00
Alan Somers
1d2421ad8b Correctly measure system load averages > 1024
The old fixed-point arithmetic used for calculating load averages had an
overflow at 1024.  So on systems with extremely high load, the observed
load average would actually fall back to 0 and shoot up again, creating
a kind of sawtooth graph.

Fix this by using 64-bit math internally, while still reporting the load
average to userspace as a 32-bit number.

Sponsored by:	Axcient
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D35134
2022-05-06 17:25:43 -06:00