]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFV r353141 (by phillip):
Cy Schubert [Sat, 21 Dec 2019 21:01:03 +0000 (21:01 +0000)]
MFV r353141 (by phillip):

Update libpcap from 1.9.0 to 1.9.1.

MFC after: 2 weeks

4 years agoFix VPO_UNMANAGED handling in vm_page_reclaim_run() after r353540.
Mark Johnston [Sat, 21 Dec 2019 19:04:05 +0000 (19:04 +0000)]
Fix VPO_UNMANAGED handling in vm_page_reclaim_run() after r353540.

When allocating a replacement page we must clear VPO_UNMANAGED since we
only ever reclaim pages from managed objects.  vm_page_replace() does
not handle this for us.

Sprinkle some assertions to help catch this sort of issue.

Reported by: pho
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22868

4 years agoDon't shift 32-bit value by more than 32 bits.
Gleb Popov [Sat, 21 Dec 2019 11:38:48 +0000 (11:38 +0000)]
Don't shift 32-bit value by more than 32 bits.

PR: 207854
Approved by: emaste

4 years agotop: display battery capacity remaining
Philip Paeps [Sat, 21 Dec 2019 05:03:21 +0000 (05:03 +0000)]
top: display battery capacity remaining

Submitted by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by:  imp, philip
Differential Revision:        https://reviews.freebsd.org/D22871

4 years agopowerpc: Only build mpc85xx i2c driver for mpc85xx
Justin Hibbits [Sat, 21 Dec 2019 04:44:17 +0000 (04:44 +0000)]
powerpc: Only build mpc85xx i2c driver for mpc85xx

No need to build it for every other platform.

4 years agogoogletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and...
Ryan Libby [Sat, 21 Dec 2019 02:44:50 +0000 (02:44 +0000)]
googletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and later

Pick 711fccf8317b4fb7adc21c00fc1e20823c5d875f from upstream googletest:

    Don't allow signed/unsigned wchar_t in gcc 9 and later

Upstream pull request: https://github.com/google/googletest/pull/2270

Sponsored by: Dell EMC Isilon

4 years agojemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC
Ryan Libby [Sat, 21 Dec 2019 02:44:38 +0000 (02:44 +0000)]
jemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC

Pick 2d6d099fed05b1509e81e54458516528bfbbf38d from upstream jemalloc:

    Fix GCC-9.1 warning with macro GET_ARG_NUMERIC

    GCC-9.1 reports following error when trying to compile file
    src/malloc_io.c and with CFLAGS='-Werror' :

    src/malloc_io.c: In function ‘malloc_vsnprintf’:
    src/malloc_io.c:369:2: error: case label value exceeds maximum value for type [-Werror]
      369 |  case '?' | 0x80:      \
          |  ^~~~
    src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’
      581 |     GET_ARG_NUMERIC(val, 'p');
          |     ^~~~~~~~~~~~~~~
    ...
    <snip>
    cc1: all warnings being treated as errors
    make: *** [Makefile:388: src/malloc_io.sym.o] Error 1

    The warning is reported as by default the type 'char' is 'signed char'
    and or-ing 0x80 will turn the case label char negative which will be
    beyond the printable ascii range (0 - 127).

    The patch fixes this by explicitly casting the 'len' variable as
    unsigned char' inside the 'switch' statement so that value of
    expression " '?' | 0x80 " falls within the legal values of the
    variable 'len'.

Discussed with: jasone (maintainer)
Sponsored by: Dell EMC Isilon

4 years agolibdevdctl: g++9 avoid Wdeprecated-copy
Ryan Libby [Sat, 21 Dec 2019 02:44:26 +0000 (02:44 +0000)]
libdevdctl: g++9 avoid Wdeprecated-copy

g++9 now warns about having defined an assignment operator but using the
default copy constructor, or vice versa.  Avoid the issue in libdevdctl
by just using the default assignment operator too.

Reviewed by: asomers, dim
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22887

4 years agodtrace: avoid gcc9 Walloca-larger-than
Ryan Libby [Sat, 21 Dec 2019 02:44:13 +0000 (02:44 +0000)]
dtrace: avoid gcc9 Walloca-larger-than

gcc9 grew a new warning for unbounded allocas, such as the one in
dt_options_load.  Remove both uses of alloca in dt_options.c.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22880

4 years agoDeclare packed struct ata_params as 2-byte-aligned
Ryan Libby [Sat, 21 Dec 2019 02:44:00 +0000 (02:44 +0000)]
Declare packed struct ata_params as 2-byte-aligned

This avoids gcc9 warning about unaligned access to the structure when
casting to uint16_t pointer type.

Submitted by: imp
Reviewed by: imp
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22888

4 years agogcc9: quiet Waddress-of-packed-member for user build
Ryan Libby [Sat, 21 Dec 2019 02:43:49 +0000 (02:43 +0000)]
gcc9: quiet Waddress-of-packed-member for user build

Disable the warning for WARNS <= 3.  This is lame, but it's what we
already do for the clang build.

Reviewed by: dim
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22889

4 years agogcc9: quiet Waddress-of-packed-member for kernel build
Ryan Libby [Sat, 21 Dec 2019 02:43:37 +0000 (02:43 +0000)]
gcc9: quiet Waddress-of-packed-member for kernel build

This is lame, but it's what we already do for the clang build.  We take
misaligned pointers into network header structures in many places.

Reviewed by: ian
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22876

4 years agogcc: quiet Wattribute for no_sanitize("address")
Ryan Libby [Sat, 21 Dec 2019 02:43:20 +0000 (02:43 +0000)]
gcc: quiet Wattribute for no_sanitize("address")

This is an unfortunate instance where the __has_attribute check does
not function usefully.  Gcc does have the attribute, but for gcc it only
applies to functions, not variables, and trying to apply it to a
variable generates Wattribute.  So far we only apply the attribute to
variables.  Only enable the attribute for clang, for now.

Reviewed by: Anton Rang <rang at acm.org>
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22875

4 years agoAvoid unused vars when VE_ECDSA_HASH_AGAIN undefined
Simon J. Gerraty [Fri, 20 Dec 2019 21:56:28 +0000 (21:56 +0000)]
Avoid unused vars when VE_ECDSA_HASH_AGAIN undefined

Reviewed by: emaste
MFC after: 1 week

4 years agoUpdate the man page to reflect the addition of NFSv4.2 (r355677).
Rick Macklem [Fri, 20 Dec 2019 21:45:20 +0000 (21:45 +0000)]
Update the man page to reflect the addition of NFSv4.2 (r355677).

Update all the references to NFSv4.1, so that they apply to NFSv4.1 and
NFSv4.2. Also, change the MDS->DS mounts to use NFSv4.2, so that both
versions of the protocol can be used against the server with pNFS enabled.

This is a content change.

4 years agoConsolidate FREEBSD-Xlist files of different llvm sub-projects into one.
Dimitry Andric [Fri, 20 Dec 2019 21:42:10 +0000 (21:42 +0000)]
Consolidate FREEBSD-Xlist files of different llvm sub-projects into one.

4 years agoUpdate the man page to reflect the addition of NFSv4.2 (r355677).
Rick Macklem [Fri, 20 Dec 2019 21:41:33 +0000 (21:41 +0000)]
Update the man page to reflect the addition of NFSv4.2 (r355677).

Include references to NFSv4.2 and Flexible File layout, plus clarify
when vfs.nfsd.flexlinuxhack needs to be set for Linux pNFS clients.
Also update the man page to reflect the addition of SpaceUsed to the
attributes stored in the extended attribute on the MDS (r354158).

This is a content change.

4 years agoMerge diff elimination updates from r355953 into vendor/llvm-project.
Dimitry Andric [Fri, 20 Dec 2019 21:33:12 +0000 (21:33 +0000)]
Merge diff elimination updates from r355953 into vendor/llvm-project.

4 years agoUpdate the man page to reflect the addition of NFSv4.2 (r355677).
Rick Macklem [Fri, 20 Dec 2019 21:31:08 +0000 (21:31 +0000)]
Update the man page to reflect the addition of NFSv4.2 (r355677).

Include references to NFSv4.2 and associated RFCs and note new features
present in NFSv4.2.

This is a content change.

4 years agoUpdate the man page to reflect the addition of NFSv4.2 (r355677).
Rick Macklem [Fri, 20 Dec 2019 21:25:51 +0000 (21:25 +0000)]
Update the man page to reflect the addition of NFSv4.2 (r355677).

Include references to NFSv4.2 and associated RFCs.
Also clarify when a Linux client needs to set vfs.nfsd.flexlinuxhack if
a pNFS server is in use.

This is a content change.

4 years agoEliminate differences between Git version of llvm-project master, and
Dimitry Andric [Fri, 20 Dec 2019 21:21:52 +0000 (21:21 +0000)]
Eliminate differences between Git version of llvm-project master, and
our vendor import in ^/vendor/llvm-project/master.

4 years agoMerge empty dir updates from r355950 in vendor/llvm-project.
Dimitry Andric [Fri, 20 Dec 2019 21:18:34 +0000 (21:18 +0000)]
Merge empty dir updates from r355950 in vendor/llvm-project.

4 years agoRemove empty dirs under vendor/llvm-project, which are no longer stored
Dimitry Andric [Fri, 20 Dec 2019 21:12:01 +0000 (21:12 +0000)]
Remove empty dirs under vendor/llvm-project, which are no longer stored
in git.

4 years agorandom(4): Flip default Fortuna generator over to Chacha20
Conrad Meyer [Fri, 20 Dec 2019 21:11:00 +0000 (21:11 +0000)]
random(4): Flip default Fortuna generator over to Chacha20

The implementation was landed in r344913 and has had some bake time (at
least on my personal systems).  There is some discussion of the motivation
for defaulting to this cipher as a PRF in the commit log for r344913.

As documented in that commit, administrators can retain the prior (AES-ICM)
mode of operation by setting the 'kern.random.use_chacha20_cipher' tunable
to 0 in loader.conf(5).

Approved by: csprng(delphij, markm)
Differential Revision: https://reviews.freebsd.org/D22878

4 years agoCorrect a mistakenly inverted condition in r355833.
Alan Cox [Fri, 20 Dec 2019 20:46:26 +0000 (20:46 +0000)]
Correct a mistakenly inverted condition in r355833.

Noticed by: kib
X-MFC with: r355833

4 years agoCopy llvm vendor/*/dist to vendor/llvm-project/master
Dimitry Andric [Fri, 20 Dec 2019 20:44:58 +0000 (20:44 +0000)]
Copy llvm vendor/*/dist to vendor/llvm-project/master

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo".  That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

4 years agoadd LDNS build knob dependency on OPENSSL
Ed Maste [Fri, 20 Dec 2019 20:23:59 +0000 (20:23 +0000)]
add LDNS build knob dependency on OPENSSL

Reported by: Michael Dexter's run of the Build Options Survey
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoDeduplicate code between if_delgroup() and if_delgroups().
Mark Johnston [Fri, 20 Dec 2019 20:15:34 +0000 (20:15 +0000)]
Deduplicate code between if_delgroup() and if_delgroups().

Fix some style in if_addgroup().  No functional change intended.

Reviewed by: hselasky
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22892

4 years agomii(4): Fix ivars leak when the bus device or bus children detach.
Mark Johnston [Fri, 20 Dec 2019 20:10:26 +0000 (20:10 +0000)]
mii(4): Fix ivars leak when the bus device or bus children detach.

PR: 242727
Submitted by: ghuckriede@blackberry.com
MFC after: 1 week

4 years agoMove all sources from the llvm project into contrib/llvm-project.
Dimitry Andric [Fri, 20 Dec 2019 19:53:05 +0000 (19:53 +0000)]
Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo".  That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

4 years agoFix a memory leak in if_delgroups() introduced in r334118.
Mark Johnston [Fri, 20 Dec 2019 17:21:57 +0000 (17:21 +0000)]
Fix a memory leak in if_delgroups() introduced in r334118.

PR: 242712
Submitted by: ghuckriede@blackberry.com
MFC after: 3 days

4 years agovt: store a pointer to the keyboard instead of index
Kyle Evans [Fri, 20 Dec 2019 17:15:09 +0000 (17:15 +0000)]
vt: store a pointer to the keyboard instead of index

This effectively reverts r355935, but is functionally equivalent. We gain no
benefit from storing the index and repeatedly fetching the keyboard with
`kbd_get_keyboard` when we need it. We'll be notified when it's going away
so we can clean up the pointer.

All existing references were trivially converted. Only once instance
actually needed the index.

4 years agoKill off dummy kbd drivers
Kyle Evans [Fri, 20 Dec 2019 16:22:14 +0000 (16:22 +0000)]
Kill off dummy kbd drivers

As far as I can tell, these are an artifact of times when linker sets
couldn't be empty, otherwise the kernel build would fail due to unresolved
symbols. hselasky fixed this in r268138, and I've audited the kbd portions
to make sure nothing would blow up due to the empty linker set and
successfully compiled+ran a kernel with no keyboard support at all.

Kill them off now since they're no longer required.

MFC after: 1 week

4 years agovt: fix post-boot keyboard attachment
Kyle Evans [Fri, 20 Dec 2019 16:20:38 +0000 (16:20 +0000)]
vt: fix post-boot keyboard attachment

With absolutely no keyboards attached and no kbdmux in kernel, we descend
down this error path. 0 is a valid keyboard index, so leaving
vd->vd_keyboard at 0 when there's no keyboard found is objectively wrong as
later attachment of a keyboard will fail -- it gets index 0, and vt thinks
it's already using that keyboard.

This is decidedly the corniest of corner cases, but it's easy enough to get
correct that we should do so.

Tested in a kernel without atkbdc, atkbd, psm, kbdmux, ukbd, hyperv then
loading ukbd post-boot and attaching a usb keyboard.

4 years agoVERSATILEPB: Unbreak after r355796
Kyle Evans [Fri, 20 Dec 2019 15:28:40 +0000 (15:28 +0000)]
VERSATILEPB: Unbreak after r355796

r355796 provided genkbd_get_fkeystr/genkbd_diag private and the default for
get_fkeystr/diag if these members are NULL. Follow suit here.

4 years agoImprove input validation for some parameters having a too small
Michael Tuexen [Fri, 20 Dec 2019 15:25:08 +0000 (15:25 +0000)]
Improve input validation for some parameters having a too small
reported length.

Thanks to Natalie Silvanovich from Google for finding one of these
issues in the SCTP userland stack and reporting it.

MFC after: 1 week

4 years agorandom(4): Fortuna: Enable concurrent generation by default for 13
Conrad Meyer [Fri, 20 Dec 2019 08:31:23 +0000 (08:31 +0000)]
random(4): Fortuna: Enable concurrent generation by default for 13

Flip the knob added in r349154 to "enabled."  The commit message from that
revision and associated code comment describe the rationale, implementation,
and motivation for the new default in detail.  I have dog-fooded this
configuration on my own systems for six months, for what that's worth.

For end-users: the result is just as secure.  The benefit is a faster, more
responsive system when processes produce significant demand on random(4).

As mentioned in the earlier commit, the prior behavior may be restored by
setting the kern.random.fortuna.concurrent_read="0" knob in loader.conf(5).

This scales the random generation side of random(4) somewhat, although there
is still a global mutex being shared by all cores and rand_harvestq; the
situation is generally much better than it was before on small CPU systems,
but do not expect miracles on 256-core systems running 256-thread full-rate
random(4) read.  Work is ongoing to address both the generation-side (in
more depth) and the harvest-side scaling problems.

Approved by: csprng(delphij, markm)
Tested by: markm
Differential Revision: https://reviews.freebsd.org/D22879

4 years agoiicoc: fix the build on PCI machines
Philip Paeps [Fri, 20 Dec 2019 05:15:03 +0000 (05:15 +0000)]
iicoc: fix the build on PCI machines

Pointy hat to:   philip

4 years agoPrint upper 32 bits in devmap table entries
Philip Paeps [Fri, 20 Dec 2019 03:40:53 +0000 (03:40 +0000)]
Print upper 32 bits in devmap table entries

If the devmap entry uses the upper 32 bits they wouldn't be printed in
devmap_dump_table(). This fixes that.

Submitted by:   Nicholas O'Brien <nickisobrien_gmail.com>
Sponsored by:   Axiado

4 years agoiicoc: add FDT bus attachment
Philip Paeps [Fri, 20 Dec 2019 03:40:50 +0000 (03:40 +0000)]
iicoc: add FDT bus attachment

This adds support for OpenCores I2C master controllers on FDT systems.

Reviewed by:    kp
Sponsored by:   Axiado

4 years agoiicoc: split up common core and PCI bus specifics
Philip Paeps [Fri, 20 Dec 2019 03:40:46 +0000 (03:40 +0000)]
iicoc: split up common core and PCI bus specifics

The OpenCores I2C IP core can be found on any bus.  Split out the PCI
bus specifics into their own file, only compiled on systems with PCI.

Reviewed by:    kp
Sponsored by:   Axiado

4 years agoiicoc: minor whitespace and style(9) fixes
Philip Paeps [Fri, 20 Dec 2019 03:40:07 +0000 (03:40 +0000)]
iicoc: minor whitespace and style(9) fixes

No functional changes.  This commit will make upcoming changes
which do affect functionality easier to read.

Reviewed by:    kp
Sponsored by:   Axiado

4 years agoriscv/sifive: add FU540 SPI controller driver
Philip Paeps [Fri, 20 Dec 2019 03:40:04 +0000 (03:40 +0000)]
riscv/sifive: add FU540 SPI controller driver

Initial working prototype of the Serial Peripheral Interface controller
in the SiFive FU540 SoC.

Reviewed by:    kp
Sponsored by:   Axiado

4 years agoriscv/sifive: add SiFive FU540 PRCI driver
Philip Paeps [Fri, 20 Dec 2019 03:38:21 +0000 (03:38 +0000)]
riscv/sifive: add SiFive FU540 PRCI driver

The SiFive FU540 Power Reset Clocking Interrupt block contains a PLL
that turns the input crystal (33.3MHz) into a 1-1.5GHz clock.
This clock in turn is divided by two to produce the tlclk, which is fed
into devices such as the SPI and I2C controllers.

Register a new clock device for the PRCI so that those devices can
read the correct clock through the clk framework.

Submitted by:   kp
Sponsored by:   Axiado

4 years ago[PowerPC] Only move linker sets to .data on ELFv1
Brandon Bergren [Thu, 19 Dec 2019 22:35:16 +0000 (22:35 +0000)]
[PowerPC] Only move linker sets to .data on ELFv1

In r268055, powerpc64 was special cased regarding linker sets to not mark
the function pointer as 'const'.

This appears to have been done to ensure the compiler generates the function
descriptors correctly. When non-const, the function descriptors will end up
in the .data.rel.local section, and the linker set symbols will get
relocations pointing to them there.

Since function pointers on ELFv2 are "just" pointers like other platforms,
we can leave them const like they are on every other platform.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D22796

4 years agoFix SIGINFO stack collection to ignore threads with swapped-out stacks.
Mark Johnston [Thu, 19 Dec 2019 19:34:25 +0000 (19:34 +0000)]
Fix SIGINFO stack collection to ignore threads with swapped-out stacks.

We by definition cannot trace the stack of such a thread.  Also remove a
redundant stack_zero() call in the SIGINFO handler, the stack structure
is cleared by the MD stack_capture().

Sponsored by: The FreeBSD Foundation

4 years agoFix a bug in r355784. I missed a sched_add() call that needed to reacquire
Jeff Roberson [Thu, 19 Dec 2019 18:22:11 +0000 (18:22 +0000)]
Fix a bug in r355784.  I missed a sched_add() call that needed to reacquire
the thread lock.

Reported by: mjg

4 years agolocaleconv: correct grouping and mon_grouping per C/POSIX
Ed Maste [Thu, 19 Dec 2019 17:01:25 +0000 (17:01 +0000)]
localeconv: correct grouping and mon_grouping per C/POSIX

grouping and mon_grouping should be "" in the C locale.

PR: 172215
MFC after: 6 weeks
Sponsored by: The FreeBSD Foundation

4 years agoIncluding <sys/tmpfs.h> into non-kernel software leads to a
Doug Moore [Thu, 19 Dec 2019 16:39:52 +0000 (16:39 +0000)]
Including <sys/tmpfs.h> into non-kernel software leads to a
compilation error because, without _KERNEL defined, the macro
TMPFS_VALIDATE_DIR is invoked, but never defined. User-level software
that includes sys/tmpfs.h must define _KERNEL to make the definition
of TMPFS_VALIDATE_DIR visible.

This change puts all the inline functions that, directly or
indirectly, invoke MPASS into the scope of the _KERNEL block, allowing
many user-space includers of <sys/tmpfs.h> to stop defining _KERNEL.

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

4 years agoTrim a spurious carriage return from the RFB signature string added in r355301.
John Baldwin [Thu, 19 Dec 2019 15:36:00 +0000 (15:36 +0000)]
Trim a spurious carriage return from the RFB signature string added in r355301.

Submitted by: Yamagi <lists@yamagi.org>

4 years agoipfw: Don't rollback state in alloc_table_vidx() if atomicity is not required.
Alexander V. Chernikov [Thu, 19 Dec 2019 10:22:16 +0000 (10:22 +0000)]
ipfw: Don't rollback state in alloc_table_vidx() if atomicity is not required.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22662

4 years agoRevert r355908 to commit it with a proper message.
Alexander V. Chernikov [Thu, 19 Dec 2019 10:20:38 +0000 (10:20 +0000)]
Revert r355908 to commit it with a proper message.

4 years agosvn-commit.tmp
Alexander V. Chernikov [Thu, 19 Dec 2019 09:19:27 +0000 (09:19 +0000)]
svn-commit.tmp

4 years agoStop speculation past an eret instruction
Andrew Turner [Thu, 19 Dec 2019 08:52:16 +0000 (08:52 +0000)]
Stop speculation past an eret instruction

On arm64 the eret instruction is used to return from an exception handler.
Some implementations may speculate past this instruction into the next
function. As the user may control many registers in these functions add
a synchronisation barrier sequence after the eret instruction to stop these
CPUs from speculating out of the exception handler.

PR: 242676
Submitted by: Anthony Steinhauser <asteinhauser@google.com> (previous version)
MFC after: 1 week

4 years agoTweaks for DIRDEPS_BUILD
Simon J. Gerraty [Thu, 19 Dec 2019 02:40:04 +0000 (02:40 +0000)]
Tweaks for DIRDEPS_BUILD

libmagic only depend on mkmagic if not DIRDEPS_BUILD

libpmc fix -I for libpmcstat

local.dirdeps.mk be even more careful about adding gnu/lib/csu to DIRDEPS

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D22872

4 years agoRemove VMware MSI-X from the PCI blacklist.
Mark Peek [Wed, 18 Dec 2019 23:00:56 +0000 (23:00 +0000)]
Remove VMware MSI-X from the PCI blacklist.

First reported against ESXi 5.0, PCI passthrough was not working due to
MSI-X issues. However, this issue was fixed via patch releases against
ESXi 5.5 and 6.0 in 2016. Given ESXi 5.5 and earlier have been EOL, this
patch removes the VMware MSI-X blacklist entries in the quirk table.

PR: 203874
Reviewed by: imp, jhb
MFC after: 1 month
Sponsored by: VMware
Differential Revision: https://reviews.freebsd.org/D22819

4 years agoRemove useless code from in6_rmx.c
Alexander V. Chernikov [Wed, 18 Dec 2019 22:10:56 +0000 (22:10 +0000)]
Remove useless code from in6_rmx.c

The code in questions walks IPv6 tree every 60 seconds and looks into
 the routes with non-zero expiration time (typically, redirected routes).
For each such route it sets RTF_PROBEMTU flag at the expiration time.
No other part of the kernel checks for RTF_PROBEMTU flag.

RTF_PROBEMTU was defined 21 years ago, 30 Jun 1999, as RTF_PROTO1.
RTF_PROTO1 is a de-facto standard indication of a route installed
 by a routing daemon for a last decade.

Reviewed by: bz, ae
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22865

4 years agovnic: Relax PHY node matching after r336281.
Mark Johnston [Wed, 18 Dec 2019 21:41:53 +0000 (21:41 +0000)]
vnic: Relax PHY node matching after r336281.

The phy name may apparently be followed by a number in some systems.
Allow that.

PR: 242654
Reported and tested by: Marcel <marcel@brickporch.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agocxgbe(4): check if the firmware supports FW_RI_FR_NSMR_TPTE_WR work
Navdeep Parhar [Wed, 18 Dec 2019 19:10:30 +0000 (19:10 +0000)]
cxgbe(4): check if the firmware supports FW_RI_FR_NSMR_TPTE_WR work
request.

This is used by iw_cxgbe to figure out how best to register memory.

MFC after: 1 month
Sponsored by: Chelsio Communications

4 years agooce: Tighten input validation in the SIOCGI2C handler.
Mark Johnston [Wed, 18 Dec 2019 18:44:16 +0000 (18:44 +0000)]
oce: Tighten input validation in the SIOCGI2C handler.

Missing validation meant that it was possible to read 8 bytes beyond
the end of sfp_vpd_dump_buffer.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: delphij, ram
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22859

4 years agoAdd missing "ereport." prefixes of ZFS events.
Alexander Motin [Wed, 18 Dec 2019 18:43:44 +0000 (18:43 +0000)]
Add missing "ereport." prefixes of ZFS events.

I was unable to find time when those were working.  I think they have been
broken for at least 5 years or even longer.

Discussed with: avg@
MFC after: 1 month

4 years agoWhen pmap_enter_{l2,pde}() are called to create a kernel mapping, they are
Alan Cox [Wed, 18 Dec 2019 18:21:39 +0000 (18:21 +0000)]
When pmap_enter_{l2,pde}() are called to create a kernel mapping, they are
incrementing (and decrementing) the ref_count on kernel page table pages.
They should not do this.  Kernel page table pages are expected to have a
fixed ref_count.  Address this problem by refactoring pmap_alloc{_l2,pde}()
and their callers.  This also eliminates some duplicated code from the
callers.

Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel
mappings.

Reduce code duplication by defining a function, pmap_abort_ptp(), for
handling a common error case.

Handle a possible page table page leak in pmap_copy().  Suppose that we are
determining whether to copy a superpage mapping.  If we abort because there
is already a mapping in the destination pmap at the current address, then
simply decrementing the page table page's ref_count is correct, because the
page table page must have a ref_count > 1.  However, if we abort because we
failed to allocate a PV entry, this might be a just allocated page table
page that has a ref_count = 1, so we should call pmap_abort_ptp().

Simplify error handling in pmap_enter_quick_locked().

Reviewed by: kib, markj (an earlier)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22763

4 years agoDrop a sleepable lock when we plan on sleeping
Warner Losh [Wed, 18 Dec 2019 16:01:15 +0000 (16:01 +0000)]
Drop a sleepable lock when we plan on sleeping

g_io_speedup waits for the completion of the speedup request before proceeding
using biowait(), but check_clear_deps is called with the softdeps lock held
(which is non-sleepable). It's safe to drop this lock around the call to
speedup, so do that.

Submitted by: Peter Holm
Reviewed by: kib@

4 years agoLeave multicast group before reaping and committing state for both
Hans Petter Selasky [Wed, 18 Dec 2019 12:06:34 +0000 (12:06 +0000)]
Leave multicast group before reaping and committing state for both
IPv4 and IPv6.

This fixes a regression issue after r349369. When trying to exit a
multicast group before closing the socket, a multicast leave packet
should be sent.

Differential Revision: https://reviews.freebsd.org/D22848
PR: 242677
Reviewed by: bz (network)
Tested by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoRestore important comment in RCU/EPOCH support in FreeBSD after r355784.
Hans Petter Selasky [Wed, 18 Dec 2019 09:30:32 +0000 (09:30 +0000)]
Restore important comment in RCU/EPOCH support in FreeBSD after r355784.

Sponsored by: Mellanox Technologies

4 years agoacpi(4): Add _CID to PNP info string
Conrad Meyer [Wed, 18 Dec 2019 06:22:28 +0000 (06:22 +0000)]
acpi(4): Add _CID to PNP info string

While a given ACPI device may have 0-N compatibility IDs, in practice most
seem to have 0 or 1.  If one is present, emit it as part of the PNP info
string associated with a device.  This could enable MODULE_PNP_INFO-based
automatic kldload for ACPI drivers associated with a given _CID (but without
a good _HID or _UID identifier).

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D22846

4 years agobcm2835_vcbus: add legacy compat mappings
Kyle Evans [Wed, 18 Dec 2019 02:29:27 +0000 (02:29 +0000)]
bcm2835_vcbus: add legacy compat mappings

I've opted for just duplicating the two entries needed for this, rather than
writing any other mechanism for maintaining two root compat entries to map
to one config, for simplicity. We'll eventually declare these legacy DTB
unsupported, but let's not do that yet while there's no real burden.

4 years agoFix the aflag shift on big-endian platforms after r355672.
Mark Johnston [Wed, 18 Dec 2019 01:56:38 +0000 (01:56 +0000)]
Fix the aflag shift on big-endian platforms after r355672.

The structure offset is zero regardless of endianness.

Reported by: brooks
Pointy hat: markj

4 years agoAdd support for TLS 1.3 using AES-GCM to the OCF backend for KTLS.
John Baldwin [Wed, 18 Dec 2019 01:37:00 +0000 (01:37 +0000)]
Add support for TLS 1.3 using AES-GCM to the OCF backend for KTLS.

Reviewed by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D22802

4 years agoAdd a structure for the AAD used in TLS 1.3.
John Baldwin [Wed, 18 Dec 2019 01:33:20 +0000 (01:33 +0000)]
Add a structure for the AAD used in TLS 1.3.

While here, add RFC numbers to comments about nonce and AAD data
for TLS 1.2.

Reviewed by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D22801

4 years agoBump Dd for changes in r355866.
John Baldwin [Wed, 18 Dec 2019 01:27:49 +0000 (01:27 +0000)]
Bump Dd for changes in r355866.

Pointy hat to: jhb
MFC after: 2 weeks

4 years agoarm: add SOC_BRCM_BCM2837 option, include it in GENERIC
Kyle Evans [Tue, 17 Dec 2019 23:01:37 +0000 (23:01 +0000)]
arm: add SOC_BRCM_BCM2837 option, include it in GENERIC

We use armv7/GENERIC for the RPI2 images. The original RPI2 is actually a
32-bit BCM2836, but v1.2 was upgraded to the 64-bit BCM2837. The project
continues to provide the RPI2 image as armv7, as it's the lowest common
denominator of the two. Historically, we've just kind of implicitly
acknowledged this by including some bcm2837 bits on a SOC_BCM2836 kernel
config -- this worked until r354875 added code that actually cared.

Acknowledge formally that BCM2837 is valid in arm32.

This name is inconsistent with the other BCM* SOC on !arm64 for two reasons:

1. It's a pre-existing option on arm64, and
2. the naming convention on arm/ should've arguably changed to include BRCM

#1 seems to be a convincing enough argument to maintain the existing name
for it.

4 years agoUpdate the crypto(4) and crypto(9) manpages.
John Baldwin [Tue, 17 Dec 2019 22:58:07 +0000 (22:58 +0000)]
Update the crypto(4) and crypto(9) manpages.

There are probably bits that are still wrong, but this fixes some
things at least:
- Add named arguments to the functions in crypto(9).
- Add missing algorithms.
- Don't mention arguments that don't exist in crypto_register.
- Add CIOGSESSION2.
- Remove CIOCNFSESSION.
- Clarify some stale language that assumed an fd had only one sesson.
- Note that you have to use CRIOGET and add a note in BUGS lamenting
  that one has to use CRIOGET.
- Various other cleanups.

Reviewed by: cem (earlier version)
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D22784

4 years agoRevert r355833
Warner Losh [Tue, 17 Dec 2019 21:53:22 +0000 (21:53 +0000)]
Revert r355833

While it works on nda, it fails on ada and/or da for at least zfs with a modify
after free issue on a trim BIO. Revert while I rework it to fix those devices.

4 years agoan(4): Require privileges for all SIOCGAIRONET requests.
Mark Johnston [Tue, 17 Dec 2019 21:34:38 +0000 (21:34 +0000)]
an(4): Require privileges for all SIOCGAIRONET requests.

SIOCGAIRONET allows userspace to query an(4) for various device
properties and configuration, which appears to potentially include
sensitive information such as WEP keys (an(4) seems to predate WPA).

Also avoid races by copying in the request structure to a temporary
buffer before locking and modifying the device softc.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip failing sys.geom.class.multipath.failloop.failloop on i386 CI
Li-Wen Hsu [Tue, 17 Dec 2019 19:01:09 +0000 (19:01 +0000)]
Temporarily skip failing sys.geom.class.multipath.failloop.failloop on i386 CI

PR: 242689
Sponsored by: The FreeBSD Foundation

4 years agoRemove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2c
Ian Lepore [Tue, 17 Dec 2019 17:03:03 +0000 (17:03 +0000)]
Remove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2c
where it got copied to.

4 years agoThis commit is a bit of a re-arrange of deck chairs. It
Randall Stewart [Tue, 17 Dec 2019 16:08:07 +0000 (16:08 +0000)]
This commit is a bit of a re-arrange of deck chairs. It
gets both rack and bbr ready for the completion of the STATs
framework in FreeBSD. For now if you don't have both NF_stats and
stats on it disables them. As soon as the rest of the stats framework
lands we can remove that restriction and then just uses stats when
defined.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D22479

4 years agoUpdate owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.
Ian Lepore [Tue, 17 Dec 2019 15:56:48 +0000 (15:56 +0000)]
Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.

It used to be required that a device be a child of gpiobus(4) to manipulate
gpio pins. That requirement didn't work well for FDT-based systems with many
cross-hierarchy users of gpio, so a more modern framework was created that
removed the old hierarchy requirement.

These changes adapt the owc_gpiobus driver to use the newer gpio_pin_*
functions to acquire, release, and manipulate gpio pins. This allows a
single driver to work for both hinted-attachment and fdt-based systems, and
removes the requirement that any one-wire fdt nodes must appear at the root
of the devicetree.

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

4 years agoConvert zpcpu_* inlines to macros and add zpcpu_replace.
Mateusz Guzik [Tue, 17 Dec 2019 14:53:55 +0000 (14:53 +0000)]
Convert zpcpu_* inlines to macros and add zpcpu_replace.

This allows them to do basic type casting internally, effectively relieving
consumers from having to cast on their own.

4 years agoReplace homemade getline(3) by actual getline(3)
Baptiste Daroussin [Tue, 17 Dec 2019 11:03:32 +0000 (11:03 +0000)]
Replace homemade getline(3) by actual getline(3)

4 years agoarm64: rockchip: rk_gpio: Fix pin number
Emmanuel Vadot [Tue, 17 Dec 2019 10:57:31 +0000 (10:57 +0000)]
arm64: rockchip: rk_gpio: Fix pin number

The maxpin counter starts at 0, fix one by one error.
This is still not totally correct for some banks in some SoC that have
fewer pins but this will be dealt with in another commit.

MFC after: 3 days

4 years agoarm64: rockchip: rk_pinctrl: Fix clear bits in SYSCON_MODIFY
Emmanuel Vadot [Tue, 17 Dec 2019 10:55:28 +0000 (10:55 +0000)]
arm64: rockchip: rk_pinctrl: Fix clear bits in SYSCON_MODIFY

r351187 change the SYSCON_WRITE to SYSCON_MODIFY but didn't changed the
mask variable that used to hold the bitmask in the upper 16 bits of the
register that control which bits are changed. So we ended up clearing
bit from the upper 16bits half which are always 0 after a read.
Use the correct bit mask for bits that we want to clear.

MFC after: 3 days

4 years agoUse strtoimax.
Baptiste Daroussin [Tue, 17 Dec 2019 09:13:48 +0000 (09:13 +0000)]
Use strtoimax.

Use existing strtoimax instead of reinventing it

4 years agoloader.efi: efi_readkey_ex needs to key despite the shift status or toggle status
Toomas Soome [Tue, 17 Dec 2019 08:30:11 +0000 (08:30 +0000)]
loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status

From UEFI specification 2.8, page 434:
"It should also be noted that certain input devices may not be able to produce
shift or toggle state information, and in those cases the high order bit in
the respective Toggle and Shift state fields should not be active."

But we still need to check for ScanCode and UnicodeChar.

PR: 242660
Reported by: Trond Endrestol
MFC after: 1 week

4 years agoRevert r355831
Warner Losh [Tue, 17 Dec 2019 04:21:35 +0000 (04:21 +0000)]
Revert r355831

It wasn't supposed to change the defaults, but actually does. Back this out
until that can be sorted out.

4 years agokbd: const'ify a couple of keyboard_driver fields
Kyle Evans [Tue, 17 Dec 2019 03:30:49 +0000 (03:30 +0000)]
kbd: const'ify a couple of keyboard_driver fields

Nothing modifies these things, but const'ify out of an abundance of caution.
If we could const'ify the definition in each keyboard driver, I likely
would- improper mutations here can lead to misbehavior or slightly more
annoying to debug state.

4 years agoTwo minor issues:
Warner Losh [Tue, 17 Dec 2019 03:20:37 +0000 (03:20 +0000)]
Two minor issues:
(1) Don't define load/store 64 atomics for o32. They aren't atomic
there.
(2) Add comment about why we need 64 atomic define on n32 only.

4 years agoConvert routing statistics to VNET_PCPUSTAT.
Gleb Smirnoff [Tue, 17 Dec 2019 02:02:26 +0000 (02:02 +0000)]
Convert routing statistics to VNET_PCPUSTAT.

Submitted by: ocochard
Reviewed by: melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D22834

4 years agoForgotten to remove the previous if statement in commit r355838.
Marcelo Araujo [Tue, 17 Dec 2019 01:37:02 +0000 (01:37 +0000)]
Forgotten to remove the previous if statement in commit r355838.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19400

4 years agoAttempt to load vmm(4) module before creating a guest using vm_create()
Marcelo Araujo [Tue, 17 Dec 2019 01:33:26 +0000 (01:33 +0000)]
Attempt to load vmm(4) module before creating a guest using vm_create()
wrapper in libvmmapi.

Submitted by: Rob Fairbanks <rob.fx907_gmail.com>
Reviewed by: jhb
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19400

4 years agoImplement bio_speedup
Warner Losh [Tue, 17 Dec 2019 00:13:45 +0000 (00:13 +0000)]
Implement bio_speedup

React to the BIO_SPEED command in the cam io scheduler by completing
as successful BIO_DELETE commands that are pending, up to the length
passed down in the BIO_SPEEDUP cmomand. The length passed down is a
hint for how much space on the drive needs to be recovered. By
completing the BIO_DELETE comomands, this allows the upper layers to
allocate and write to the blocks that were about to be trimmed. Since
FreeBSD implements TRIMSs as advisory, we can eliminliminate them and
go directly to writing.

The biggest benefit from TRIMS coomes ffrom the drive being able t
ooptimize its free block pool inthe log run. There's little nto no
bene3efit in the shoort term. , sepeciall whn the trim is followed by
a write. Speedup lets  us make this tradeoff.

Reviewed by: kirk, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18351

4 years agoAdd BIO_SPEEDUP signalling to UFS
Warner Losh [Tue, 17 Dec 2019 00:13:40 +0000 (00:13 +0000)]
Add BIO_SPEEDUP signalling to UFS

When we have a resource shortage in UFS, send down a BIO_SPEEDUP to
give the CAM I/O scheduler a heads up that we have a resource shortage
and that it should bias its decisions knowing that.

Reviewed by: kirk, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18351

4 years agoAdd BIO_SPEEDUP
Warner Losh [Tue, 17 Dec 2019 00:13:35 +0000 (00:13 +0000)]
Add BIO_SPEEDUP

Add BIO_SPEEDUP bio command and g_io_speedup wrapper. It tells the
lower layers that the upper layers are dealing with some shortage
(dirty pages and/or disk blocks). The lower layers should do what they
can to speed up anything that's been delayed.

The first use will be to tell the CAM I/O scheduler that any TRIM
shaping should be short-circuited because the system needs
blocks. We'll also call it when there's too many resources used by
UFS.

Reviewed by: kirk, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18351

4 years agoEliminate the TRIM_ACTIVE flag.
Warner Losh [Tue, 17 Dec 2019 00:13:30 +0000 (00:13 +0000)]
Eliminate the TRIM_ACTIVE flag.

Rather than a trim active flag, have a counter that can be used to
have a absolute limit on the number of trims in flight independent of
any I/O limiting factors.

Sponsored by: Netflix

4 years agoTweak the ddb show cam iosched command a bit.
Warner Losh [Tue, 17 Dec 2019 00:13:26 +0000 (00:13 +0000)]
Tweak the ddb show cam iosched command a bit.

For each of the different queue types, list the name of the
queue. While it can be worked out from context, this makes it more
useful and clearer.

Sponsored by: Netflix

4 years agoAdd rate limiters to TRIM.
Warner Losh [Tue, 17 Dec 2019 00:13:21 +0000 (00:13 +0000)]
Add rate limiters to TRIM.

Add rate limiters to trims. Trims are a bit different than reads or
writes in that they can be combined, so some care needs to be taken
where we rate limit them. Additional work will be needed to push the
working rate limit below the I/O quanta rate for things like IOPS.

Sponsored by: Netflix

4 years agoNVME trim stuff.
Warner Losh [Tue, 17 Dec 2019 00:11:48 +0000 (00:11 +0000)]
NVME trim stuff.

Add two sysctls to control pacing of nvme
trims. kern.cam.nda.X.goal_trim is the number of upper layer
BIO_DEELETE requests to try to collecet before sending TRIM down too
the nvme drive. trim_ticks is the number of ticks, at mosot, to wait
for at least goal_trim BIOS_DELEETE requests to come in.

Trim pacing is useful when a large number off disjoint trims are
comoing in from the upper layers. Since we have no way to chain
toogether trims from the upper layers that are sent down, this acts as
a hueristic to group trims into reasonable sized chunks. What's
reasonable varies from drive to drive.

Sponsored by: Netflix

4 years agoAvoid a tautological bitwise compare.
Brooks Davis [Tue, 17 Dec 2019 00:10:19 +0000 (00:10 +0000)]
Avoid a tautological bitwise compare.

This looks like a bit of debugging code that sliped into the initial
import of the new ATA framework. This changes the behavior to omit a
line of output that appears to have been intended for omission.

Reviewed by: mav
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22845

4 years ago[atheros] [mips] Add the GPIO driver (back) to the TL-WDR3600/TL-WDR4300 kernel.
Adrian Chadd [Tue, 17 Dec 2019 00:00:03 +0000 (00:00 +0000)]
[atheros] [mips] Add the GPIO driver (back) to the TL-WDR3600/TL-WDR4300 kernel.

So it turns out that sometime in the past I removed the GPIO bits here
and was going to move it into a module in order to save a little space.
However, it turns out that was a mistake on this particular AP - it
uses a pair of GPIO lines to control the two receive LNAs on the 2GHz
radio and without them enabled the radio is a LOT DEAF.

With this re-introduced (and some replacement userland tools to save
space, *cough* cpio/libarchive) I can actually use these chipsets
again as a 2G station.  Without the LNA the AP was seeing a per-radio
RSSI upstairs here of around 3-5dB, with the LNA on it's around 15dB,
more than enough to actually use wifi upstairs and also in line with
the other Atheros / Intel devices I have up here.

Big oopsie to Adrian.  Big, big oopsie.