Commit Graph

247924 Commits

Author SHA1 Message Date
Mateusz Piotrowski
2125f57a16 Replace *-out with star-out to ease legibility
"*-out" is a complex way of phrasing the fact, and it causes
confusion for people.

Submitted by:	debdrup
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D23482
2020-02-03 23:30:47 +00:00
Navdeep Parhar
44c6fea82b cxgbe(4): Do not use pack boundary > 512B unless it is explicitly
requested.

This is a tradeoff between PCIe efficiency during large packet rx and
packing efficiency during small packet rx.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:30:39 +00:00
Navdeep Parhar
a9c4062a9a cxgbe(4): Initialize the rx buffer's metadata on first-use and not on
allocation.

refill_fl doesn't touch any part of a freshly allocated cluster after
this change.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:25:12 +00:00
Navdeep Parhar
9087a3df60 cxgbe(4): Only checksummed TCP should be considered for LRO.
This avoids the per-packet nanouptime in tcp_lro_rx for traffic that's
not even TCP.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:06:42 +00:00
Mark Johnston
e489450589 Fix the !SMP case in sched_add() after r355779.
If the thread's lock is already that of the runqueue, don't recurse on
the queue lock.

Reviewed by:	jeff, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23492
2020-02-03 22:49:05 +00:00
Mateusz Guzik
8151b6e92a fd: partially unengrish the previous commit 2020-02-03 22:34:50 +00:00
Mateusz Guzik
e10f063b30 fd: streamline fget_unlocked
clang has the unfortunate property of paying little attention to prediction
hints when faced with a loop spanning the majority of the rotuine.

In particular fget_unlocked has an unlikely corner case where it starts almost
from scratch. Faced with this clang generates a maze of taken jumps, whereas
gcc produces jump-free code (in the expected case).

Work around the problem by providing a variant which only tries once and
resorts to calling the original code if anything goes wrong.

While here note that the 'seq' parameter is almost never passed, thus the
seldom users are redirected to call it directly.
2020-02-03 22:32:49 +00:00
Mateusz Guzik
52604ed792 fd: remove the seq argument from fget_unlocked
It is almost always NULL.
2020-02-03 22:27:55 +00:00
Mateusz Guzik
7f1566f884 fd: remove the seq argument from fget routines
It is almost always NULL.
2020-02-03 22:27:03 +00:00
Mateusz Guzik
4846218d8b seqc: provide seqc_read_any 2020-02-03 22:26:29 +00:00
Mateusz Guzik
0a1427c5ab ktrace: provide ktrstat_error
This eliminates a branch from its consumers trading it for an extra call
if ktrace is enabled for curthread. Given that this is almost never true,
the tradeoff is worth it.
2020-02-03 22:26:00 +00:00
Gleb Smirnoff
0017b2adac Couple protocol drain routines (frag6_drain and sctp_drain) may send
packets.  An unexpected behaviour for memory reclamation routine.
Anyway, we need enter the network epoch for doing that.
2020-02-03 20:48:57 +00:00
Poul-Henning Kamp
446d49d762 Minor cleanups to allow handing vast datasets.
Submitted by: dds
2020-02-03 20:46:31 +00:00
Warner Losh
a743528537 Fix a stray 'e'from my last commit. 2020-02-03 19:36:24 +00:00
Mark Johnston
36cb95c736 Disable the smallest UMA bucket size on 32-bit platforms.
With r357314, sizeof(struct uma_bucket) grew to 16 bytes on 32-bit
platforms, so BUCKET_SIZE(4) is 0.  This resulted in the creation of a
bucket zone for buckets with zero capacity.  A more general fix is
planned, but for now this bandaid allows 32-bit platforms to boot again.

PR:		243837
Discussed with:	jeff
Reported by:	pho, Jenkins via lwhsu
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2020-02-03 19:29:02 +00:00
Mark Johnston
35beedae40 addr2line: Avoid a name collision.
The RB_ macros define functions with a parameter named head, and gcc
warns about this.

MFC with:	r357450
2020-02-03 19:08:35 +00:00
Kyle Evans
3d62f685d5 namei: preserve errors from fget_cap_locked
Most notably, we want to make sure we don't clobber any capabilities-related
errors. This is a regression from r357412 (O_SEARCH) that was picked up by
the capsicum tests.

PR:		243839
Reviewed by:	kib (committed form recommended by)
Tested by:	lwhsu
Differential Revision:	https://reviews.freebsd.org/D23479
2020-02-03 18:59:07 +00:00
Mark Johnston
a83c682b36 Dynamically select LSE-based atomic(9)s on arm64.
Once all CPUs are online, determine if they all support LSE atomics and
set lse_supported to indicate this.  For now the atomic(9)
implementations are still always inlined, though it would be preferable
to create out-of-line functions to avoid text bloat.  This was not done
here since big.little systems exist in which some CPUs implement LSE
while others do not, and ifunc resolution must occur well before this
scenario can be detected.  It does seem unlikely that FreeBSD will
ever run on such platforms, however, so converting atomic(9) to use
ifuncs is probably a good next step.

Add a LSE_ATOMICS arm64 kernel configuration option to unconditionally
select LSE-based atomic(9) implementations when the target system is
known.

Reviewed by:	andrew, kib
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation, Amazon (hardware)
Differential Revision:	https://reviews.freebsd.org/D23325
2020-02-03 18:23:50 +00:00
Mark Johnston
920de6a15f Add LSE-based atomic(9) implementations.
These make use of the cas*, ld* and swp instructions added in ARMv8.1.
Testing shows them to be significantly more performant than LL/SC-based
implementations.

No functional change here since the wrappers still unconditionally
select the _llsc variants.

Reviewed by:	andrew, kib
MFC after:	1 month
Submitted by:	Ali Saidi <alisaidi@amazon.com> (original version)
Differential Revision:	https://reviews.freebsd.org/D23324
2020-02-03 18:23:35 +00:00
Mark Johnston
c1fced6800 Add wrappers for arm64 atomics.
Add a _llsc suffix for the existing LL/SC-based implementations and add
trivial wrappers.  This is in preparation for supporting LSE-based
atomic(9) implementations.

No functional change intended.

Reviewed by:	andrew, kib
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation, Amazon (hardware)
Differential Revision:	https://reviews.freebsd.org/D23323
2020-02-03 18:23:14 +00:00
Mark Johnston
3ad6c736cf Provide a single implementation for each of the arm64 atomic(9) ops.
Parameterize the macros by type width as well as acq/rel semantics.
This makes modifying the implementations much less tedious and
error-prone and makes it easier to support alternate LSE-based
implementations.  No functional change intended.

Reviewed by:	andrew, kib
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation, Amazon (hardware)
Differential Revision:	https://reviews.freebsd.org/D23322
2020-02-03 18:22:59 +00:00
Chuck Silvers
62612737d6 With INVARIANTS, track all softdep dependency structures centrally
so that we can find them in dumps.

Approved by:	mckusick (mentor)
Sponsored by:	Netflix
2020-02-03 17:47:14 +00:00
Warner Losh
58aa35d429 Remove sparc64 kernel support
Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs
2020-02-03 17:35:11 +00:00
Warner Losh
eb24e1491f Remove sparc64 support from the boot loader.
Remove all the sparc64 specific bits, both files and ifdefs.
2020-02-03 17:34:57 +00:00
Alexander Motin
c68c82324f Unblock kstat.zfs.misc.dbufstats sysctls.
It is not so much broken to hide it after we wasted time to collect it.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-02-03 17:10:40 +00:00
Mateusz Guzik
bcd1cf4f03 capsicum: faster cap_rights_contains
Instead of doing a 2 iteration loop (determined at runeimt), take advantage
of the fact that the size is already known.

While here provdie cap_check_inline so that fget_unlocked does not have to
do a function call.

Verified with the capsicum suite /usr/tests.
2020-02-03 17:08:11 +00:00
Mateusz Guzik
2abdae33b1 tmpfs: inline tmpfs_update
It was generated to be just a jumping off point to tmpfs_itimes.

While here provide a dedicated variant for getattr since we normally don't
expect to need to the update from that caller.
2020-02-03 17:06:21 +00:00
Mark Johnston
af84329100 addr2line: Cache CU DIEs upon a successful address lookup.
Previously, addr2line would sequentially search all CUs for each input
address.  For some uses, notably syzkaller's code coverage map generator,
this was extremely slow.  Add a CU cache into which entries are added
following a successful lookup, and search the cache before falling back
to a scan.  When translating a large number of addresses this yields
slightly better performance than GNU addr2line.

Garbage-collect an unused hash table which appears to have been intended
for the same purpose.  A hash table doesn't seem particularly suitable
since each CU spans a range of addresses.

Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23418
2020-02-03 16:41:40 +00:00
Mateusz Piotrowski
4a3b87e295 units(1): Refactor the manual page and update usage information
Changes to units.1:

- Change the description to a more descriptive "conversion calculator".
- Sort options.
- Split the description into sections to make it easier to navigate the
  manual page.
- Improve the description of various options.
- Document the default value of the output format.
- Use more mdoc macros for better readability.
- Document the behavior of the PATH environmental variable.
- Improve examples.
- Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY.
- Document that units(1) cannot convert negative values and it handles long
  unit lists poorly.
- Update the documentation of the -V flag to match the implementation.
  units(1) prints its version and the units data file instead of its
  version and usage information.

Changes to units.c:

- Update usage information.
- Sort longopts elements.

This commit does not attempts to change the current behavior of units(1).
What's left to do is probably defining a better versioning (at the moment
units(1) always reports "FreeBSD units" as its version) and changing the
behavior of the -V flag to only print version.

Reviewed by:	allanjude (earlier version), bcr
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D18977
2020-02-03 15:22:46 +00:00
Andrew Turner
59606417c4 Remove the GICv3 ITS irq and replace it with an ID
In r357324 most of the use of gi_irq was moved to gi_lpi. Complete this
with the last few places we need the IRQ value and create gi_id for the
per-device value we need.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2020-02-03 14:38:19 +00:00
Mateusz Guzik
fee204544e fd: fix f_count acquire in fget_unlocked
The code was using a hand-rolled fcmpset loop, while in other places the same
count is manipulated with the refcount API.

This transferred from a stylistic issue into a bug after the API got extended
to support flags. As a result the hand-rolled loop could bump the count high
enough to set the bit flag. Another bump + refcount_release would then free
the file prematurely.

The bug is only present in -CURRENT.
2020-02-03 14:28:31 +00:00
Mateusz Guzik
f1fa1ba3d0 Fix up various vnode-related asserts which did not dump the used vnode 2020-02-03 14:25:32 +00:00
Andrew Turner
7877018c2c Use a unique name for the GICv3 ITS vmem
When there are multiple GICv3 ITS devices we don't know which vmem is for
which device. Use device_get_nameunit to get a per-device name.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2020-02-03 13:50:55 +00:00
Ed Maste
3b387214e6 remove stale gnu/lib/csu directory
As of r357338 gnu/lib/csu is never used.
2020-02-03 13:50:15 +00:00
Andrew Turner
a58fc7cb88 Disable the use of the quantum cache in the GICv3 ITS
This uses UMA to allocate space. It causes issues when there are multiple
ITS devices in the system where interrupts are not allocated from a low
address on some interrupt controllers. Disabling the quantum cache fixes
this on the Neoverse N1 SDP.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2020-02-03 13:47:41 +00:00
Toomas Soome
b0af1e20e6 loader: bc_add can not use any other probes than ah=0x4b
CD boot is broken for some systems since bioscd and biosdisk merge. The issue is that we can not use anything else than int 13 ah=0x4b to query cd information.

The patch does restore the same probe as was originally used in bioscd.c. Additionally extra buffer padding is used to avoid memory corruption caused by some systems.

PR:		234031
Reported by:	ultramage and others
MFC after:	1 day
2020-02-03 11:33:33 +00:00
Warner Losh
d9e9979c02 On powerpc, we use ofw_syscons for device sc. That references the default
fonts. As a workaround, remove the static. vt is default on powerpc, but there's
a few old macs that still fail with vt. sc is used as a work arouond for those
machines, and the kernel fails to build w/o it.
2020-02-03 05:38:45 +00:00
Conrad Meyer
8e6b06be14 netinet/libalias: Fix typo in debug message
No functional change.

PR:		243831
Submitted by:	Neel Chauhan <neel AT neelc DOT org>
Differential Revision:	https://reviews.freebsd.org/D23365
2020-02-03 05:19:44 +00:00
Pedro F. Giffuni
2a1481fbbf typo: Registration.
Pointed by:	Dikshie Fauzie
2020-02-03 02:02:13 +00:00
Pedro F. Giffuni
ad2b6d4e9b ethernet: Minor cleanup.
Consistently use uppercase for ethertype hex numbers.
2020-02-03 01:08:15 +00:00
Ed Maste
2927ab0397 acpi_ibm: remove superfluous cast
Reported by:	kib
2020-02-02 20:56:18 +00:00
Xin LI
43f1940992 Diff reduction against NetBSD, no functional change.
MFC after:	1 week
2020-02-02 20:53:31 +00:00
Xin LI
778ac8d371 Remove unused include.
MFC after:	2 weeks
2020-02-02 20:51:28 +00:00
Kyle Evans
b85ea80975 libc: provide fputc_unlocked
Among the same justification as the other stdio _unlocked; in addition to an
inline version in <stdio.h>, we must provide a function in libc as well for
the functionality. This fixes the lang/gcc* builds, which want to use the
symbol from libc.

PR:		243810
Reported by:	antoine, swills, Michael <michael.adm gmail com>
X-MFC-With:	r357284
2020-02-02 19:45:12 +00:00
Brandon Bergren
469026a8a3 [PowerPC] Fix feholdexcept() on powerpc referencing the wrong struct member
In r355656, endianness handling of the floating point environment was fixed
in the PowerPC code to work as intended.

However, one bit got missed, causing feholdexcept() to mis-save the fenv.

Submitted by:	Renato Riolino <renato.riolino@eldorado.org.br>
Differential Revision:	https://reviews.freebsd.org/D23382
2020-02-02 19:16:52 +00:00
Pedro F. Giffuni
b33c19776b style(9): Fix spaces after #define.
No functional change.
2020-02-02 19:02:07 +00:00
Ed Maste
66671c1428 acpi_ibm: whitespace and wrapping cleanup 2020-02-02 19:01:16 +00:00
Pedro F. Giffuni
682397c263 ethernet: add some more Ethertypes.
Sort ETHERTYPE_FCOE, from r357414.
2020-02-02 18:33:20 +00:00
Pedro F. Giffuni
badbcf06e0 ethernet: add some more Ethertypes.
Add some types based on other BSDs and also add EtherCat and PROFINET, which
are IEC standards.

There is a public list (CSV format) at:
	https://standards.ieee.org/products-services/regauth/

MFC after:	2 weeks
2020-02-02 18:27:37 +00:00
Ed Maste
4382f0f7a9 acpi_ibm: whitespace fixup 2020-02-02 18:07:47 +00:00