]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agopowerpc: repeat of r356044
Kyle Evans [Mon, 23 Dec 2019 21:57:11 +0000 (21:57 +0000)]
powerpc: repeat of r356044

It would have been nice to not have these duplicated in every single
sc_machdep.

4 years agoterasic_mtl: kill off final dummy keyboard driver
Kyle Evans [Mon, 23 Dec 2019 21:46:48 +0000 (21:46 +0000)]
terasic_mtl: kill off final dummy keyboard driver

The rest were removed in r355936, which speculated that the cause of this
phenomenon was due to an inability to have an empty linker set. The comment
included with this one shows that this was, in fact, not the reason.

Regardless, syscons no longer seems to have an issue with not having any
keyboard drivers and in-fact ignores the keyboard probe anyways.

X-MFC-With: r355936

4 years agosc: fix arm/mips/sparc64 MD bits
Kyle Evans [Mon, 23 Dec 2019 21:41:04 +0000 (21:41 +0000)]
sc: fix arm/mips/sparc64 MD bits

r356043 missed a couple of references in machdep parts... arguably, these
lines could probably be dropped as the softc is likely still zero'd at this
point.

Pointy hat: kevans

4 years agosyscons: drop keyboard index from softc
Kyle Evans [Mon, 23 Dec 2019 21:32:07 +0000 (21:32 +0000)]
syscons: drop keyboard index from softc

Analysis seems to reveal that sc->keyboard >= 0 implies sc->kbd != NULL and
there's no such scenario where sc->kbd is set (and theoretically used to
rebuild sc->keyboard) with the keyboard unavailable.

Drop the index softc. The index is only explicitly needed in few places, in
which case we can just as easily grab it from sc->kbd. There's no need for
keeping sc->kbd and sc->keyboard in sync when it can be readily accomplished
with just the former.

4 years agoMake pass(4) handle misaligned buffers of MAXPHYS size.
Alexander Motin [Mon, 23 Dec 2019 20:41:55 +0000 (20:41 +0000)]
Make pass(4) handle misaligned buffers of MAXPHYS size.

Since we are already using malloc()+copyin()/copyout() for smaller data
blocks, and since new asynchronous API does it always, I see no reason
to keep this ugly artificial size/alignment limitation in old API.

Tape applications suffer enough from the MAXPHYS limitations by itself,
and additional alignment requirement, often halving effectively usable
block size, does not help.

It would be good to use unmapped I/O here instead, but it require some
HBA drivers polishing first to support non-BIO unmapped buffers.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agofstyp(8): Fix WITHOUT_ICONV build
Conrad Meyer [Mon, 23 Dec 2019 20:23:02 +0000 (20:23 +0000)]
fstyp(8): Fix WITHOUT_ICONV build

Reported by: olivier

4 years agoFix undefined behavior: left-shifting into the sign bit.
Konstantin Belousov [Mon, 23 Dec 2019 20:18:05 +0000 (20:18 +0000)]
Fix undefined behavior: left-shifting into the sign bit.

Reviewed by: dim, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D22898

4 years agoDo not use waitable allocation of pbuf when creating cluster for write.
Konstantin Belousov [Mon, 23 Dec 2019 20:15:19 +0000 (20:15 +0000)]
Do not use waitable allocation of pbuf when creating cluster for write.

Previously just ensuring that we do not sleep when clustering for
md(4) vnode was enough.  Now, with the switch of the pbuf allocator to
uma and completely broken per-subsystem pbuf limits, it might cause
unbounded sleep even for non-md(4) vnodes.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D22899

4 years agofstyp(8): Detect APFS containers
Conrad Meyer [Mon, 23 Dec 2019 05:43:18 +0000 (05:43 +0000)]
fstyp(8): Detect APFS containers

APFS NXSBs are more like slices (or zvols?) than individual filesystem,
but go ahead and detect them nicely as well.

4 years agofstyp(8): Detect HFS+ / HFSX volumes
Conrad Meyer [Mon, 23 Dec 2019 05:43:01 +0000 (05:43 +0000)]
fstyp(8): Detect HFS+ / HFSX volumes

4 years agofstyp(8): Use iconv(3) to convert NTFS vol labels correctly
Conrad Meyer [Mon, 23 Dec 2019 02:41:13 +0000 (02:41 +0000)]
fstyp(8): Use iconv(3) to convert NTFS vol labels correctly

Rather than hackily extracting only the ASCII subset of UTF-16LE, go ahead
and convert the label to the user's locale correctly.

4 years agoIn gptboot, don't assume a partition number is a single digit, 1-9. GPT
Ian Lepore [Sun, 22 Dec 2019 22:33:22 +0000 (22:33 +0000)]
In gptboot, don't assume a partition number is a single digit, 1-9.  GPT
partitions can have 128 partitions, so parse contiguous digits and then
validate that the number is between 1-128 inclusive.

I'm not sure 128 is a hard limit in the GPT standard, but it's the common
number in use, and it's a better upper limit than 9.

4 years agoCompile uart_cpu_acpi.c, added in r348195, into uart.ko.
Mark Johnston [Sun, 22 Dec 2019 22:10:20 +0000 (22:10 +0000)]
Compile uart_cpu_acpi.c, added in r348195, into uart.ko.

PR: 242771
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agolagg: Clean up handling of the rr_limit option.
Mark Johnston [Sun, 22 Dec 2019 21:56:47 +0000 (21:56 +0000)]
lagg: Clean up handling of the rr_limit option.

- Don't allow an unprivileged user to set the stride. [1]
- Only set the stride under the softc lock.
- Rename the internal fields to accurately reflect their use.  Keep
  ro_bkt to avoid changing the user API.
- Simplify the implementation.  The port index is just sc_seq / stride.
- Document rr_limit in ifconfig.8.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> [1]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22857

4 years agoFix typo using RB_INITIALIZER.
Doug Moore [Sun, 22 Dec 2019 21:53:05 +0000 (21:53 +0000)]
Fix typo using RB_INITIALIZER.

The macro RB_INITIALIZER ignores its argument, but is documented to
require "&head" as argument to initialize "head".  So using
"_vm_phys_fictitious_tree" as the argument to initialize
"vm_phys_fictitious_tree" is an inconsequential error, corrected here.

Discussed with: alc

4 years agoFix a bug introduced in r356002. Prior versions of this patchset had
Jeff Roberson [Sun, 22 Dec 2019 20:35:50 +0000 (20:35 +0000)]
Fix a bug introduced in r356002.  Prior versions of this patchset had
vm_page_remove() rather than !vm_page_wired() as the condition for free.
When this changed back to wired the busy lock was leaked.

Reported by: pho
Reviewed by: markj

4 years agoMerge commit f97936fab from llvm git (by Eric Fiselier):
Dimitry Andric [Sun, 22 Dec 2019 11:58:44 +0000 (11:58 +0000)]
Merge commit f97936fab from llvm git (by Eric Fiselier):

  [libc++] Cleanup and enable multiple warnings.

  Too many warnings are being disabled too quickly. Warnings are
  important to keeping libc++ correct. This patch re-enables two
  warnings: -Wconstant-evaluated and -Wdeprecated-copy.

  In future, all warnings disabled for the test suite should require an
  attached bug. The bug should state the plan for re-enabling that
  warning, or a strong case why it should remain disabled.

This should fix a number of new g++ 9 warnings.

Requested by: rlibby
MFC after: 3 days

4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Sun, 22 Dec 2019 11:50:44 +0000 (11:50 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
9.0.1 final release c1a0a213378a458fbea1a5c77b315c7dce08fd05.

Release notes for llvm, clang, lld and libc++ 9.0.1 will become
available here:

https://releases.llvm.org/9.0.1/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/projects/libcxx/docs/ReleaseNotes.html

PR: 240629
MFC after: 1 month

4 years agoMake page busy state deterministic on free. Pages must be xbusy when
Jeff Roberson [Sun, 22 Dec 2019 06:56:44 +0000 (06:56 +0000)]
Make page busy state deterministic on free.  Pages must be xbusy when
removed from objects including calls to free.  Pages must not be xbusy
when freed and not on an object.  Strengthen assertions to match these
expectations.  In practice very little code had to change busy handling
to meet these rules but we can now make stronger guarantees to busy
holders and avoid conditionally dropping busy in free.

Refine vm_page_remove() and vm_page_replace() semantics now that we have
stronger guarantees about busy state.  This removes redundant and
potentially problematic code that has proliferated.

Discussed with: markj
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D22822

4 years agoAdd vmgenc(4) driver for ACPI VM generation counter
Conrad Meyer [Sun, 22 Dec 2019 06:25:20 +0000 (06:25 +0000)]
Add vmgenc(4) driver for ACPI VM generation counter

The VM generation counter is a 128-bit value exposed by the BIOS via ACPI.
The value changes to another unique identifier whenever a VM is duplicated.
Additionally, ACPI provides notification events when such events occur.

The driver decodes the pointer to the UUID, exports the value to userspace
via OPAQUE sysctl blob, and forwards the ACPI notifications in the form of
an EVENTHANDLER invocation as well as userspace devctl events.

See design paper: https://go.microsoft.com/fwlink/p/?LinkID=260709

4 years agoRemove unused includes.
Xin LI [Sun, 22 Dec 2019 05:44:29 +0000 (05:44 +0000)]
Remove unused includes.

MFC after: 2 weeks

4 years agoMove vm_fault busy logic into its own function for clarity and re-use by
Jeff Roberson [Sun, 22 Dec 2019 04:21:16 +0000 (04:21 +0000)]
Move vm_fault busy logic into its own function for clarity and re-use by
later changes.

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

4 years agofstyp(8): Show exFAT volume labels with -l flag
Conrad Meyer [Sun, 22 Dec 2019 03:19:17 +0000 (03:19 +0000)]
fstyp(8): Show exFAT volume labels with -l flag

exfat is fundamentally the same design as fat32.  The superblock differs
marginally, and there are some additional optional features irrelevant to
fstype(8); the structure of dirents has changed slightly to enable, among
other things, larger files; the directory entries are no longer DOS 8.3
ASCII or local 8-bit encoding, but instead explicitly UCS-2-LE.

(As a result, this change uses iconv to convert a found exfat volume label
to the user's locale.)

Locating the volume label is identical to FAT32: locate the root directory
and walk through dirents until you find a volume label.  Like FAT32, follow
the FAT chain between root directory clusters as necessary.

PR: 242225
Reported by: Victor Sudakov <vas AT sibptus.ru>

4 years agoFix typo in hastd.8 manual page.
Kirk McKusick [Sun, 22 Dec 2019 01:22:51 +0000 (01:22 +0000)]
Fix typo in hastd.8 manual page.

Reported by: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
MFC after:   3 days

4 years agoUpdate the nfsstat man page to reflect r355992.
Rick Macklem [Sun, 22 Dec 2019 00:36:22 +0000 (00:36 +0000)]
Update the nfsstat man page to reflect r355992.

r355992 added listing of NFSv4.2 procedure and operation counts.
This patch updates the nfsstat.1 man page to reflect that change.

This is a content change.

4 years agoUpdate nfsstat to list the NFSv4.2 procedures and operations.
Rick Macklem [Sun, 22 Dec 2019 00:12:22 +0000 (00:12 +0000)]
Update nfsstat to list the NFSv4.2 procedures and operations.

r355677 added NFSv4.2 support to the NFS client and server. It also updated
the nfsstats structure to keep counts for the new procedures (client) and
operations (server) added for NFSv4.2.
This patch updates the "-E" option of nfsstat so that it lists counts for
these new procedures and operations.

4 years agoMicro-optimize the control flow in _pmap_unwire_ptp(), and eliminate
Alan Cox [Sat, 21 Dec 2019 22:32:24 +0000 (22:32 +0000)]
Micro-optimize the control flow in _pmap_unwire_ptp(), and eliminate
unnecessary parentheses.

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

4 years agoMFV r355890:
Cy Schubert [Sat, 21 Dec 2019 21:05:53 +0000 (21:05 +0000)]
MFV r355890:

Fix libpcap issue #893: check for invalid IPv4 addresses.

This fixes errors such as:

tcpdump -i lagg0 net 999.999.999.999

This was originally discovered on a Red Hat 7.7 server and verified
to also be a bug on FreeBSD.

Obtained from: https://github.com/the-tcpdump-group/libpcap/commit/ \
07070918d5e81a515315b395f334e52589fe0fb
Fixed by: https://github.com/guyharris
MFC after: 2 weeks

4 years agoMFV r353143 (phillip):
Cy Schubert [Sat, 21 Dec 2019 21:02:50 +0000 (21:02 +0000)]
MFV r353143 (phillip):

Update tcpdump from 4.9.2 to 4.9.3.

MFC after: 2 weeks

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 agoVendor import of llvm-project tag llvmorg-9.0.1:
Dimitry Andric [Fri, 20 Dec 2019 21:55:13 +0000 (21:55 +0000)]
Vendor import of llvm-project tag llvmorg-9.0.1:
https://github.com/llvm/llvm-project/tree/llvmorg-9.0.1

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 release/9.x,
Dimitry Andric [Fri, 20 Dec 2019 21:25:22 +0000 (21:25 +0000)]
Eliminate differences between Git version of llvm-project release/9.x,
and our vendor import in ^/vendor/llvm-project/release-9.x.

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 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-release_90 to vendor/llvm-project/release-9.x
Dimitry Andric [Fri, 20 Dec 2019 20:46:11 +0000 (20:46 +0000)]
Copy llvm vendor/*/dist-release_90 to vendor/llvm-project/release-9.x

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 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 agoFix libpcap issue #893: check for invalid IPv4 addresses.
Cy Schubert [Thu, 19 Dec 2019 00:11:18 +0000 (00:11 +0000)]
Fix libpcap issue #893: check for invalid IPv4 addresses.

This fixes errors such as:

tcpdump -i lagg0 net 999.999.999.999

This was originally discovered on a Red Hat 7.7 server and verified
to also be a bug on FreeBSD.

Obtained from: https://github.com/the-tcpdump-group/libpcap/commit/ \
07070918d5e81a515315b395f334e52589fe0fb
Fixed by: https://github.com/guyharris

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