]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoFix a typo in r364438.
Mark Johnston [Thu, 20 Aug 2020 20:11:58 +0000 (20:11 +0000)]
Fix a typo in r364438.

Reported by: Jenkins
MFC with: r364438

3 years agoUnbreak LINT
Warner Losh [Thu, 20 Aug 2020 19:51:25 +0000 (19:51 +0000)]
Unbreak LINT

Remove ufm from the NOTES file.

3 years agoEnable creation of static userspace probes in incremental builds.
Mark Johnston [Thu, 20 Aug 2020 19:28:19 +0000 (19:28 +0000)]
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

3 years agoRemove non-FreeBSD ifdefs from dt_link.c.
Mark Johnston [Thu, 20 Aug 2020 19:27:49 +0000 (19:27 +0000)]
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

3 years agoAdd ufm(4) to ObsoleteFiles.inc
Niclas Zeising [Thu, 20 Aug 2020 19:14:53 +0000 (19:14 +0000)]
Add ufm(4) to ObsoleteFiles.inc

The ufm driver was removed in r364432, add the manual to ObsoleteFiles.

OK by: imp

3 years agoBump kldxref's MAXSEGS to 16, to stop complaints about the kernel
Dimitry Andric [Thu, 20 Aug 2020 18:50:46 +0000 (18:50 +0000)]
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.

3 years agoRemove ufm.4 from the Makefile
Warner Losh [Thu, 20 Aug 2020 18:31:50 +0000 (18:31 +0000)]
Remove ufm.4 from the Makefile

3 years agoFix regression after r364379.
Hans Petter Selasky [Thu, 20 Aug 2020 17:45:54 +0000 (17:45 +0000)]
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

3 years agoRemove the long obsolete ufm driver.
Warner Losh [Thu, 20 Aug 2020 17:35:47 +0000 (17:35 +0000)]
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

3 years agoTag pccard drivers with gone in 13.
Warner Losh [Thu, 20 Aug 2020 17:19:40 +0000 (17:19 +0000)]
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

3 years agoMove from TAILQ to STAILQ because the nodes are a bit smaller.
Warner Losh [Thu, 20 Aug 2020 17:14:44 +0000 (17:14 +0000)]
Move from TAILQ to STAILQ because the nodes are a bit smaller.

3 years agoMove devctl_notify* to devctl.h.
Warner Losh [Thu, 20 Aug 2020 17:14:39 +0000 (17:14 +0000)]
Move devctl_notify* to devctl.h.

3 years agoMake devctl_queue_data_f and devctl_queue_data private.
Warner Losh [Thu, 20 Aug 2020 17:14:33 +0000 (17:14 +0000)]
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.

3 years agoipfw: style(9) fixes
Ed Maste [Thu, 20 Aug 2020 16:56:13 +0000 (16:56 +0000)]
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

3 years agoUse names suggested by kib@ in review D25969, move call for unmount to not call
Warner Losh [Thu, 20 Aug 2020 16:52:48 +0000 (16:52 +0000)]
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.

3 years agoFix function name in zone.9
Warner Losh [Thu, 20 Aug 2020 16:52:34 +0000 (16:52 +0000)]
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.

3 years agodl_iterate_phdr(3): provide exclusive locking for callback when statically linked.
Konstantin Belousov [Thu, 20 Aug 2020 15:19:09 +0000 (15:19 +0000)]
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

3 years agolibsa: smbios: Parse the chassis type and export it as smbios.chassis.type
Emmanuel Vadot [Thu, 20 Aug 2020 12:50:49 +0000 (12:50 +0000)]
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

3 years agocache: don't use cache_purge_negative when renaming
Mateusz Guzik [Thu, 20 Aug 2020 10:06:50 +0000 (10:06 +0000)]
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

3 years agocache: add cache_rename, a dedicated helper to use for renames
Mateusz Guzik [Thu, 20 Aug 2020 10:05:46 +0000 (10:05 +0000)]
cache: add cache_rename, a dedicated helper to use for renames

While here make both tmpfs and ufs use it.

No fuctional changes.

3 years agocache: reimplement cache_lookup_nomakeentry as cache_remove_cnp
Mateusz Guzik [Thu, 20 Aug 2020 10:05:19 +0000 (10:05 +0000)]
cache: reimplement cache_lookup_nomakeentry as cache_remove_cnp

This in particular removes unused arguments.

3 years agousr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode
Pedro F. Giffuni [Thu, 20 Aug 2020 05:18:08 +0000 (05:18 +0000)]
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)

3 years agoextfs: remove redundant little endian conversion.
Pedro F. Giffuni [Thu, 20 Aug 2020 05:08:49 +0000 (05:08 +0000)]
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

3 years agoAdd MSG_TLSAPPDATA to lib/libsysdecode/mktables.
Rick Macklem [Thu, 20 Aug 2020 03:53:18 +0000 (03:53 +0000)]
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.

3 years agozfs: fix EIO accessing dataset after resuming interrupted receive
Alan Somers [Thu, 20 Aug 2020 01:31:21 +0000 (01:31 +0000)]
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

3 years agoUse pmap_mapbios() to map ACPI tables on amd64 and i386.
Mark Johnston [Thu, 20 Aug 2020 00:52:53 +0000 (00:52 +0000)]
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

3 years agoRemove an unused parameter from map_table().
Mark Johnston [Thu, 20 Aug 2020 00:38:32 +0000 (00:38 +0000)]
Remove an unused parameter from map_table().

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoAdd the MSG_TLSAPPDATA flag to indicate "return ENXIO" for non-application TLS
Rick Macklem [Wed, 19 Aug 2020 23:42:33 +0000 (23:42 +0000)]
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

3 years agolibsa: remove leftover whitespace
Toomas Soome [Wed, 19 Aug 2020 20:41:22 +0000 (20:41 +0000)]
libsa: remove leftover whitespace

Tiny cleanup, no functional changes.

3 years agoUnify AcpiGetTable() KPI use in identify, probe and attach.
Alexander Motin [Wed, 19 Aug 2020 19:55:12 +0000 (19:55 +0000)]
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

3 years agoAdd a KCOV man page.
Mark Johnston [Wed, 19 Aug 2020 18:52:22 +0000 (18:52 +0000)]
Add a KCOV man page.

Reviewed by: andrew, gbe, tuexen
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26108

3 years agoTCP: remove special treatment for hardware (ifnet) TLS
Andrew Gallatin [Wed, 19 Aug 2020 17:59:06 +0000 (17:59 +0000)]
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

3 years agoipfirewall(4): remove Cuseeme from supported list
Ed Maste [Wed, 19 Aug 2020 17:52:06 +0000 (17:52 +0000)]
ipfirewall(4): remove Cuseeme from supported list

Submitted by: Dries Michiels
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26075

3 years agoDocument the VFS FS events
Warner Losh [Wed, 19 Aug 2020 17:10:09 +0000 (17:10 +0000)]
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

3 years agoAdd VFS FS events for mount and unmount to devctl/devd
Warner Losh [Wed, 19 Aug 2020 17:10:04 +0000 (17:10 +0000)]
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

3 years agoMove the mount name to bit mapping into sys/mount.h so it can be shared with the
Warner Losh [Wed, 19 Aug 2020 17:09:58 +0000 (17:09 +0000)]
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

3 years agoFix the mips64 world build after r364284.
Dimitry Andric [Wed, 19 Aug 2020 17:05:30 +0000 (17:05 +0000)]
Fix the mips64 world build after r364284.

Linking the full version of clang 11 results in errors similar to:

lld: error: /usr/src/contrib/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:736:(.text._ZN5clang4ento22CreateAnalysisConsumerERNS_16CompilerInstanceE+0xE0): relocation R_MIPS_CALL16 out of range: 48920 is not in [-32768, 32767]; references operator new(unsigned long)

Add -mxgot to the compilation flags for llvm libraries to work around
this error. This may be too big of a hammer, but it can always be
refined later.

MFC after: 6 weeks

3 years agoRemove some noisy ACPI tables messages from verbose dmesg.
Alexander Motin [Wed, 19 Aug 2020 16:09:36 +0000 (16:09 +0000)]
Remove some noisy ACPI tables messages from verbose dmesg.

Those messages were printed hundreds of times during boot, often multiple
times for each table.  We already print information about the tables in
more organized form once to not duplicate it when random ACPI drivers are
attaching.

MFC after: 1 week

3 years agolibsa: make env_discard() public
Toomas Soome [Wed, 19 Aug 2020 15:27:09 +0000 (15:27 +0000)]
libsa: make env_discard() public

Allow env_discard() to be used outside environment.c

3 years agolibsa: cstyle cleanup for environment.c
Toomas Soome [Wed, 19 Aug 2020 15:20:33 +0000 (15:20 +0000)]
libsa: cstyle cleanup for environment.c

No functional changes.

3 years agoUnbreak `freebsd-update updatesready'.
Michael Gmelin [Wed, 19 Aug 2020 15:11:27 +0000 (15:11 +0000)]
Unbreak `freebsd-update updatesready'.

The command would only work if PWD happened to be WORKDIR.
Also, exit 1 in case WORKDIR exists, but isn't accessible
by the current user.

PR: 242709
Reported by: Max Fiedler
MFC after: 1 week

3 years agocache: when adding an already existing entry assert on a complete match
Mateusz Guzik [Wed, 19 Aug 2020 15:08:14 +0000 (15:08 +0000)]
cache: when adding an already existing entry assert on a complete match

3 years agocache: tidy up the comment above cache_prehash
Mateusz Guzik [Wed, 19 Aug 2020 15:07:28 +0000 (15:07 +0000)]
cache: tidy up the comment above cache_prehash

3 years agoMark COVERAGE and KCOV as part of KCSAN
Andrew Turner [Wed, 19 Aug 2020 14:11:25 +0000 (14:11 +0000)]
Mark COVERAGE and KCOV as part of KCSAN

While not strictly true this stops them from trying to use the KCSAN atomic
hooks and allows these to be compiled into the same kernel.

Sponsored by: Innovate UK

3 years agoCross-reference development.7 and tests.7
Mateusz Piotrowski [Wed, 19 Aug 2020 13:09:31 +0000 (13:09 +0000)]
Cross-reference development.7 and tests.7

MFC after: 7 days

3 years agoAvoid evaluating the XHCI control endpoint context.
Hans Petter Selasky [Wed, 19 Aug 2020 11:50:12 +0000 (11:50 +0000)]
Avoid evaluating the XHCI control endpoint context.

The XHCI specification says that the XHCI controller should detect
reception of the USB device descriptors, and automatically update
the max packet size in the control endpoint context.

Differential Revision: https://reviews.freebsd.org/D26104
Reviewed by: kp@
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoFix the real shared libraries (lib*.so.X) from OLD_FILES to OLD_LIBS,
Alexander Leidinger [Wed, 19 Aug 2020 10:01:05 +0000 (10:01 +0000)]
Fix the real shared libraries (lib*.so.X) from OLD_FILES to OLD_LIBS,
as it is supposed to be.

3 years agoPrint current buffer latency in dmesg for the USB audio driver and not just
Hans Petter Selasky [Wed, 19 Aug 2020 08:05:37 +0000 (08:05 +0000)]
Print current buffer latency in dmesg for the USB audio driver and not just
the maximum.

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agovfs: remove the always-curthread td argument from VOP_RECLAIM
Mateusz Guzik [Wed, 19 Aug 2020 07:28:01 +0000 (07:28 +0000)]
vfs: remove the always-curthread td argument from VOP_RECLAIM

3 years agovfs: drop the error parameter from vn_isdisk, introduce vn_isdisk_error
Mateusz Guzik [Wed, 19 Aug 2020 02:51:17 +0000 (02:51 +0000)]
vfs: drop the error parameter from vn_isdisk, introduce vn_isdisk_error

Most consumers pass NULL.

3 years agovfs: sanity check mount counters in vfs_op_enter
Mateusz Guzik [Wed, 19 Aug 2020 02:50:09 +0000 (02:50 +0000)]
vfs: sanity check mount counters in vfs_op_enter

3 years agoThree typos:
Warner Losh [Wed, 19 Aug 2020 02:18:11 +0000 (02:18 +0000)]
Three typos:
Amiga is a proper noun
Condition is traditionally spelled starting with 'c'
Some, but not all, of the over/under-voltage instances were hyphenated.
Since they are all adverb phrases, they all need to be hyphenated.

Pointy hat: imp

3 years agobectl(8): Fix output of `bectl list` for the 'Mountpoint' column.
Robert Wing [Wed, 19 Aug 2020 00:09:39 +0000 (00:09 +0000)]
bectl(8): Fix output of `bectl list` for the 'Mountpoint' column.

Currently, the output of `bectl list` doesn't align the 'Mountpoint' column
correctly when the 'mounted' property of a boot environment dataset is longer
than the default column width.

Set the 'Mountpoint' column width to the boot environment dataset with the
longest 'mounted' property or to the default width, whichever is greater.

PR:             241064
Reported by: vermaden@interia.pl
Reviewed by:    kevans (mentor)
Approved by:    kevans (mentor)
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D26048

3 years agoIncrease BER to PER lookup table size in an attempt to mitigate panics
Marko Zec [Tue, 18 Aug 2020 22:46:46 +0000 (22:46 +0000)]
Increase BER to PER lookup table size in an attempt to mitigate panics
with LRO and TSO.

Reported by:    rstone

3 years agoFix ber parameter description.
Marko Zec [Tue, 18 Aug 2020 22:15:51 +0000 (22:15 +0000)]
Fix ber parameter description.

3 years agolinux: add sysctl compat.linux.use_emul_path
Mateusz Guzik [Tue, 18 Aug 2020 22:04:22 +0000 (22:04 +0000)]
linux: add sysctl compat.linux.use_emul_path

This is a step towards facilitating jails with only Linux binaries.
Supporting emul_path adds path lookups which are completely spurious
if the binary at hand runs in a Linux-based root directory.

It defaults to on (== current behavior).

make -C /root/linux-5.3-rc8 -s -j 1 bzImage:

use_emul_path=1: 101.65s user 68.68s system 100% cpu 2:49.62 total
use_emul_path=0: 101.41s user 64.32s system 100% cpu 2:45.02 total

3 years agolinux: consistently use LFREEPATH instead of open-coding it
Mateusz Guzik [Tue, 18 Aug 2020 22:03:55 +0000 (22:03 +0000)]
linux: consistently use LFREEPATH instead of open-coding it

3 years agoFix two typos.
Warner Losh [Tue, 18 Aug 2020 21:42:02 +0000 (21:42 +0000)]
Fix two typos.

Submitted by: rpokala@
MFC After: 3 days

3 years agoDocument the ZFS events as best I can. These are not well documented.
Warner Losh [Tue, 18 Aug 2020 21:26:58 +0000 (21:26 +0000)]
Document the ZFS events as best I can. These are not well documented.

MFC After: 3 days

3 years agoDocument the AEON subsystem for the Amiga's power button.
Warner Losh [Tue, 18 Aug 2020 21:26:54 +0000 (21:26 +0000)]
Document the AEON subsystem for the Amiga's power button.

MFC After: 3 days

3 years agoDocument the PMU system
Warner Losh [Tue, 18 Aug 2020 21:26:50 +0000 (21:26 +0000)]
Document the PMU system

The pmu(4) and adb(4) drivers on powerpc generate PMU events. Document them.

The allwinner power modules also generate these events. Document those as well.

MFC After: 3 days

3 years agoGEOM::rotation_rate changes are also signaled via devctl.
Warner Losh [Tue, 18 Aug 2020 21:26:45 +0000 (21:26 +0000)]
GEOM::rotation_rate changes are also signaled via devctl.

MFC After: 3 days

3 years agoMove the possible event types into a column table to make it easier to read.
Warner Losh [Tue, 18 Aug 2020 21:26:39 +0000 (21:26 +0000)]
Move the possible event types into a column table to make it easier to read.

Sort system type alphabetically.
Remove some commas that aren't in the devd notification messages.

MFC After: 3 days
Reviewed by: 0mp (earlier versions), jhb (useful feedback on earlier versions)
Differential Revision: https://reviews.freebsd.org/D26105

3 years agogdb(4): Support empty qSupported queries
Conrad Meyer [Tue, 18 Aug 2020 20:59:10 +0000 (20:59 +0000)]
gdb(4): Support empty qSupported queries

Technically a client may send a qSupported query without specifying any
client features.  We should respond with our supported list in that case
instead of bailing with error.

Reported by: rlibby
Reviewed by: emaste, rlibby, vangyzen
Sponsored by: Isilon
Differential Revision: https://reviews.freebsd.org/D26115

3 years agoNone of system, subsystem, or type may have spaces in them. Convert the spaces
Warner Losh [Tue, 18 Aug 2020 20:20:45 +0000 (20:20 +0000)]
None of system, subsystem, or type may have spaces in them. Convert the spaces
to dashes.

Approved by: manu@

3 years agozfs: add an option to the bootloader to rewind the ZFS checkpoint
Mariusz Zaborski [Tue, 18 Aug 2020 19:48:04 +0000 (19:48 +0000)]
zfs: add an option to the bootloader to rewind the ZFS checkpoint

The checkpoints are another way of keeping the state of ZFS.
During the rewind, the pool has to be exported.
This makes checkpoints unusable when using ZFS as root.
Add the option to rewind the ZFS checkpoint at the boot time.
If checkpoint exists, a new option for rewinding a checkpoint will appear in
the bootloader menu.
We fully support boot environments.
If the rewind option is selected, the boot loader will show a list of
boot environments that existed before the checkpoint.

Reviewed by: tsoome, allanjude, kevans (ok with high-level overview)
Differential Revision: https://reviews.freebsd.org/D24920

3 years agoTCP Cubic: recalculate cwnd for every ACK.
Richard Scheffenegger [Tue, 18 Aug 2020 19:34:31 +0000 (19:34 +0000)]
TCP Cubic: recalculate cwnd for every ACK.

Since cubic calculates cwnd based on absolute
time, retaining RFC3465 (ABC) once-per-window updates
can lead to dramatic changes of cwnd in the convex
region. Updating cwnd for each incoming ack minimizes
this delta, preventing unintentional line-rate bursts.

Reviewed by: chengc_netapp.com, tuexen (mentor)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26060

3 years agoFix two bugs I introduced in r362563.
Michael Tuexen [Tue, 18 Aug 2020 19:25:03 +0000 (19:25 +0000)]
Fix two bugs I introduced in r362563.
Found by running syzkaller.

MFC after: 3 days

3 years agopf.conf(5): Assorted fixes
Gordon Bergling [Tue, 18 Aug 2020 17:30:51 +0000 (17:30 +0000)]
pf.conf(5): Assorted fixes

- new sentence new line
- blank lines in fill mode

3 years agobt(4) has already been removed. Add a deprecation notice.
Warner Losh [Tue, 18 Aug 2020 17:29:01 +0000 (17:29 +0000)]
bt(4) has already been removed. Add a deprecation notice.

MFC After: 1 day

3 years agouptime(1): Add EXAMPLES section
Fernando ApesteguĂ­a [Tue, 18 Aug 2020 16:58:37 +0000 (16:58 +0000)]
uptime(1): Add EXAMPLES section

Add a simple example

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26063

3 years agoriscv: Use global mimpid in identify_cpu()
Nick O'Brien [Tue, 18 Aug 2020 16:51:04 +0000 (16:51 +0000)]
riscv: Use global mimpid in identify_cpu()

sbi_init() sets mimpid, we can use that value.

Reviewed by: philip (mentor), kp (mentor)
Approved by: philip (mentor), kp (mentor)
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D26092

3 years agocam: add missing MAKEDEV_NOWAIT in passregister
Mateusz Guzik [Tue, 18 Aug 2020 16:06:16 +0000 (16:06 +0000)]
cam: add missing MAKEDEV_NOWAIT in passregister

Reported by: dhw

3 years agoCheck the XHCI endpoint state before issuing XHCI endpoint commands.
Hans Petter Selasky [Tue, 18 Aug 2020 15:44:03 +0000 (15:44 +0000)]
Check the XHCI endpoint state before issuing XHCI endpoint commands.

Differential Revision: https://reviews.freebsd.org/D26064
Reviewed by: kp@ and bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoFix handling of ancillary data on non-AF_UNIX Linux sockets.
Mark Johnston [Tue, 18 Aug 2020 14:17:14 +0000 (14:17 +0000)]
Fix handling of ancillary data on non-AF_UNIX Linux sockets.

After r340674, the "continue" would restart the loop without having
updated clen, resulting in an infinite loop.  Restore the old behaviour
of simply ignoring all control messages on such sockets, since we
currently only implement handling for AF_UNIX-specific messages.

Reported by: syzkaller
Reviewed by: tijl
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26093

3 years agoRevert r364310.
Mark Johnston [Tue, 18 Aug 2020 14:09:49 +0000 (14:09 +0000)]
Revert r364310.

Some of the resulting fallout in CAM does not appear straightforward to
fix, so simply revert the commit for now in the absence of a better
solution.

Discussed with: mjg
Reported by: dhw

3 years agoiicmux: fix a sign error in comparison
Andriy Gapon [Tue, 18 Aug 2020 12:14:01 +0000 (12:14 +0000)]
iicmux: fix a sign error in comparison

Because pcell_t is unsigned both sides of the comparison were treated as
such.
Because of that error iicmux created all possible sub-buses even if only
a subset was defined in the device tree.

MFC after: 1 week

3 years agoExport a routine to provide the TSC_AUX MSR value and use this in vmm.
Peter Grehan [Tue, 18 Aug 2020 11:36:38 +0000 (11:36 +0000)]
Export a routine to provide the TSC_AUX MSR value and use this in vmm.

Also, drop an unnecessary set of braces.

Requested by: kib
Reviewed by: kib
MFC after: 3 weeks

3 years agoUse complete OIDs to avoid confusion
Mateusz Piotrowski [Tue, 18 Aug 2020 10:30:55 +0000 (10:30 +0000)]
Use complete OIDs to avoid confusion

Submitted by: otis_sk.freebsd.org
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26098

3 years agonetmap: fix parsing of legacy nmr->nr_ringid
Vincenzo Maffione [Tue, 18 Aug 2020 08:03:28 +0000 (08:03 +0000)]
netmap: fix parsing of legacy nmr->nr_ringid

Code was checking for NETMAP_{SW,HW}_RING in req->nr_ringid which
had already been masked by NETMAP_RING_MASK. Therefore, the comparisons
always failed and set NR_REG_ALL_NIC. Check against the original nmr
structure.

Submitted by: bpoole@packetforensics.com
Reported by: bpoole@packetforensics.com
Reviewed by: giuseppe.lettieri@unipi.it
Approved by: vmaffione
MFC after: 1 week

3 years agoSupport guest rdtscp and rdpid instructions on Intel VT-x
Peter Grehan [Tue, 18 Aug 2020 07:23:47 +0000 (07:23 +0000)]
Support guest rdtscp and rdpid instructions on Intel VT-x

Enable any of rdtscp and/or rdpid for bhyve guests on Intel-based hosts
that support the "enable RDTSCP" VM-execution control.

Submitted by: adam_fenn.io
Reported by: chuck
Reviewed by: chuck, grehan, jhb
Approved by: jhb (bhyve), grehan
MFC after: 3 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D26003

3 years agoAllow guest device MMIO access from bootmem memory segments.
Peter Grehan [Tue, 18 Aug 2020 07:08:17 +0000 (07:08 +0000)]
Allow guest device MMIO access from bootmem memory segments.

Recent versions of UEFI have moved local APIC timer initialization into
the early SEC phase which runs out of ROM, prior to self-relocating
into RAM. This results in a hypervisor exit.

Currently bhyve prevents instruction emulation from segments that aren't
marked as "sysmem" aka guest RAM, with the vm_gpa_hold() routine failing.
However, there is no reason for this restriction: the hypervisor already
controls whether EPT mappings are marked as executable.

Fix by dropping the redundant check of sysmem.

MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D25955

3 years agoUse better gone_in_dev rather than just gone_in to print the device name.
Warner Losh [Tue, 18 Aug 2020 06:34:56 +0000 (06:34 +0000)]
Use better gone_in_dev rather than just gone_in to print the device name.

3 years agoDocument that PC Card will likely be removed before 13.
Warner Losh [Tue, 18 Aug 2020 06:18:18 +0000 (06:18 +0000)]
Document that PC Card will likely be removed before 13.

This was discussed in arch@ a while ago. Most of the 16-bit drivers that it
relied on have been removed. There's only a few other drivers remaining that
support it, and those are very rare the days (even the once ubiquitious wi(1)
is now quite rare).

Indvidual drivers will be handled separately before pccard itself is removed.

3 years agoModernize a bit.
Warner Losh [Tue, 18 Aug 2020 06:07:34 +0000 (06:07 +0000)]
Modernize a bit.

Remove PC Card specific information. It's of little value these days and on
the way out after most of its drivers have been removed.
Use iwn instead of wi device.

3 years agoAdd an entry to UPDATING for r364330.
Rick Macklem [Tue, 18 Aug 2020 02:02:36 +0000 (02:02 +0000)]
Add an entry to UPDATING for r364330.

3 years agoBump __FreeBSD_version for r364330, since it changed the internal API
Rick Macklem [Tue, 18 Aug 2020 01:57:48 +0000 (01:57 +0000)]
Bump __FreeBSD_version for r364330, since it changed the internal API
between the NFS modules such that they all need to be re-compiled from
sources.

3 years agoDelete the unused "use_ext" argument to nfscl_reqstart().
Rick Macklem [Tue, 18 Aug 2020 01:41:12 +0000 (01:41 +0000)]
Delete the unused "use_ext" argument to nfscl_reqstart().

This is a partial revert of r363210, since the "use_ext" argument added
by that commit is not actually useful.

This patch should not result in any semantics change.

3 years agoRemove "emulation" of clone(CLONE_PARENT | CLONE_THREAD).
Mark Johnston [Mon, 17 Aug 2020 21:30:49 +0000 (21:30 +0000)]
Remove "emulation" of clone(CLONE_PARENT | CLONE_THREAD).

On Linux this is supposed to result in EINVAL.

Reported by: syzkaller
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoFix a lock leak when emulating futex(FUTEX_WAIT_BITSET).
Mark Johnston [Mon, 17 Aug 2020 21:30:15 +0000 (21:30 +0000)]
Fix a lock leak when emulating futex(FUTEX_WAIT_BITSET).

Reported by: syzkaller
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agonet80211: replace magic number by define
Bjoern A. Zeeb [Mon, 17 Aug 2020 20:18:01 +0000 (20:18 +0000)]
net80211: replace magic number by define

Rather than coding an array size of [4] replace the number with
WME_NUM_AC.

MFC after: 2 weeks
Reviewed by: adrian
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26090

3 years agonet80211: VHT correct NSS Set loop boundary
Bjoern A. Zeeb [Mon, 17 Aug 2020 20:16:33 +0000 (20:16 +0000)]
net80211: VHT correct NSS Set loop boundary

For the <VHT-MCS, NSS> tuple, NSS is 1..8 (or in our loop case 0..7
but not 0..6). Correct the boundry to check for < 8 and not < 7.

MFC after: 2 weeks
Reviewed by: adrian
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision: https://reviews.freebsd.org/D26087

3 years agoAdd a USE_GCC_TOOLCHAINS knob to make universe.
John Baldwin [Mon, 17 Aug 2020 20:11:43 +0000 (20:11 +0000)]
Add a USE_GCC_TOOLCHAINS knob to make universe.

This uses GCC toolchains instead of LLVM on architectures supported by
GCC.  Currently this uses GCC 6 on aarch64, amd64, i386, and mips.

Although this does also try to use GCC 6 on powerpc, it is always
skipped for now since a powerpc-gcc6 package is not available and the
structure of make universe makes it hard to skip a subset of arches
for a target.  This should be short-lived as freebsd-gcc9 does include
a powerpc-gcc9 package so powerpc should work once this switches to
GCC 9.

Discussed with: emaste
Differential Revision: https://reviews.freebsd.org/D25732

3 years agodwmmc: remove printf even under bootverbose
Bjoern A. Zeeb [Mon, 17 Aug 2020 20:07:14 +0000 (20:07 +0000)]
dwmmc: remove printf even under bootverbose

Remove two debugging printfs, even if hidden under boot -v.
They seemed to be of debug nature and always spit onto the
console when running camcontrol devlist -v.

Reviewed by: manu
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25962

3 years agoscandir-compat11.c: Remove unused declaration for qsort_b().
Konstantin Belousov [Mon, 17 Aug 2020 19:14:09 +0000 (19:14 +0000)]
scandir-compat11.c: Remove unused declaration for qsort_b().

Sponsored by: The FreeBSD Foundation
MFC after: 0 days

3 years agoipfw: line up `ipfw -t list` with and without timestamp
Ed Maste [Mon, 17 Aug 2020 18:53:23 +0000 (18:53 +0000)]
ipfw: line up `ipfw -t list` with and without timestamp

From the PR:
    When I run `ipfw -t list` on release/12 or current, I get misaligned
    output between lines that do and do not have a last match timestamp,
    like so:

    00100 Tue Aug 11 03:03:26 2020 allow ip from any to any via lo0
    00200                         deny ip from any to 127.0.0.0/8

    (specifically, the "allow" and "deny" strings do not line up)

PR: 248608
Submitted by: Taylor Stearns
MFC after: 3 days

3 years agoMove -L${LIBCOMPATTMP}/usr/lib${libcompat} from CFLAGS to LDFLAGS.
John Baldwin [Mon, 17 Aug 2020 17:17:33 +0000 (17:17 +0000)]
Move -L${LIBCOMPATTMP}/usr/lib${libcompat} from CFLAGS to LDFLAGS.

This is only needed when linking and fixes various "unused command
line argument" warnings during the lib32 build.

Reviewed by: bdrewery
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26068

3 years agoSkip Linux madvise(MADV_DONTNEED) on unmanaged objects.
Mark Johnston [Mon, 17 Aug 2020 17:14:56 +0000 (17:14 +0000)]
Skip Linux madvise(MADV_DONTNEED) on unmanaged objects.

vm_object_madvise() is a no-op for unmanaged objects, but we should also
limit the scope of mappings on which pmap_remove() is called.  In
particular, with the WIP largepage shm objects patch the kernel must
remove mappings of such objects along superpage boundaries, and without
this check Linux madvise(MADV_DONTNEED) could violate that requirement.

Reviewed by: alc, kib
MFC with: r362631
Sponsored by: Juniper Networks, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D26084

3 years agogpart(8): Recognize apple-zfs and solaris-reserved partition ids
Conrad Meyer [Mon, 17 Aug 2020 17:07:05 +0000 (17:07 +0000)]
gpart(8): Recognize apple-zfs and solaris-reserved partition ids

Introduce G_PART_ALIAS_SOLARIS_RESERVED, GPT_ENT_TYPE_SOLARIS_RESERVED et al.,
to make gpart show output more convenient on systems with illumos/openindiana
disks visible.

Submitted by: Juraj Lutter <otis AT sk.FreeBSD.org>
Reviewed by: bcr(manpages), delphij, myself
Differential Revision: https://reviews.freebsd.org/D26012

3 years agonet80211: return 80P80 before 160
Bjoern A. Zeeb [Mon, 17 Aug 2020 16:51:21 +0000 (16:51 +0000)]
net80211: return 80P80 before 160

In ieee80211_vht_get_chwidth_ie() we need to return 80P80 (3) before
VHT160 (2) as otherwise we'll never use 80P80.  Fix the order.

MFC after: 2 weeks
X-MFC with: r364303 (which missed this)
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")