]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoVery preliminary loader.efi(8) man page
Warner Losh [Tue, 1 Sep 2020 07:54:09 +0000 (07:54 +0000)]
Very preliminary loader.efi(8) man page

3 years agoDocument boot1.efi
Warner Losh [Tue, 1 Sep 2020 07:46:27 +0000 (07:46 +0000)]
Document boot1.efi

Crude man page for boo1.efi.

3 years agolib: libnetmap: add missing copyright headers
Vincenzo Maffione [Tue, 1 Sep 2020 06:06:32 +0000 (06:06 +0000)]
lib: libnetmap: add missing copyright headers

MFC after: 2 weeks

3 years agoSmaller crc for the boot loader.
Warner Losh [Tue, 1 Sep 2020 04:37:55 +0000 (04:37 +0000)]
Smaller crc for the boot loader.

Save 7k of text space by using simpler crc32 for standalone case. we
don't need all that fancy optimization in the boot loader, so use a
simplified version of the CRC function. We could save more by doing it
one bit at a time rather than 32, but this is the biggest savings at
the smallest performance hit.

With LUA and verfied exec, gptboot, gptzfsboot and friends are pushing
the ~530k limit and every little bit helps.

Reviewed By: allanjude
Differential Revision: https://reviews.freebsd.org/D24225

3 years ago[PowerPC] Remove unused openpic_set_priority().
Brandon Bergren [Tue, 1 Sep 2020 01:57:56 +0000 (01:57 +0000)]
[PowerPC] Remove unused openpic_set_priority().

When SMP support for powerpc was added in r178628, the last callers of this
function were removed. All code that needs to manipulate the task priority
just does it directly instead.

Noticed while reading through the lint logs.

Sponsored by: Tag1 Consulting, Inc.

3 years agoAdd a check to test for the case of the "tls" option being used with "udp".
Rick Macklem [Tue, 1 Sep 2020 01:10:16 +0000 (01:10 +0000)]
Add a check to test for the case of the "tls" option being used with "udp".

The KERN_TLS only supports TCP, so use of the "tls" option with "udp" will
not work.  This patch adds a test for this case, so that the mount is not
attempted when both "tls" and "udp" are specified.

3 years agoMakefile.inc1: comment .endif to ease finding matching .if
Ed Maste [Tue, 1 Sep 2020 00:14:40 +0000 (00:14 +0000)]
Makefile.inc1: comment .endif to ease finding matching .if

3 years agoSort IFNET alphabetically
Warner Losh [Mon, 31 Aug 2020 23:48:27 +0000 (23:48 +0000)]
Sort IFNET alphabetically

3 years agoAdd documentation for ETHERNET events.
Warner Losh [Mon, 31 Aug 2020 23:48:23 +0000 (23:48 +0000)]
Add documentation for ETHERNET events.

3 years agoWarn for the non pccard attachments
Warner Losh [Mon, 31 Aug 2020 23:31:16 +0000 (23:31 +0000)]
Warn for the non pccard attachments

These devices have non-pccard attachments. Warn for those as well. Both an and
wi don't do the modern cyrpto needed to use these cards on secure wifi networks.
an needs firmware from Cisco, which I don't think was ever produced. wi could
in theory do it with raw frames and on-host encryption, but nobody has written
that in the 15 years since WEP was cracked.

MFC After: 3 days
Noticed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D26138

3 years agocxgbe(4): Check for descriptors before writing a TLS or raw work request.
Navdeep Parhar [Mon, 31 Aug 2020 22:44:59 +0000 (22:44 +0000)]
cxgbe(4): Check for descriptors before writing a TLS or raw work request.

This fixes a regression in r362905.

Submitted by: jhb@
Sponsored by: Chelsio Communications

3 years agoSuppress -Wempty-body warnings in GCC 6.x and later.
John Baldwin [Mon, 31 Aug 2020 21:57:01 +0000 (21:57 +0000)]
Suppress -Wempty-body warnings in GCC 6.x and later.

libc++ in LLVM 11 uses an empty else clause in
include/c++/v1/__thread_support which triggers this warning.

Reviewed by: dim, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26257

3 years agoFix the build of scandir_b with GCC.
John Baldwin [Mon, 31 Aug 2020 21:55:25 +0000 (21:55 +0000)]
Fix the build of scandir_b with GCC.

Use explicit typedefs for block thunk structures as in r264143.

Reviewed by: kib, adrian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26256

3 years agoAdd deprecation notice for apm BIOS
Warner Losh [Mon, 31 Aug 2020 21:04:00 +0000 (21:04 +0000)]
Add deprecation notice for apm BIOS

Add deprecation notice for apm bios, aka the apm(4) device. The apm(8)
command will remain, at least for a while, since ACPI emulates the apm
ioctl interface.

Discussed on: arch@
Relnotes: yes
MFC After: 3 days

3 years agovtnet(4): improve the wording
Gordon Bergling [Mon, 31 Aug 2020 20:02:32 +0000 (20:02 +0000)]
vtnet(4): improve the wording

PR: 247936
Submitted by: PauAmma <pauamma at gundo dot com>
Reported by: PauAmma <pauamma at gundo dot com>
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D26244

3 years agogc pmtimer and apm
Warner Losh [Mon, 31 Aug 2020 19:47:30 +0000 (19:47 +0000)]
gc pmtimer and apm

pmtimer was removed from base some time ago. apm hasn't been relevant
for these devices in a long time (and was commented out). Remove them
both from these config files.

3 years agoUse symbolic names for asych events
Warner Losh [Mon, 31 Aug 2020 19:38:03 +0000 (19:38 +0000)]
Use symbolic names for asych events

Rather than |= 0x300, define and use asyn event names for the name
space changes and the firmware activations that we're asking for.

3 years agols(1): Update all POSIX references and correct the STANDARDS section
Gordon Bergling [Mon, 31 Aug 2020 18:47:56 +0000 (18:47 +0000)]
ls(1): Update all POSIX references and correct the STANDARDS section

- Update the POSIX references for non-standard ls(1) options
- Simplify the STANDARDS section by mention both supported POSIX versions

Reported by: hrs
Reviewed by: hrs, bcr
Approved by: hrs, bcr
MFC after: 3 days
X-MFC-With: r364449
Differential Revision: https://reviews.freebsd.org/D26210

3 years agomlx5 sriov: Add controls for VFs to set port/node GUIDs.
Konstantin Belousov [Mon, 31 Aug 2020 16:32:17 +0000 (16:32 +0000)]
mlx5 sriov: Add controls for VFs to set port/node GUIDs.

Setting GUIDs make RoCE offloads functional on VFs.

Reported and tested by: chuck
Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5 sriov: add error message for failed MAC programming on VF.
Konstantin Belousov [Mon, 31 Aug 2020 16:30:52 +0000 (16:30 +0000)]
mlx5 sriov: add error message for failed MAC programming on VF.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5en: Implement SIOCGIFDOWNREASON.
Konstantin Belousov [Mon, 31 Aug 2020 16:27:03 +0000 (16:27 +0000)]
mlx5en: Implement SIOCGIFDOWNREASON.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5_core: add mlx5_query_pddr().
Konstantin Belousov [Mon, 31 Aug 2020 16:25:55 +0000 (16:25 +0000)]
mlx5_core: add mlx5_query_pddr().

And use it in mlx5_query_pddr_range_info() instead of direct register
access.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agomlx5_core: Import PDDR register definitions
Konstantin Belousov [Mon, 31 Aug 2020 16:23:51 +0000 (16:23 +0000)]
mlx5_core: Import PDDR register definitions

PDDR (Port Diagnostics Database Register) is used to read the physical
layer debug database, which contains helpful troubleshooting information
regarding the state of the link.

PDDR register can only be queried when PCAM register reports it as
supported in its register mask. A new helper macro was added to
the MLX5_CAP_* infrastructure in order to access this mask.

Sponsored by: Mellanox Technologies - Nvidia
MFC after: 1 week

3 years agoinfiniband-diags: Fix memory leak in dump_multicast_tables
Eric van Gyzen [Mon, 31 Aug 2020 16:18:48 +0000 (16:18 +0000)]
infiniband-diags: Fix memory leak in dump_multicast_tables

Coverity detected leak.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26228

3 years agoinfiniband: Appease Coverty
Eric van Gyzen [Mon, 31 Aug 2020 16:17:28 +0000 (16:17 +0000)]
infiniband: Appease Coverty

Coverity claims the call to rdma_gid2ip in cma_igmp_send overwrites addr.
Use a consistent definition of sockaddr to prevent detections and code
changes in the future.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26229

3 years agolibpmc: Fix memory leak in process_mapfile
Eric van Gyzen [Mon, 31 Aug 2020 16:07:40 +0000 (16:07 +0000)]
libpmc: Fix memory leak in process_mapfile

Coverity detected memory leak fix.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26230

3 years agoggated(8): Avoid doubly opening the requested disk device.
Mark Johnston [Mon, 31 Aug 2020 15:59:17 +0000 (15:59 +0000)]
ggated(8): Avoid doubly opening the requested disk device.

- Initialize the disk device fd field in connection_new().
- Close the disk device after handing the connection over
  to a child worker.
- Avoid re-opening a disk device for each connection from
  the same client, avoiding an fd leak.

PR: 132845
Submitted by: Yoshihiro Ota <ota@j.email.ne.jp>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26168

3 years agodhclient: improve error handling parsing option 119
Ed Maste [Mon, 31 Aug 2020 15:55:29 +0000 (15:55 +0000)]
dhclient: improve error handling parsing option 119

Reported by: Shlomi Oberman, JSOF
Submitted by: delphij
Reviewed by: markj
Tested by: markj

3 years agortwn(4): Add support for the Belkin N300.
Mark Johnston [Mon, 31 Aug 2020 15:32:45 +0000 (15:32 +0000)]
rtwn(4): Add support for the Belkin N300.

PR: 249034
Submitted by: Salvador Martínez Mármol <salvica@kapj.net>
MFC after: 1 week

3 years agoFix nfsrvd_locku memory leak
Eric van Gyzen [Mon, 31 Aug 2020 15:31:17 +0000 (15:31 +0000)]
Fix nfsrvd_locku memory leak

Coverity detected memory leak fix.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26231

3 years agoopensm: Fix a possible dereference of a NULL pointer
Eric van Gyzen [Mon, 31 Aug 2020 15:26:01 +0000 (15:26 +0000)]
opensm: Fix a possible dereference of a NULL pointer

Reported by: Coverity
Reviewed by: hselasky, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26233

3 years agoposixshm: fix setting of shm_flags
Kyle Evans [Mon, 31 Aug 2020 15:07:15 +0000 (15:07 +0000)]
posixshm: fix setting of shm_flags

Noted in D24652, we currently set shmfd->shm_flags on every
shm_open()/shm_open2(). This wasn't properly thought out; one shouldn't be
able to specify incompatible flags on subsequent opens of non-anon shm.

Move setting of shm_flags explicitly to the two places shmfd are created, as
we do with seals, and validate when we're opening a pre-existing mapping
that we've either passed no flags or we've passed the exact same flags as
the first time.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D26242

3 years agojedec_dimm: fix array overrun
Eric van Gyzen [Mon, 31 Aug 2020 15:03:23 +0000 (15:03 +0000)]
jedec_dimm: fix array overrun

Coverity detected the overrunning of sc->part_str.

Submitted by: bret_ketchum@dell.com
Reported by: Coverity
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26145

3 years agomake m_getm2() resilient to zone_jumbop exhaustion
Andrew Gallatin [Mon, 31 Aug 2020 13:53:14 +0000 (13:53 +0000)]
make m_getm2() resilient to zone_jumbop exhaustion

When the zone_jumbop is exhausted, most things using
using sosend* (like sshd)  will eventually
fail or hang if allocations are limited to the
depleted jumbop zone.  This makes it imossible to
communicate with a box which is under an attach which
exhausts the jumbop zone.

Rather than depending on the page size zone, also try cluster
allocations to satisfy larger requests.  This allows me
to ssh to, and serve 100Gb/s of traffic from a server which
under attack and has had its page-sized zone exhausted.

Reviewed by: glebius, markj, rmacklem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26150

3 years agoHyper-V: storvsc: Enhance srb_status code handling.
Wei Hu [Mon, 31 Aug 2020 09:05:45 +0000 (09:05 +0000)]
Hyper-V: storvsc: Enhance srb_status code handling.

In hv_storvsc_io_request() when coring, prevent changing of the send channel
from the base channel to another one. storvsc_poll always probes on the base
channel.

Based upon conversations with Microsoft, changed the handling of srb_status
codes. Most we should never get, others yes. All are treated as retry-able
except for two. We should not get these statuses, but if we ever do, the I/O
state is not known.

Submitted by: Alexander Sideropoulos <Alexander.Sideropoulos@netapp.com>
Reviewed by: trasz, allanjude, whu
MFC after: 1 week
Sponsored by: Netapp Inc
Differential Revision: https://reviews.freebsd.org/D25756

3 years agoipv6: quit dropping packets looping back on p2p interfaces
Kyle Evans [Mon, 31 Aug 2020 01:45:48 +0000 (01:45 +0000)]
ipv6: quit dropping packets looping back on p2p interfaces

To paraphrase the below-referenced PR:

This logic originated in the KAME project, and was even controversial when
it was enabled there by default in 2001. No such equivalent logic exists in
the IPv4 stack, and it turns out that this leads to us dropping valid
traffic when the "point to point" interface is actually a 1:many tun
interface, e.g. with the wireguard userland stack.

Even in the case of true point-to-point links, this logic only avoids
transient looping of packets sent by misconfigured applications or
attackers, which can be subverted by proper route configuration rather than
hardcoded logic in the kernel to drop packets.

In the review, melifaro goes on to note that the kernel can't fix it, so it
perhaps shouldn't try to be 'smart' about it. Additionally, that TTL will
still kick in even with incorrect route configuration.

PR: 247718
Reviewed by: melifaro, rgrimes
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25567

3 years agoAdd an entry to RELNOTES for the NFS over TLS kernel support.
Rick Macklem [Sun, 30 Aug 2020 21:46:29 +0000 (21:46 +0000)]
Add an entry to RELNOTES for the NFS over TLS kernel support.

3 years agoAdd support for the NFS over TLS exports to mountd.
Rick Macklem [Sun, 30 Aug 2020 21:21:58 +0000 (21:21 +0000)]
Add support for the NFS over TLS exports to mountd.

Three new export flags are added to mountd that will restrict exported
file system mounts to use TLS.  Without these flags, TLS is allowed, but not
required.

The exports(5) man page will be updated in a future commit.

3 years agowho(1): Add EXAMPLES section
Fernando Apesteguía [Sun, 30 Aug 2020 17:40:59 +0000 (17:40 +0000)]
who(1): Add EXAMPLES section

Add EXAMPLES section covering all the flags except -m and -bTu covered by
other flags.

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

3 years agotsort(1): Add EXAMPLES section
Fernando Apesteguía [Sun, 30 Aug 2020 17:37:56 +0000 (17:37 +0000)]
tsort(1): Add EXAMPLES section

Add a couple of simple examples to the man page

Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D25883

3 years agoFollowup on r364922. Old comment said that the only reason to put
Gleb Smirnoff [Sun, 30 Aug 2020 17:13:04 +0000 (17:13 +0000)]
Followup on r364922. Old comment said that the only reason to put
the hook at queue mode was that mn_rx_intr() doesn't run at splnet
level. In today's netgraph the only legitimate reason for queue mode
is recursion avoidance. So I see no reason for queue mode here.

Not tested!

3 years agoDriver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME
Marko Zec [Sun, 30 Aug 2020 07:34:32 +0000 (07:34 +0000)]
Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME
development board.

Submitted by: Denis Salopek <denis.salopek AT fer.hr>
Reported by: zec, bz (src); rgrimes, bcr (manpages)
MFC after: 7 days
Sponsored by: Google Summer of Code 2020
Differential Revision: https://reviews.freebsd.org/D26074

3 years agoAdd __BEGIN_DECLS to jail.h to keep C++ happy.
Jamie Gritton [Sat, 29 Aug 2020 22:24:41 +0000 (22:24 +0000)]
Add __BEGIN_DECLS to jail.h to keep C++ happy.

PR: 238928
Reported by: yuri@

3 years agoFix ordering of the 'pull' subcommand and the '-q' flag.
Glen Barber [Sat, 29 Aug 2020 21:47:49 +0000 (21:47 +0000)]
Fix ordering of the 'pull' subcommand and the '-q' flag.

Pointyhat to: gjb (myself)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRestore the '-q' flag to the 'git pull' command.
Glen Barber [Sat, 29 Aug 2020 21:46:34 +0000 (21:46 +0000)]
Restore the '-q' flag to the 'git pull' command.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRemove the VCSUPDATE command, because git is too stupid to have
Glen Barber [Sat, 29 Aug 2020 21:42:59 +0000 (21:42 +0000)]
Remove the VCSUPDATE command, because git is too stupid to have
the '-C <directory>' after the subcommand.

Meanwhile, hard-code 'git -C <...> pull' for now.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agozalloc_malloc:Free hexdump preceeding buffer when we detect overflow
Simon J. Gerraty [Sat, 29 Aug 2020 21:05:43 +0000 (21:05 +0000)]
zalloc_malloc:Free hexdump preceeding buffer when we detect overflow

Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c
(svn cp)
Disable use of pager - causes linking issue for boot1
can be re-enabled by defining HEXDUMP_PAGER.

Reviewed by: stevek, imp
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D26235

3 years agoLinuxKPI: Implement ksize() function.
Vladimir Kondratyev [Sat, 29 Aug 2020 19:26:31 +0000 (19:26 +0000)]
LinuxKPI: Implement ksize() function.

In Linux, ksize() gets the actual amount of memory allocated for a given
object. This commit adds malloc_usable_size() to FreeBSD KPI which does
the same. It also maps LinuxKPI ksize() to newly created function.

ksize() function is used by drm-kmod.

Reviewed by: hselasky, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26215

3 years agoRefine the VCSUPDATE logic further:
Glen Barber [Sat, 29 Aug 2020 16:04:02 +0000 (16:04 +0000)]
Refine the VCSUPDATE logic further:
- Look for the .git directory instead of top-level directory.
- Use 'git -C' instead of cd(1).

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd a VCSUPDATE command to run 'git pull' instead of 'git clone'
Glen Barber [Sat, 29 Aug 2020 15:50:27 +0000 (15:50 +0000)]
Add a VCSUPDATE command to run 'git pull' instead of 'git clone'
if the tree already exists.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoIndentation fixes. No functional changes.
Glen Barber [Sat, 29 Aug 2020 15:31:23 +0000 (15:31 +0000)]
Indentation fixes.  No functional changes.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAvoid the build from falling over if devel/git is not installed
Glen Barber [Sat, 29 Aug 2020 15:30:21 +0000 (15:30 +0000)]
Avoid the build from falling over if devel/git is not installed
on the system.  Set a null branch/hash in this case, to avoid
undefined GITREV/GITBRANCH variables from falling over in other
areas.

Reported by: many
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoInstall devel/git from packages if NOPORTS is set in the release.sh
Glen Barber [Sat, 29 Aug 2020 15:13:07 +0000 (15:13 +0000)]
Install devel/git from packages if NOPORTS is set in the release.sh
configuration file.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRevert uma zone alignemnt cache unadvertenly committed in r364950.
Alexander V. Chernikov [Sat, 29 Aug 2020 12:04:13 +0000 (12:04 +0000)]
Revert uma zone alignemnt cache unadvertenly committed in r364950.

3 years agoWe don't need to INCLUDENUL, so turn it off to avoid assertion...
Warner Losh [Sat, 29 Aug 2020 11:46:50 +0000 (11:46 +0000)]
We don't need to INCLUDENUL, so turn it off to avoid assertion...

sbuf_new_for_sysctl turns on INCLUDENUL, but we don't need it. And we assert for
it in the new bus_pnpinfo_sb and bus_location_sb strings.

3 years agoFix arm64 build after r364927
Emmanuel Vadot [Sat, 29 Aug 2020 11:39:53 +0000 (11:39 +0000)]
Fix arm64 build after r364927

Reported by: jenkins, dch
Pointy hat to: manu

3 years agoUse sbuf_cat instead of sbuf_cpy
Warner Losh [Sat, 29 Aug 2020 11:18:10 +0000 (11:18 +0000)]
Use sbuf_cat instead of sbuf_cpy

sbuf_cpy doesn't work with sysctl sbufs because of the drain function.

3 years agoFix build with RADIX_MPATH.
Alexander V. Chernikov [Sat, 29 Aug 2020 11:04:24 +0000 (11:04 +0000)]
Fix build with RADIX_MPATH.

Reported by: Hartmann, O <ohartmann@walstatt.org>

3 years agoAvoid NULL pointer dereferences
Warner Losh [Sat, 29 Aug 2020 09:59:52 +0000 (09:59 +0000)]
Avoid NULL pointer dereferences

Add back NULL pointer checks accidentally dropped in r364946. We need
to append a NUL character when that happens.

3 years agoMove to using sbuf for some sysctl in newbus
Warner Losh [Sat, 29 Aug 2020 04:30:12 +0000 (04:30 +0000)]
Move to using sbuf for some sysctl in newbus

Convert two different sysctl to using sbuf. First, for all the default
sysctls we implement for each device driver that's attached. This is a
pure sbuf conversion.

Second, convert sysctl_devices to fill its buffer with sbuf rather
than a hand-rolled crappy thing I wrote years ago.

Reviewed by: cem, markj
Differential Revision: https://reviews.freebsd.org/D26206

3 years agoRetire devctl_notify_f()
Warner Losh [Sat, 29 Aug 2020 04:30:06 +0000 (04:30 +0000)]
Retire devctl_notify_f()

devctl_notify_f isn't needed, so retire it. The flags argument is now
unused, so rather than keep it around, retire it. Convert all old
users of it to devctl_notify(). This path no longer sleeps, so is safe
to call from any context. Since it doesn't sleep, it doesn't need to
know if it is OK to sleep or not.

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agodevctl: move to using a uma zone
Warner Losh [Sat, 29 Aug 2020 04:29:53 +0000 (04:29 +0000)]
devctl: move to using a uma zone

Convert the memory management of devctl.  Rewrite if to make better
use of memory. This eliminates several mallocs (5? worse case) needed
to send a message. It's now possible to always send a message, though
if things are really backed up the oldest message will be dropped to
free up space for the newest.

Add a static bus_child_{location,pnpinfo}_sb to start migrating to
sbuf instead of buffer + length. Use it in the new code.  Other code
will be converted later (bus_child_*_str is only used inside of
subr_bus.c, though implemented in ~100 places in the tree).

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agocarrot: update bundle
Kyle Evans [Sat, 29 Aug 2020 02:46:25 +0000 (02:46 +0000)]
carrot: update bundle

Stats:
- Seven (7) removed
- Four (4) added

MFC after: 3 days

3 years agoMove fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.
Alexander V. Chernikov [Fri, 28 Aug 2020 23:01:56 +0000 (23:01 +0000)]
Move fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.

No functional changes.
Initially this function was created to perform runtime flag conversions
 for the previous incarnation of fib lookup functions. As these functions
 got deprecated, move the function to the file with the only remaining
 caller. Lastly, rename it to convert_rt_to_nh_flags() to follow the
 naming notation.

3 years agoMove net/route/shared.h definitions to net/route/route_var.h.
Alexander V. Chernikov [Fri, 28 Aug 2020 22:50:20 +0000 (22:50 +0000)]
Move net/route/shared.h definitions to net/route/route_var.h.

No functional changes.

net/route/shared.h was created in the inital phases of nexthop conversion.
It was intended to serve the same purpose as route_var.h - share definitions
 of functions and structures between the routing subsystem components. At
 that time route_var.h was included by many files external to the routing
 subsystem, which largerly defeats its purpose.

As currently this is not the case anymore and amount of route_var.h includes
 is roughly the same as shared.h, retire the latter in favour of the former.

3 years agoFurther split nhop creation and rtable operations.
Alexander V. Chernikov [Fri, 28 Aug 2020 21:59:10 +0000 (21:59 +0000)]
Further split nhop creation and rtable operations.

As nexthops are immutable, some operations such as route attribute changes
 require nexthop fetching, forking, modification and route switching.
These operations are not atomic, so they may need to be retried multiple
 times in presence of multiple speakers changing the same route.

This change introduces "synchronisation" primitive: route_update_conditional(),
 simplifying logic for route changes and upcoming multipath operations.

Differential Revision: https://reviews.freebsd.org/D26216

3 years agoFix a regression with the explicit EOR mode I introduced in r364268.
Michael Tuexen [Fri, 28 Aug 2020 20:05:18 +0000 (20:05 +0000)]
Fix a regression with the explicit EOR mode I introduced in r364268.
A short MFC time as discussed with the secteam.

Reported by: Taylor Brandstetter
MFC after: 1 day

3 years agolib: add libnetmap
Vincenzo Maffione [Fri, 28 Aug 2020 20:03:54 +0000 (20:03 +0000)]
lib: add libnetmap

This changeset introduces the new libnetmap library for writing
netmap applications.
Before libnetmap, applications could either use the kernel API
directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)

The new library offers more functionalities than netmap_user.h:
  - Support for complex netmap options, such as external memory
    allocators or per-buffer offsets. This opens the way to future
    extensions.
  - More flexibility in the netmap port bind options, such as
    non-numeric names for pipes, or the ability to specify the netmap
    allocator that must be used for a given port.
  - Automatic tracking of the netmap memory regions in use across the
    open ports.

At the moment there is no man page, but the libnetmap.h header file
has in-depth documentation.

Reviewed by: hrs
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26171

3 years agovm_pageout_scan_active: ensure ps_delta is initialized
Eric van Gyzen [Fri, 28 Aug 2020 19:59:02 +0000 (19:59 +0000)]
vm_pageout_scan_active: ensure ps_delta is initialized

Reported by: Coverity
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26212

3 years agomemstat_kvm_uma: fix reading of uma_zone_domain structures
Eric van Gyzen [Fri, 28 Aug 2020 19:50:40 +0000 (19:50 +0000)]
memstat_kvm_uma: fix reading of uma_zone_domain structures

Coverity flagged the scaling by sizeof(uzd).  That is the type
of the pointer, so the scaling was already done by pointer arithmetic.
However, this was also passing a stack frame pointer to kvm_read,
so it was doubly wrong.

Move ZDOM_GET into the !_KERNEL section and use it in libmemstat.

Reported by: Coverity
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26213

3 years agoAllow slow USB devices to be given more time to return their USB descriptors,
Hans Petter Selasky [Fri, 28 Aug 2020 19:21:11 +0000 (19:21 +0000)]
Allow slow USB devices to be given more time to return their USB descriptors,
like Logitech HD Pro Webcam C920.

PR: 248926
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoZFS: add to arm64 NOTES to minimize potential for missing symbols
Matt Macy [Fri, 28 Aug 2020 19:02:05 +0000 (19:02 +0000)]
ZFS: add to arm64 NOTES to minimize potential for missing symbols

3 years agoZFS: MFV 2.0-rc1-ga00c61
Matt Macy [Fri, 28 Aug 2020 18:53:45 +0000 (18:53 +0000)]
ZFS: MFV 2.0-rc1-ga00c61

3 years agoupdate vendor openzfs to a00c61 (2.0-rc1)
Matt Macy [Fri, 28 Aug 2020 18:41:28 +0000 (18:41 +0000)]
update vendor openzfs to a00c61 (2.0-rc1)

3 years agoarm: allwinner: clk: Add printfs when we cannot set the correct freq
Emmanuel Vadot [Fri, 28 Aug 2020 18:25:45 +0000 (18:25 +0000)]
arm: allwinner: clk: Add printfs when we cannot set the correct freq

For some unknown reason this seems to fix this function when we printf
the best variable. This isn't a delay problem as doing a printf without
it doesn't solve this problem.
This is way above my pay grade so add some printf that shouldn't be printed
in 99% of the case anyway.
Fix booting on most Allwinner boards as the mmc IP uses a NM clock.

Reported by: Alexander Mishin <mishin@mh.net.ru>
MFC after: 3 days
X-MFC-With: 363887

3 years agoTreat the boot loader as the same as the kernel for what's visible
Warner Losh [Fri, 28 Aug 2020 17:55:54 +0000 (17:55 +0000)]
Treat the boot loader as the same as the kernel for what's visible

The boot loader will be growing some (limited) support for some kernel
interfaces for some of the timekeeping routines to support zstd code.
Allow the declarations for them to be visible when compiling for the
boot loader, rather than treating it like a user-space environment
(which stand.h already provides to a limited degree).

3 years agoAllow the pseudo-errnos to be returned as well in boot loader
Warner Losh [Fri, 28 Aug 2020 17:49:56 +0000 (17:49 +0000)]
Allow the pseudo-errnos to be returned as well in boot loader

Expose the pseudo-errno values in _STANDALONE is defined so that code
in the boot loader can make use of them. Nothing uses them today, but
the zstd support that's coming will need them.

3 years agoCreate CFLAGS_EARLY.file for boot loader.
Warner Losh [Fri, 28 Aug 2020 17:36:14 +0000 (17:36 +0000)]
Create CFLAGS_EARLY.file for boot loader.

Some external code requires a specific set of include paths to work
properly since it emulates the typical environment the code is used
in. Enable this by creating a CFLAGS_EARLY.file variable that can be
used to build this stack. Otherwise the include stack we build for
stand programs may get in the way. Code that uses this feature has to
tolerate the normal stack of inclues being last on the list (and
presumably unused), though.

Generally, it it should only be used for the specific include
directories. Defines and that sort of thing should be done in the
normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for
everything in a Makefile.

3 years agoZFS: clarify dependencies for static linking
Matt Macy [Fri, 28 Aug 2020 17:06:35 +0000 (17:06 +0000)]
ZFS: clarify dependencies for static linking

3 years agoUpdate outdated comment
Warner Losh [Fri, 28 Aug 2020 17:05:06 +0000 (17:05 +0000)]
Update outdated comment

There is no splnet anymore, so update the comment to drop references
to it.

3 years agoRemove splclock(). It's not useful to keep.
Warner Losh [Fri, 28 Aug 2020 16:40:33 +0000 (16:40 +0000)]
Remove splclock(). It's not useful to keep.

splclock is used in one driver (spkr) to control access to
timer_spkr_* routines.  However, nothing else does. So it shows no
useful locking info to someone that would want to lock spkr.

NOTE: I think there's races with timer_spkr_{acquire,release} since
there's no interlock in those routines, despite there being a spin
lock to protect the clock. Current other users appear to use no extra
locking protocol, though they themselves appear to be at least
attempting to make sure that only a single thread calls these
routines. I suspect the right answer is to update these routines to
take/release the clock spin lock since they are short and to the
point, but that's beyond the scope of this commit.

3 years agosh: Keep ignored SIGINT/SIGQUIT after set in a background job
Jilles Tjoelker [Fri, 28 Aug 2020 15:35:45 +0000 (15:35 +0000)]
sh: Keep ignored SIGINT/SIGQUIT after set in a background job

If job control is not enabled, a background job (... &) ignores SIGINT and
SIGQUIT, but this can be reverted using the trap builtin in the same shell
environment.

Using the set builtin to change options would also revert SIGINT and SIGQUIT
to their previous dispositions.

This broke due to r317298. Calling setsignal() reverts the effect of
ignoresig().

Reported by: bdrewery
MFC after: 1 week

3 years agoremove splbio and splcam
Warner Losh [Fri, 28 Aug 2020 15:09:43 +0000 (15:09 +0000)]
remove splbio and splcam

splbio and splcan have been completely removed from the tree. We can
now remove their definitions here. They've been nops for a long time
and were only preserved to give hints on how to lock drivers. All
drivers have been deleted or converted, so they can be deleted now.

3 years agoDeclare time()
Warner Losh [Fri, 28 Aug 2020 05:40:02 +0000 (05:40 +0000)]
Declare time()

Time is used and was accidentally brought in through header
pollution. Declare it in stand.h directly instead.

3 years agoAdd a new line to force a commit to verify if lwhsu did indeed
Glen Barber [Fri, 28 Aug 2020 02:09:10 +0000 (02:09 +0000)]
Add a new line to force a commit to verify if lwhsu did indeed
fix the jenkins build by adding git to the dependency list.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd flags to enable NFS over TLS to the NFS client and server.
Rick Macklem [Thu, 27 Aug 2020 23:57:30 +0000 (23:57 +0000)]
Add flags to enable NFS over TLS to the NFS client and server.

An Internet Draft titled "Towards Remote Procedure Call Encryption By Default"
(soon to be an RFC I think) describes how Sun RPC is to use TLS with NFS
as a specific application case.
Various commits prepared the NFS code to use KERN_TLS, mainly enabling use
of ext_pgs mbufs for large RPC messages.
r364475 added TLS support to the kernel RPC.

This commit (which is the final one for kernel changes required to do
NFS over TLS) adds support for three export flags:
MNT_EXTLS - Requires a TLS connection.
MNT_EXTLSCERT - Requires a TLS connection where the client presents a valid
            X.509 certificate during TLS handshake.
MNT_EXTLSCERTUSER - Requires a TLS connection where the client presents a
            valid X.509 certificate with "user@domain" in the otherName
            field of the SubjectAltName during TLS handshake.
Without these export options, clients are permitted, but not required, to
use TLS.

For the client, a new nmount(2) option called "tls" makes the client do
a STARTTLS Null RPC and TLS handshake for all TCP connections used for the
mount. The CLSET_TLS client control option is used to indicate to the kernel RPC
that this should be done.

Unless the above export flags or "tls" option is used, semantics should
not change for the NFS client nor server.

For NFS over TLS to work, the userspace daemons rpctlscd(8) { for client }
or rpctlssd(8) daemon { for server } must be running.

3 years agoAdd a comment to clarify when and why cached names are deleted
Kirk McKusick [Thu, 27 Aug 2020 22:14:58 +0000 (22:14 +0000)]
Add a comment to clarify when and why cached names are deleted
during pathname lookup.

Reviewed by:  kib
MFC after:    3 days
Sponsored by: Netflix

3 years agoZFS: remove duplicate "com.datto:encryption" from loader
Matt Macy [Thu, 27 Aug 2020 21:37:35 +0000 (21:37 +0000)]
ZFS: remove duplicate "com.datto:encryption" from loader

3 years agoMerge the projects/release-git branch to head.
Glen Barber [Thu, 27 Aug 2020 21:19:16 +0000 (21:19 +0000)]
Merge the projects/release-git branch to head.
This allows building 13.x from Git instead of Subversion.

No MFC to stable branches is planned at this time. [1]

Discussed with: git working group [1]
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFH
Glen Barber [Thu, 27 Aug 2020 20:25:33 +0000 (20:25 +0000)]
MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoFix tiny style nit.
Warner Losh [Thu, 27 Aug 2020 17:46:13 +0000 (17:46 +0000)]
Fix tiny style nit.

3 years agoFix writing of the final block of encrypted, compressed kernel dumps.
Mark Johnston [Thu, 27 Aug 2020 17:36:06 +0000 (17:36 +0000)]
Fix writing of the final block of encrypted, compressed kernel dumps.

Previously any residual data in the final block of a compressed kernel
dump would be written unencrypted.  Note, such a configuration already
does not work properly when using AES-CBC since the compressed data is
typically not a multiple of the AES block length in size and EKCD does
not implement any padding scheme.  However, EKCD more recently gained
support for using the ChaCha20 cipher, which being a stream cipher does
not have this problem.

Submitted by: sigsys@gmail.com
Reviewed by: cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26188

3 years agoAdd note about NO_CLEAN build.
Warner Losh [Thu, 27 Aug 2020 17:30:57 +0000 (17:30 +0000)]
Add note about NO_CLEAN build.

NO_CLEAN doesn't quite work for some scenarios when rebuilding older
kernels, but the kernels build w/o NO_CLEAN.

3 years agoDisregard jails in jail.conf that have bad parameters (parameter/variable
Jamie Gritton [Thu, 27 Aug 2020 17:04:55 +0000 (17:04 +0000)]
Disregard jails in jail.conf that have bad parameters (parameter/variable
clash, or redefining name/jid).  The current behvaior, of merely warning
and moving on, can lead to unexpected behavior when a jail is created
without the offending parameter defined at all.

3 years agosnd_ich(4): Handle errors from ich_init() properly during resume.
Mark Johnston [Thu, 27 Aug 2020 16:36:07 +0000 (16:36 +0000)]
snd_ich(4): Handle errors from ich_init() properly during resume.

ich_init() returns an errno value or 0, but ich_pci_resume() was
comparing the return value with -1 to determine whether an error had
occurred.

PR: 248941
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agofdc(4): Handle errors from fdc_in() properly.
Mark Johnston [Thu, 27 Aug 2020 16:34:33 +0000 (16:34 +0000)]
fdc(4): Handle errors from fdc_in() properly.

fdc_in() returns only 0 and 1, some callers were checking incorrectly
for failure.

PR: 248940
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agoasmc(4): Handle errors from asmc_key_read() properly.
Mark Johnston [Thu, 27 Aug 2020 16:34:20 +0000 (16:34 +0000)]
asmc(4): Handle errors from asmc_key_read() properly.

asmc_key_read() returns only 0 and 1, some callers were checking
incorrectly for failure.

PR: 248939
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agoCorrect the conditional evaluating if git exists.
Glen Barber [Thu, 27 Aug 2020 14:36:00 +0000 (14:36 +0000)]
Correct the conditional evaluating if git exists.

Pointyhat to: gjb (myself)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years ago/etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
Cy Schubert [Thu, 27 Aug 2020 14:33:46 +0000 (14:33 +0000)]
/etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
Check for it first. Only use /boot/zfs/zpool.cache if the /etc/zfs
version is not found and good.

Reported by: avg
Suggested by: avg, kevans

3 years agoDo not unconditionally build git from ports if it already exists.
Glen Barber [Thu, 27 Aug 2020 14:29:06 +0000 (14:29 +0000)]
Do not unconditionally build git from ports if it already exists.

Sponsored by: Rubicon Communications, LLC (netgate.com)