Commit Graph

252607 Commits

Author SHA1 Message Date
Andrew Gallatin
791dda877f uma: record allocation failures due to zone limits
The zone limit mechanism was recently reworked, and
allocation failures due to limits being exceeded
were inadvertently no longer being recorded. This
would lead to, for example, mbuf allocation failures
not being indicated in netstat -m or vmstat -z

Reviewed by:	markj
Sponsored by:	Netflix
2020-08-21 18:31:57 +00:00
Fernando Apesteguía
71230912a7 ipfw(8): Fix typo in man page
s/exmaple/example

Approved by:	manpages (gbe@)
Differential Revision:	https://reviews.freebsd.org/D26147
2020-08-21 17:45:17 +00:00
Eric van Gyzen
d17136fc3d amd64 pmap: potential integer overflowing expression
Coverity has identified the line in this change as "Potential integer
overflowing expression" due to the variable i declared as an int
and used in an expression with vm_paddr_t, a 64bit variable.

This change has very little effect as when this line is execute
nkpt is small and phys_addr is a the beginning of physical memory.
But there is no explicit protection that the above is true.

Submitted by:	bret_ketchum@dell.com
Reported by:	Coverity
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26141
2020-08-21 14:22:32 +00:00
Dimitry Andric
2a99bea578 Merge commit 95e18b2d9d5f from llvm git (by Kang Zhang):
[PowerPC] Fix a typo for InstAlias of mfsprg

  D77531 has a type for mfsprg, it should be mtsprg. This patch is to
  fix this typo.

This should fix booting powerpc64 kernels, after LLVM 11 was imported.

PR:		248763
2020-08-21 10:06:01 +00:00
Mateusz Piotrowski
e378129ea6 Reference spi(8) from spigen.4
MFC after:	2 weeks
2020-08-21 09:50:03 +00:00
Mateusz Piotrowski
4863a70395 Clean up spi.8
- Remove trailing whitespace
- Address igor and mandoc warnings
- Sort options
- Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code
  blocks)
- Add a history section
- Fix incorrect use of macros in various places

MFC after:	2 weeks
2020-08-21 09:48:00 +00:00
Gordon Bergling
cb9cbce235 gre(4): Mention sysctl for nesting gre tunnels
PR:		228465
Submitted by:	Sergey Akhmatov <sergey at akhmatov dot ru>
Reviewed by:	bcr
Approved by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26097
2020-08-21 07:03:54 +00:00
Gordon Bergling
d57d1f5440 ls(1): Update POSIX conformance from 2001 to 2008
- Update the options that are non-existing in POSIX from 2001 to 2008
- Update POSIX conformance in the STANDARDS section from 2001 to 2008

Verified by checking [1].

[1] https://pubs.opengroup.org/onlinepubs/9699919799.2016edition/toc.htm

PR:		140435
Submitted by:	Dan Lukes <dan at obluda dot cz>
Reviewed by:	bcr
Approved by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26096
2020-08-21 06:20:11 +00:00
Brandon Bergren
f10baa4049 [PowerPC] Fix translation-related crashes during startup
After spending a lot of time trying to track down what was going on, I have
isolated the "black screen" failures when using boot1 to boot a G4 machine.

It turns out we were replacing the traps before installing the temporary
BAT entry for the bottom of physical memory. That meant that until the MMU
was bootstrapped, the cached translations were the only thing keeping us
from losing.

Throwing boot1 into the mix was affecting execution flow enough to cause us
to hit an uncached page and crash.

Fix this by properly setting up the initial BAT entry at the same time we
are replacing the OpenFirmware traps, so we can continue executing in
segment 0 until the rest of the DMAP has been set up.

A second thing discovered while researching this is that we were entering a
BAT region for segment 16. It turns out this range was a) considered part
of KVA, and b) has firmware mappings with varying attributes.

If we ever accessed an unmapped page in segment 16, it would cause a BAT
entry to be installed for the whole segment, which would bypass the
existing mappings until it was flushed out again.

Instead, translate the OFW memory attributes into VM memory attributes and
install the ranges into the kernel address space properly.

Reviewed by:	adalava
MFC after:	3 weeks
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D25547
2020-08-21 03:31:01 +00:00
Brandon Bergren
b94b2fcd61 [PowerPC64] Fix invalid OPAL call in xive_bind().
This fixes spurious "XIVE[ IC 00  ] ISN 1 lead to invalid IVE !" messages
generated by OPAL when running with the debug level cranked up.

Discussed with jhibbits.

Sponsored by:	Tag1 Consulting, Inc.
2020-08-21 03:23:10 +00:00
Navdeep Parhar
11a82cd688 cxgbei: destroy the worker threads' CV and mutex in stop_worker_threads.
Reported by:	bz@
MFC after:	3 days
2020-08-21 00:34:33 +00:00
Simon J. Gerraty
0929924b61 veloader: insist on verifying .4th .lua etc
When files are read from .rc or .4th, verify_file is asked to
guess the severity (VE_TRY,VE_WANT,VE_MUST)

Reviewed by:	stevek
MFC after:	1 week
Sponsored by:	Juniper Networks
2020-08-21 00:27:06 +00:00
Warner Losh
773e541e8d Use devctl.h instead of bus.h to reduce newbus pollution.
There's no need for these parts of the kernel to know about newbus,
so narrow what is included to devctl.h for device_notify_*.

Suggested by: kib@
2020-08-21 00:03:24 +00:00
Gleb Smirnoff
c7dd069c70 When we have a command returned by zfs_nextboot() that is longer
than command in the loader.conf, the latter needs to be nul terminated,
otherwise garbage trailer left from zfs_nextboot() will be passed to
parse_cmd() together with loader.conf command.

While here, reset cmd to empty string if read() returns error.

Reviewed by:	tsoome
2020-08-20 20:31:47 +00:00
Mark Johnston
e627909d04 Fix a typo in r364438.
Reported by:	Jenkins
MFC with:	r364438
2020-08-20 20:11:58 +00:00
Warner Losh
1a369db0e8 Unbreak LINT
Remove ufm from the NOTES file.
2020-08-20 19:51:25 +00:00
Mark Johnston
d2d16e5663 Enable creation of static userspace probes in incremental builds.
To define USDT probes, dtrace -G makes use of relocations for undefined
symbols: the target address is overwritten with NOPs and the location is
recorded in the DOF section of the output object file.  To avoid link
errors, the original relocation is destroyed.  However, this means that
the same input object file cannot be processed multiple times, as
happens during incremental rebuilds.  Instead, only set the relocation
type to NONE, so that all information required to reconstruct USDT
probes is preserved.

Reported by:	bdrewery
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
2020-08-20 19:28:19 +00:00
Mark Johnston
0e15d9fbeb Remove non-FreeBSD ifdefs from dt_link.c.
This file is too complicated as it is and has diverged a fair bit from
illumos due to toolchain differences, so just drop unused code
(including SPARC support).

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-08-20 19:27:49 +00:00
Niclas Zeising
9f58ad6a45 Add ufm(4) to ObsoleteFiles.inc
The ufm driver was removed in r364432, add the manual to ObsoleteFiles.

OK by:	imp
2020-08-20 19:14:53 +00:00
Dimitry Andric
05c312a339 Bump kldxref's MAXSEGS to 16, to stop complaints about the kernel
supposedly having too many segments, when lld 11 links it. Such kernels
should load just fine.

Note that we may still do some tweaking of our kernel linker scripts, to
lower the number of segments, although the exact benefit is not entirely
clear.
2020-08-20 18:50:46 +00:00
Warner Losh
422809e1b1 Remove ufm.4 from the Makefile 2020-08-20 18:31:50 +00:00
Hans Petter Selasky
6cf060eba4 Fix regression after r364379.
The AMD's Ryzen 3 3200g XHCI controllers apparently need the evaluate
control endpoint context command, but we don't need to issue this
command when the bMaxPacketSize is received after the read of the USB
device descriptor, because this part should be handled automatically.

PR:		248784
Tested by:	emaste, hselasky
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-20 17:45:54 +00:00
Warner Losh
209d3fb41f Remove the long obsolete ufm driver.
It was a driver for a USB FM tuner that was available in the market in 2002. I
wrote the driver in 2003. I've not used it since 2005 or so, so it's time to
retire this driver. No userland code ever interfaced to the special device it
created. There's no user base: the last bug I received on this driver was in
2004.

Relnotes: Yes
2020-08-20 17:35:47 +00:00
Warner Losh
e0d14216c1 Tag pccard drivers with gone in 13.
MFC After: 3 days
Reviewed by: emaste, brooks, adrian (on twitter)
Differential Revision: https://reviews.freebsd.org/D26095
2020-08-20 17:19:40 +00:00
Warner Losh
553f053bfa Move from TAILQ to STAILQ because the nodes are a bit smaller. 2020-08-20 17:14:44 +00:00
Warner Losh
7795f0fe87 Move devctl_notify* to devctl.h. 2020-08-20 17:14:39 +00:00
Warner Losh
c9133e6c04 Make devctl_queue_data_f and devctl_queue_data private.
I thought we'd need them, but nobody is using them. Narrow the interface. This
will facilitate changes in the future.
2020-08-20 17:14:33 +00:00
Ed Maste
5e79303ba1 ipfw: style(9) fixes
Submitted by:	Neel Chauhan <neel AT neelc DOT org>
Reviewed by:	emaste, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26126
2020-08-20 16:56:13 +00:00
Warner Losh
0f2c2c1c58 Use names suggested by kib@ in review D25969, move call for unmount to not call
with vnode locked, use NOWAIT alloc and only report when we don't overflow.

These changes were accidentally omitted from r364402, except for the not
reporting on overflow. They were lumped in with a debugging commit in my tree
that I omitted w/o realizing this.

Other issues from the review are pending some other changes I need to do first.
2020-08-20 16:52:48 +00:00
Warner Losh
a418d47b79 Fix function name in zone.9
uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the
docs for it describe uma_prealloc exactly.
2020-08-20 16:52:34 +00:00
Konstantin Belousov
22517af2c1 dl_iterate_phdr(3): provide exclusive locking for callback when statically linked.
Apparently llvm unwinder depends on the external locking for callback.

Reviewed by:	cem, emaste
Tested by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26109
2020-08-20 15:19:09 +00:00
Emmanuel Vadot
9060f2c392 libsa: smbios: Parse the chassis type and export it as smbios.chassis.type
It can be useful to know what type of machine we are running on for desktop
related thing.
It also allow us to support all the DMI variable that linux driver can fetch.

MFC after:	1 week
Sponsored by:	Sponsored-by: The FreeBSD Foundation
2020-08-20 12:50:49 +00:00
Mateusz Guzik
17838b5869 cache: don't use cache_purge_negative when renaming
It avoidably scans (and evicts) unrelated entries. Instead take
advantage of passed componentname and perform a hash lookup
for the exact one.

Sample data from buildworld probed on cache_purge_negative extended
to count both scanned and evicted entries on each call are below.
At most it has to evict 1.

  evicted
           value  ------------- Distribution ------------- count
              -1 |                                         0
               0 |@@@@@@@@@@@@@@@                          19506
               1 |@@@@@                                    5820
               2 |@@@@@@                                   7751
               4 |@@@@@                                    6506
               8 |@@@@@                                    5996
              16 |@@@                                      4029
              32 |@                                        1489
              64 |                                         193
             128 |                                         109
             256 |                                         56
             512 |                                         16
            1024 |                                         7
            2048 |                                         3
            4096 |                                         1
            8192 |                                         1
           16384 |                                         0

  scanned
           value  ------------- Distribution ------------- count
              -1 |                                         0
               0 |@@                                       2456
               1 |@                                        1496
               2 |@@                                       2728
               4 |@@@                                      4171
               8 |@@@@                                     5122
              16 |@@@@                                     5335
              32 |@@@@@                                    6279
              64 |@@@@                                     5671
             128 |@@@@                                     4558
             256 |@@                                       3123
             512 |@@                                       2790
            1024 |@@                                       2449
            2048 |@@                                       3021
            4096 |@                                        1398
            8192 |@                                        886
           16384 |                                         0
2020-08-20 10:06:50 +00:00
Mateusz Guzik
39f8815070 cache: add cache_rename, a dedicated helper to use for renames
While here make both tmpfs and ufs use it.

No fuctional changes.
2020-08-20 10:05:46 +00:00
Mateusz Guzik
16be9f9956 cache: reimplement cache_lookup_nomakeentry as cache_remove_cnp
This in particular removes unused arguments.
2020-08-20 10:05:19 +00:00
Pedro F. Giffuni
0d2913adc3 usr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode
"ipdata.meta.pfs_type & HAMMER2_PFSTYPE_SUPROOT" happened to have
the same result (except HAMMER2_PFSTYPE_DUMMY could also match).

Obtained from: Dragonfly (git 29e6489bbd4f8e237c9c17b300ac8b711f36770)
2020-08-20 05:18:08 +00:00
Pedro F. Giffuni
ef20a5b58c extfs: remove redundant little endian conversion.
The XTIME_TO_NSEC macro already calls the htole32(), so there is no need
to call it twice. This code does nothing on LE platforms and affects only
nanosecond and birthtime fields so it's difficult to notice on regular use.

Hinted by:	DragonFlyBSD (git ae503f8f6f4b9a413932ffd68be029f20c38cab4)

X-MFC with:	r361136
2020-08-20 05:08:49 +00:00
Rick Macklem
a8537fe404 Add MSG_TLSAPPDATA to lib/libsysdecode/mktables.
I have no idea what this does (and until now that it even existed), but
apparently it needs this entry changed for the MSG_TLSAPPDATA, since
it is kernel only.
2020-08-20 03:53:18 +00:00
Alan Somers
02fa3d2963 zfs: fix EIO accessing dataset after resuming interrupted receive
ZFS unmounts a dataset while receiving into it and remounts it afterwards.
But if ZFS is resuming an incomplete receive, it screws up and ends up with
a dataset that is mounted, but returns EIO for every access. This commit
fixes that condition.

While the vulnerable code also exists in OpenZFS, the problem is not
reproducible there. Apparently OpenZFS doesn't unmount the destination
dataset during receive, like FreeBSD does.

PR:		248606
Reviewed by:	mmacy
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D26034
2020-08-20 01:31:21 +00:00
Mark Johnston
72c7f24c8d Use pmap_mapbios() to map ACPI tables on amd64 and i386.
The ACPI table-mapping code used pmap_kenter_temporary() to create
mappings, which in turn uses the fixed-size crashdump map.  Moreover,
the code was not verifying that the table fits in this map, so when
mapping large tables we could clobber adjacent mappings.  This use of
pmap_kenter_temporary() appears to predate support in pmap_mapbios() for
creating early mappings, but that restriction no longer applies.

PR:		248746
Reviewed by:	kib, mav
Tested by:	gallatin, Curtis Villamizar <curtis@ipv6.occnc.com>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26125
2020-08-20 00:52:53 +00:00
Mark Johnston
ee4df38d02 Remove an unused parameter from map_table().
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-08-20 00:38:32 +00:00
Rick Macklem
102829aa92 Add the MSG_TLSAPPDATA flag to indicate "return ENXIO" for non-application TLS
data records.

The kernel RPC cannot process non-application data records when
using TLS. It must to an upcall to a userspace daemon that will
call SSL_read() to process them.

This patch adds a new flag called MSG_TLSAPPDATA that the kernel
RPC can use to tell sorecieve() to return ENXIO instead of a non-application
data record, when that is what is at the top of the receive queue.
I put the code in #ifdef KERN_TLS/#endif, although it will build without
that, so that it is recognized as only useful when KERN_TLS is enabled.
The alternative to doing this is to have the kernel RPC re-queue the
non-application data message after receiving it, but that seems more
complicated and might introduce message ordering issues when there
are multiple non-application data records one after another.

I do not know what, if any, changes will be required to support TLS1.3.

Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D25923
2020-08-19 23:42:33 +00:00
Toomas Soome
5949d13fab libsa: remove leftover whitespace
Tiny cleanup, no functional changes.
2020-08-19 20:41:22 +00:00
Alexander Motin
3b58015079 Unify AcpiGetTable() KPI use in identify, probe and attach.
While there, change probe order to not call AcpiGetTable() for every
probed ACPI device.

PR:		248746
MFC after:	3 days
2020-08-19 19:55:12 +00:00
Mark Johnston
7d604fb5f3 Add a KCOV man page.
Reviewed by:	andrew, gbe, tuexen
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26108
2020-08-19 18:52:22 +00:00
Andrew Gallatin
b99781834f TCP: remove special treatment for hardware (ifnet) TLS
Remove most special treatment for ifnet TLS in the TCP stack, except
for code to avoid mixing handshakes and bulk data.

This code made heroic efforts to send down entire TLS records to
NICs. It was added to improve the PCIe bus efficiency of older TLS
offload NICs which did not keep state per-session, and so would need
to re-DMA the first part(s) of a TLS record if a TLS record was sent
in multiple TCP packets or TSOs. Newer TLS offload NICs do not need
this feature.

At Netflix, we've run extensive QoE tests which show that this feature
reduces client quality metrics, presumably because the effort to send
TLS records atomically causes the server to both wait too long to send
data (leading to buffers running dry), and to send too much data at
once (leading to packet loss).

Reviewed by:	hselasky,  jhb, rrs
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26103
2020-08-19 17:59:06 +00:00
Ed Maste
697718b9b6 ipfirewall(4): remove Cuseeme from supported list
Submitted by:	Dries Michiels
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26075
2020-08-19 17:52:06 +00:00
Warner Losh
350711aa85 Document the VFS FS events
MOUNT notifies when a filesystem is mounted
REMOUNT notifies when a filesystem is mounted again
UNMOUNT notifies when a filesystem is unmounted

These events are asynchronous to the actual state of the event (though the data
is recorded at a time when it is stable). The mount event is reported after the
filesystem is mounted. However, in the interim it may be unmounted by another
agent. Likewise, umount is called just before the mountpoint is finished tearing
down. It may be remounted (or maybe if the process scheduling is wonky and devd
gets to run before the last few steps are complete).

Sponsored by: Netflix
Diffential Revision: https://reviews.freebsd.org/D25969
2020-08-19 17:10:09 +00:00
Warner Losh
8ef773d1b4 Add VFS FS events for mount and unmount to devctl/devd
Report when a filesystem is mounted, remounted or unmounted via devd, along with
details about the mount point and mount options.

Discussed with:	kib@
Reviewed by: kirk@ (prior version)
Sponsored by: Netflix
Diffential Revision: https://reviews.freebsd.org/D25969
2020-08-19 17:10:04 +00:00
Warner Losh
08b242aeee Move the mount name to bit mapping into sys/mount.h so it can be shared with the
kernel.

Discussed with: kib@
Reviewed by: kirk@ (prior version)
Sponsored by: Netflix
Diffential Revision: https://reviews.freebsd.org/D25969
2020-08-19 17:09:58 +00:00