]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years ago- Update head to 13.0-CURRENT.
gjb [Fri, 19 Oct 2018 00:37:47 +0000 (00:37 +0000)]
- Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
  FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDo not flush cache for PCIe config window.
kib [Thu, 18 Oct 2018 20:49:16 +0000 (20:49 +0000)]
Do not flush cache for PCIe config window.

Apparently AMD machines cannot tolerate this. This was uncovered by
r339386, where cache flush started really flushing the requested range.

Introduce pmap_mapdev_pciecfg(), which simply does not flush cache
comparing with pmap_mapdev().  It assumes that the MCFG region was
never accessed through the cacheable mapping, which is most likely
true for machine to boot at all.

Note that i386 does not need the change, since the architecture
handles access per-page due to the KVA shortage, and page remapping
already does not flush the cache.

Reported and tested by: mjg, Mike Tancsa <mike@sentex.net>
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D17612

5 years agoIn r78161 the lookup_set linker method was introduced which optionally
bz [Thu, 18 Oct 2018 20:20:41 +0000 (20:20 +0000)]
In r78161 the lookup_set linker method was introduced which optionally
returns the section start and stop locations as well as a count if the
caller asks for them.
There was only one out-of-file consumer of count which did not actually
use it and hence was eliminated in r339407.
In r194784 parse_dpcpu(), and in r195699 parse_vnet() (a copy of the
former) started to use the link_elf_lookup_set() interface internally
also asking for the count.

count is computed as the difference of the void **stop - void **start
locations and as such, if the absoulte numbers
(stop - start) % sizeof(void *) != 0
a round-down happens, e.g., **stop 0x1003 - **start 0x1000 => count 0.

To get the section size instead of "count is the number of pointer
elements in the section", the parse_*() functions do a
count *= sizeof(void *).
They use the result to allocate memory and copy the section data
into the "master" and per-instance memory regions with a size of
count.

As a result of count possibly round-down this can miss the last
bytes of the section.  The good news is that we do not touch
out of bounds memory during these operations (we may at a later stage
if the last bytes would overflow the master sections).
Given relocation in elf_relocaddr() works based on the absolute
numbers of start and stop, this means that we can possibly try to
access relocated data which was never copied and hence we get
random garbage or at best zeroed memory.

Stop the two (last) consumers of count (the parse_*() functions)
from using count as well, and calculate the section size based on
the absolute numbers of stop and start and use the proper size for
the memory allocation and data copies.  This will make the symbols
in the last bytes of the pcpu or vnet sections be presented as
expected.

PR: 232289
Approved by: re (gjb)
MFC after: 2 weeks

5 years agoThe handling of RST segments in the SYN-RCVD state exists in the
tuexen [Thu, 18 Oct 2018 19:21:18 +0000 (19:21 +0000)]
The handling of RST segments in the SYN-RCVD state exists in the
code paths. Both are not consistent and the one on the syn cache code
does not conform to the relevant specifications (Page 69 of RFC 793
and Section 4.2 of RFC 5961).

This patch fixes this:
* The sequence numbers checks are fixed as specified on
  page Page 69 RFC 793.
* The sysctl variable net.inet.tcp.insecure_rst is now honoured
  and the behaviour as specified in Section 4.2 of RFC 5961.

Approved by: re (gjb@)
Reviewed by: bz@, glebius@, rrs@,
Differential Revision: https://reviews.freebsd.org/D17595
Sponsored by: Netflix, Inc.

5 years agoCorrect the comment for the 20181015 entry in ObsoleteFiles.inc.
gjb [Thu, 18 Oct 2018 19:07:15 +0000 (19:07 +0000)]
Correct the comment for the 20181015 entry in ObsoleteFiles.inc.

Reported by: rpokala
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoThe local_unbound service will configure and bootstrap itself, but only
des [Thu, 18 Oct 2018 18:33:44 +0000 (18:33 +0000)]
The local_unbound service will configure and bootstrap itself, but only
if a network connection is available.  This is not an issue when running
'service local_unbound setup' interactively, but can be on a diskless
system where local_unbound self-configures on every boot.  To address
this, add explicit dependencies on netwait and defaultroute.

Submitted by: eugen
Approved by: re (gjb)

5 years agoAdd support for DNS-over-TLS to the local_unbound service.
des [Thu, 18 Oct 2018 15:35:13 +0000 (15:35 +0000)]
Add support for DNS-over-TLS to the local_unbound service.

Approved by: re (kib)

5 years agoSupport RISC-V implementations that do not manage the A and D bits
br [Thu, 18 Oct 2018 15:25:07 +0000 (15:25 +0000)]
Support RISC-V implementations that do not manage the A and D bits
(e.g. RocketChip, lowRISC and derivatives).

RISC-V page table entries support A (accessed) and D (dirty) bits. The
spec makes hardware support for these bits optional. Implementations that
do not manage these bits in hardware raise page faults for accesses to a
valid page without A set and writes to a writable page without D set.
Check for these types of faults when handling a page fault and fixup the
PTE without calling vm_fault if they occur.

Reviewed by: jhb, markj
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17424

5 years agoRevert r339421 due to unintended files included to commit.
br [Thu, 18 Oct 2018 15:17:58 +0000 (15:17 +0000)]
Revert r339421 due to unintended files included to commit.

Reported by: ian
Approved by: re (gjb)
Sponsored by: DARPA, AFRL

5 years agoSupport RISC-V implementations that do not manage the A and D bits
br [Thu, 18 Oct 2018 15:08:14 +0000 (15:08 +0000)]
Support RISC-V implementations that do not manage the A and D bits
(e.g. RocketChip, lowRISC and derivatives).

RISC-V page table entries support A (accessed) and D (dirty) bits. The
spec makes hardware support for these bits optional. Implementations that
do not manage these bits in hardware raise page faults for accesses to a
valid page without A set and writes to a writable page without D set.
Check for these types of faults when handling a page fault and fixup the
PTE without calling vm_fault if they occur.

Reviewed by: jhb, markj
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17424

5 years agoFix typos from r339409.
jamie [Thu, 18 Oct 2018 15:02:57 +0000 (15:02 +0000)]
Fix typos from r339409.

Reported by: maxim
Approved by: re (gjb)

5 years agor334853 added a "socket destructor" callback. However, as implemented, it
jtl [Thu, 18 Oct 2018 14:20:15 +0000 (14:20 +0000)]
r334853 added a "socket destructor" callback. However, as implemented, it
was really a "socket close" callback.

Update the socket destructor functionality to run when a socket is
destroyed (rather than when it is closed). The original submitter has
confirmed that this change satisfies the intended use case.

Suggested by: rwatson
Submitted by: Michio Honda <micchie at sfc.wide.ad.jp>
Tested by: Michio Honda <micchie at sfc.wide.ad.jp>
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17590

5 years agoWhile preparing to move init(8) to its own package as indicated
bz [Thu, 18 Oct 2018 02:07:30 +0000 (02:07 +0000)]
While preparing to move init(8) to its own package as indicated
in r339413, a current pkgbase update problem came up.  For users
testing pkgbase at the moment there is no (automatic) way to pick
up new base packages (yet).
As a result rather than also moving init(8) to its own package,
back out the part of the change in r339413 that moved rc* to its
own package and defer creating new packages until the
infrastructure is in place to handle these cases.
Both init and rc* are considered too problematic to be lost by
early adaptors at this stage.

Discussed with: brd
Reviewed by: brd
Approved by: re (gjb)

5 years agoFix modules/nvdimm build issues after r339391 by adding a dependency
bz [Thu, 18 Oct 2018 00:51:42 +0000 (00:51 +0000)]
Fix modules/nvdimm build issues after r339391 by adding a dependency
to the SRC list.  Sort the list while changing the line.

Reported by: ci.f.o, make -j24 buildkernel
Approved by: re (gjb)

5 years agoFix spelling of an error message and add warning to another error
bz [Wed, 17 Oct 2018 16:54:13 +0000 (16:54 +0000)]
Fix spelling of an error message and add warning to another error
case in tunefs(8).

Reviewed by: imp (2017 version of the same diff)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D10046

5 years agoMove the rc framework out of sbin/init into libexec/rc.
bz [Wed, 17 Oct 2018 16:49:11 +0000 (16:49 +0000)]
Move the rc framework out of sbin/init into libexec/rc.

The reasons for this are forward looking to pkgbase:
 * /sbin/init is a special binary; try not to replace it with
   every package update because an rc script was touched.
   (a follow-up commit will make init its own package)
 * having rc in its own place will allow more easy replacement
   of the rc framework with alternatives, such as openrc.

Discussed with: brd (during BSDCam), kmoore
Requested by: cem, bz
PR: 231522
Approved by: re (gjb)

5 years agoRevert r315571 for share/timedef/ca_IT.ISO8859-15.src, ca_IT is Catalan
yuripv [Wed, 17 Oct 2018 16:38:44 +0000 (16:38 +0000)]
Revert r315571 for share/timedef/ca_IT.ISO8859-15.src, ca_IT is Catalan
in Italy, and is not related to Canada.

While here, remove the header as we do NOT currently use CLDR data to
generate timedef, and it's misleading.

PR: 225855
Reviewed by: bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17551

5 years agoAdd a new jail permission, allow.read_msgbuf. When true, jailed processes
jamie [Wed, 17 Oct 2018 16:11:43 +0000 (16:11 +0000)]
Add a new jail permission, allow.read_msgbuf.  When true, jailed processes
can see the dmesg buffer (this is the current behavior).  When false (the
new default), dmesg will be unavailable to jailed users, whether root or
not.

The security.bsd.unprivileged_read_msgbuf sysctl still works as before,
controlling system-wide whether non-root users can see the buffer.

PR: 211580
Submitted by: bz
Approved by: re@ (kib@)
MFC after: 3 days

5 years agostrptime: fix parsing of tm_year when both %C and %y appear in the
yuripv [Wed, 17 Oct 2018 14:51:43 +0000 (14:51 +0000)]
strptime: fix parsing of tm_year when both %C and %y appear in the
format string in arbitrary order.  This makes the related test cases in
lib/libc/tests/time (not yet connected to the build) pass.

While here, don't error on negative tm_year value based on the
APPLICATION USAGE in
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
(glibc does the same):

tm_year is a signed value; therefore, years before 1900 may be represented.

Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17550

5 years agoThe countp argument passed to linker_file_lookup_set() in
bz [Wed, 17 Oct 2018 10:31:08 +0000 (10:31 +0000)]
The countp argument passed to linker_file_lookup_set() in
linker_load_dependencies() is unused, so no need to ask for the
value in first place.  Remove the unused "count" variable.

Approved by: re (kib)

5 years agoAdd initial driver for ACPI NFIT-enumerated NVDIMMs.
kib [Tue, 16 Oct 2018 20:12:35 +0000 (20:12 +0000)]
Add initial driver for ACPI NFIT-enumerated NVDIMMs.

Driver enumerates NVDIMMs.  Besides, for each found System Physical
Address (SPA) range, spaN geom provider is created, which allows
formatting and mounting the region as the normal volume.  Also,
/dev/nvdimm_spaN node is created, which can be read/written/mapped by
userspace, the mapping is zero-copy.

No support for block access methods implemented, labels are not
parsed.   No management interfaces are provided.

Tested by: Intel, NetApp
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 2 weeks

5 years agoReparent a child of pdfork(2) to its reaper when the procdesc is closed.
markj [Tue, 16 Oct 2018 20:06:56 +0000 (20:06 +0000)]
Reparent a child of pdfork(2) to its reaper when the procdesc is closed.

Unconditionally reparenting to PID 1 breaks the procctl(2) reaper
functionality.

Add a regression test for this case.

Reviewed by: kib
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17589

5 years agoFix for reception of large full speed isochronous frames via the transaction
hselasky [Tue, 16 Oct 2018 18:47:13 +0000 (18:47 +0000)]
Fix for reception of large full speed isochronous frames via the transaction
translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR: 230434
MFC after: 3 days
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoGet rid unneccessary useless calls to lseek(2) from getgrent(3).
trasz [Tue, 16 Oct 2018 18:17:07 +0000 (18:17 +0000)]
Get rid unneccessary useless calls to lseek(2) from getgrent(3).
Looks like this:

 fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r-- ,inode=2167001,size=390,blksize=32768 },0x0) = 0 (0x0)
 open("/etc/group",O_RDONLY|O_CLOEXEC,0666)      = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=2166927,size=919,blksize=32768 }) = 0 (0x0)
-lseek(3,0x0,SEEK_CUR)                           = 0 (0x0)
-lseek(3,0x0,SEEK_SET)                           = 0 (0x0)
 read(3,"# $FreeBSD: release/10.0.0/etc/g"...,32768) = 919 (0x397)
 close(3)                                        = 0 (0x0)

Reviewed by: kib
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17571

5 years agoProvide pmap_large_map() KPI on amd64.
kib [Tue, 16 Oct 2018 17:28:10 +0000 (17:28 +0000)]
Provide pmap_large_map() KPI on amd64.

The KPI allows to map very large contigous physical memory regions
into KVA, which are not covered by DMAP.

I see both with QEMU and with some real hardware started shipping, the
regions for NVDIMMs might be very far apart from the normal RAM, and
we expect that at least initial users of NVDIMM could install very
large amount of such memory.  IMO it is not reasonable to extend DMAP
to cover that far-away regions both because it could overflow existing
4T window for DMAP in KVA, and because it costs in page table pages
allocations, for gap and for possibly unused NV RAM.

Also, KPI provides some special functionality for fast cache flushing
based on the knowledge of the NVRAM mapping use.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17070

5 years agoapropos/whatis: use output of manpath(1) to set defpaths if -M is not
yuripv [Tue, 16 Oct 2018 17:17:11 +0000 (17:17 +0000)]
apropos/whatis: use output of manpath(1) to set defpaths if -M is not
specified.  This fixes searching the paths specified in
/usr/local/etc/man.d/*.conf, as currently apropos/whatis from mandoc
suite aren't aware about them.

PR: 227922
Reviewed by: bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17454

5 years agoAdd clwb().
kib [Tue, 16 Oct 2018 17:00:42 +0000 (17:00 +0000)]
Add clwb().

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D17070

5 years agoInvalidate TLB on a local hart.
br [Tue, 16 Oct 2018 16:03:17 +0000 (16:03 +0000)]
Invalidate TLB on a local hart.

This was missed in r339367 ("Various fixes for TLB management on RISC-V.").

This fixes operation on lowRISC.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17583

5 years agopw: (file == NULL) check is always false in read_userconfig(), remove
yuripv [Tue, 16 Oct 2018 16:00:41 +0000 (16:00 +0000)]
pw: (file == NULL) check is always false in read_userconfig(), remove
it.  Drop the now unused _PATH_PW_CONF definition. [1]

While here, change the last remaining hardcoded "/etc" to _PATH_PWD.

Noted by: glebius [1]
Reviewed by: eugen
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17575

5 years agoPlug sendfile(2) on a listening socket with proper error code.
glebius [Tue, 16 Oct 2018 15:57:16 +0000 (15:57 +0000)]
Plug sendfile(2) on a listening socket with proper error code.

Reported by: ngie
Reviewed by: ngie
Approved by: re (delphij)

5 years agoIn r338102, the TCP reassembly code was substantially restructured. Prior
jtl [Tue, 16 Oct 2018 14:41:09 +0000 (14:41 +0000)]
In r338102, the TCP reassembly code was substantially restructured. Prior
to this change, the code sometimes used a temporary stack variable to hold
details of a TCP segment. r338102 stopped using the variable to hold
segments, but did not actually remove the variable.

Because the variable is no longer used, we can safely remove it.

Approved by: re (gjb)

5 years agoUpdate head from ALPHA9 to ALPHA10 as part of the 12.0-RELEASE
gjb [Tue, 16 Oct 2018 14:16:39 +0000 (14:16 +0000)]
Update head from ALPHA9 to ALPHA10 as part of the 12.0-RELEASE
cycle.

This is expected to be the final ALPHA build of this release
cycle, prior to branching stable/12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoImport CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb.
jtl [Tue, 16 Oct 2018 02:30:13 +0000 (02:30 +0000)]
Import CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb.
This fixes two problems, one where epoch calls could occur before all
the readers had exited the epoch section, and one where the epoch calls
could be unnecessarily delayed.

Approved by: re (glebius)

5 years agoSkip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.
mav [Mon, 15 Oct 2018 21:59:24 +0000 (21:59 +0000)]
Skip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.

Device removal code uses zio_vdev_child_io() with ZIO_TYPE_NULL parent,
that never happened before.  It confused FreeBSD-specific TRIM code,
which does not use VDEV_IO_DONE for logical ZIO_TYPE_FREE ZIOs.  As
result of that stage being skipped device removal ZIOs leaked references
and memory that supposed to be freed by VDEV_IO_DONE, making it stuck.

It is a quick patch rather then a nice fix, but hopefully we'll be able
to drop it all together when alternative TRIM implementation finally get
landed.

PR: 228750, 229007
Discussed with: allanjude, avg, smh
Approved by: re (delphij)
MFC after: 5 days
Sponsored by: iXsystems, Inc.

5 years agoCorrect COMPAT* macro names in syscalls.master
kevans [Mon, 15 Oct 2018 21:35:57 +0000 (21:35 +0000)]
Correct COMPAT* macro names in syscalls.master

Both ^/sys/compat/freebsd32/syscalls.master and ^/sys/kern/syscalls.master
cited "COMPAT[n] #ifdef" instead of "COMPAT_FREEBSD[n] #ifdef" in places.

Approved by: re (glebius)

5 years agoAvoid OOB reads in memmem(3).
glebius [Mon, 15 Oct 2018 20:20:57 +0000 (20:20 +0000)]
Avoid OOB reads in memmem(3).

commit 51bdcdc424bd7169c8cccdc2de7cad17f5ea0f70
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Fri Jun 30 00:35:33 2017 +0300

    fix OOB reads in Xbyte_memmem

    Reported by Leah Neukirchen.

Reviewed by: emaste
Approved by: re (kib)

5 years agopw: respect path specified using -V when writing pw.conf, and -C is not
yuripv [Mon, 15 Oct 2018 20:11:53 +0000 (20:11 +0000)]
pw: respect path specified using -V when writing pw.conf, and -C is not
explicitly specified.  -V path is already used to determine which file
to read default values from, so it's only logical to write them to the
same file.

PR: 231653
Reviewed by: eugen, bapt
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17566

5 years agoPrevent flex(1) from generating calls to isatty(3) - and, in turn,
trasz [Mon, 15 Oct 2018 19:48:36 +0000 (19:48 +0000)]
Prevent flex(1) from generating calls to isatty(3) - and, in turn,
TIOCGETA ioctls - when parsing nsswitch.conf(5).

Reviewed by: imp, markj
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17564

5 years agoVarious fixes for TLB management on RISC-V.
jhb [Mon, 15 Oct 2018 18:56:54 +0000 (18:56 +0000)]
Various fixes for TLB management on RISC-V.

- Remove the arm64-specific cpu_*cache* and cpu_tlb_flush* functions.
  Instead, add RISC-V specific inline functions in cpufunc.h for the
  fence.i and sfence.vma instructions.
- Catch up to changes in the arm64 pmap and remove all the cpu_dcache_*
  calls, pmap_is_current, pmap_l3_valid_cacheable, and PTE_NEXT bits from
  pmap.
- Remove references to the unimplemented riscv_setttb().
- Remove unused cpu_nullop.
- Add a link to the SBI doc to sbi.h.
- Add support for a 4th argument in SBI calls.  It's not documented but
  it seems implied for the asid argument to SBI_REMOVE_SFENCE_VMA_ASID.
- Pass the arguments from sbi_remote_sfence*() to the SEE.  BBL ignores
  them so this is just cosmetic.
- Flush icaches on other CPUs when they resume from kdb in case the
  debugger wrote any breakpoints while the CPUs were paused in the IPI_STOP
  handler.
- Add SMP vs UP versions of pmap_invalidate_* similar to amd64.  The
  UP versions just use simple fences.  The SMP versions use the
  sbi_remove_sfence*() functions to perform TLB shootdowns.  Since we
  don't have a valid pm_active field in the riscv pmap, just IPI all
  CPUs for all invalidations for now.
- Remove an extraneous TLB flush from the end of pmap_bootstrap().
- Don't do a TLB flush when writing new mappings in pmap_enter(), only if
  modifying an existing mapping.  Note that for COW faults a TLB flush is
  only performed after explicitly clearing the old mapping as is done in
  other pmaps.
- Sync the i-cache on all harts before updating the PTE for executable
  mappings in pmap_enter and pmap_enter_quick.  Previously the i-cache was
  only sync'd after updating the PTE in pmap_enter.
- Use sbi_remote_fence() instead of smp_rendezvous in pmap_sync_icache().

Reviewed by: markj
Approved by: re (gjb, kib)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17414

5 years agoAdd support for Error Recovery
davidcs [Mon, 15 Oct 2018 18:39:33 +0000 (18:39 +0000)]
Add support for Error Recovery

Submitted by:Vaishali.Kulkarni@cavium.com
Approved by:re(kib)
MFC after:5 days

5 years agoTypo.
markj [Mon, 15 Oct 2018 18:28:34 +0000 (18:28 +0000)]
Typo.

Submitted by: Fred Schlechter <freds@vailsys.com>
Approved by: re (gjb)
MFC after: 3 days

5 years agoReload the LDT selector after an AMD-v #VMEXIT.
jhb [Mon, 15 Oct 2018 18:12:25 +0000 (18:12 +0000)]
Reload the LDT selector after an AMD-v #VMEXIT.

cpu_switch() always reloads the LDT, so this can only affect the
hypervisor process itself.  Fix this by explicitly reloading the host
LDT selector after each #VMEXIT.  The stock bhyve process on FreeBSD
never uses a custom LDT, so this change is cosmetic.

Reviewed by: kib
Tested by: Mike Tancsa <mike@sentex.net>
Approved by: re (gjb)
MFC after: 2 weeks

5 years agoDon't call dlopen(3) for built-in NSS types - "cache", "compat",
trasz [Mon, 15 Oct 2018 17:50:02 +0000 (17:50 +0000)]
Don't call dlopen(3) for built-in NSS types - "cache", "compat",
"dns", "files", "db", and "nis". It saves some path lookups during
binary startup.

Reviewed by: markj
Approved by: re (gjb, kib)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17557

5 years agoiavf(4): Finish rename/rebrand internally
erj [Mon, 15 Oct 2018 17:23:41 +0000 (17:23 +0000)]
iavf(4): Finish rename/rebrand internally

Rename functions and variables from ixlv to iavf to match the
user-facing name change. There shouldn't be any functional changes
with this change, but this may help with browsing the source code
and reducing diffs in the future.

Submitted by:   kbowling@
Reviewed by:    erj@, sbruno@
Approved by: re (gjb@)
Differential Revision:  https://reviews.freebsd.org/D17544

5 years agoRemove stale libcasper(3) shared libraries following the
gjb [Mon, 15 Oct 2018 17:16:47 +0000 (17:16 +0000)]
Remove stale libcasper(3) shared libraries following the
OpenSSL 1.1.1 update.

Reported by: des
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoInitialize SPRG0 before its first possible use
luporl [Mon, 15 Oct 2018 16:43:07 +0000 (16:43 +0000)]
Initialize SPRG0 before its first possible use

At early boot, PCPU_GET(), that obtains a pointer from SPRG0, was being
used with SPRG0 not yet initialized. If it pointed to an invalid
address, the machine would hang.

Approved by: re(gjb), jhibbits(mentor)

5 years agoFix deadlock when destroying VLANs.
hselasky [Mon, 15 Oct 2018 10:29:29 +0000 (10:29 +0000)]
Fix deadlock when destroying VLANs.

Synchronizing the epoch before freeing the multicast addresses while holding
the VLAN_XLOCK() might lead to a deadlock. Use deferred freeing of the VLAN
multicast addresses to resolve deadlock. Backtrace:

Thread1:
epoch_block_handler_preempt()
ck_epoch_synchronize_wait()
epoch_wait_preempt()
vlan_setmulti()
vlan_ioctl()
in6m_release_task()
gtaskqueue_run_locked()
gtaskqueue_thread_loop()
fork_exit()
fork_trampoline()

Thread2:
sleepq_switch()
sleepq_wait()
_sx_xlock_hard()
_sx_xlock()
in6_leavegroup()
in6_purgeaddr()
if_purgeaddrs()
if_detach_internal()
if_detach()
vlan_clone_destroy()
if_clone_destroyif()
if_clone_destroy()
ifioctl()
kern_ioctl()
sys_ioctl()
amd64_syscall()
fast_syscall_common()
syscall()

Differential revision: https://reviews.freebsd.org/D17496
Reviewed by: slavash, mmacy
Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agoAdd extra parentheses to fix "versrcreach" opcode, (oif != NULL) should
ae [Mon, 15 Oct 2018 10:25:34 +0000 (10:25 +0000)]
Add extra parentheses to fix "versrcreach" opcode, (oif != NULL) should
not be used as condition for ternary operator.

Submitted by: Tatsuki Makino <tatsuki_makino at hotmail dot com>
Approved by: re (kib)
MFC after: 1 week

5 years agoAdd .Xrs to kqueue(2) from pdfork(2) and procdesc(4), to make EVFILT_PROCDESC
trasz [Sun, 14 Oct 2018 18:42:54 +0000 (18:42 +0000)]
Add .Xrs to kqueue(2) from pdfork(2) and procdesc(4), to make EVFILT_PROCDESC
easier to find.

Approved by: re (rgrimes)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agozfs: fix a panic after failed mount
mjg [Sun, 14 Oct 2018 16:14:01 +0000 (16:14 +0000)]
zfs: fix a panic after failed mount

r338927("zfs: depessimize zfs_root with rmlocks") failed to error check
the mount before caching root vnode.

Results in crashes in rrw_enter_read_impl tracing back to zfs_mount.

Reported by: Mike Tancsa
Tested by: allanjude
Approved by: re (kib)

5 years agoem/igb/ix(4): Port two Tx/Rx fixes made to ixl in r339338
erj [Sun, 14 Oct 2018 05:09:43 +0000 (05:09 +0000)]
em/igb/ix(4): Port two Tx/Rx fixes made to ixl in r339338

- Fix assert/panic on receive when Jumbo Frames are enabled.

From the commit I made to ixl:
"It turns out that *_isc_rxd_available is supposed to return how many
packets are available to be cleaned on the rx ring. This patch removes
a section of code where if the budget argument is 1, the function would return
one if there was a descriptor available, not necessarily a packet.

This is okay in regular mtu 1500 traffic since the max frame size is less
than the configured receive buffer size (2048), but this doesn't work when
received packets can span more than one  descriptor, as is the case when the
mtu is 9000 and the receive buffer size is 4096."

- Fix possible Tx hang because *_isc_txd_credits_update returns incorrect result

From the commit by Krzysztof Galazka to ixl: "Function isc_txd_update_credits
called with clear set to false should return 1 if there are TX descriptors
already handled by HW. It was always returning 0 causing troubles with UDP TX
traffic."

PR:             231659
Reported by:    lev@
Approved by: re (gjb@)
Sponsored by:   Intel Corporation

5 years agoMakefile.inc1: clean up dependencies after r339348
emaste [Sun, 14 Oct 2018 00:29:57 +0000 (00:29 +0000)]
Makefile.inc1: clean up dependencies after r339348

r339348 switched bcopy from .s to .c.  Add ad-hoc dependency cleanup
as done for similar cases.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoProcess irelocs for statically linked binaries from crt1 on x86.
kib [Sat, 13 Oct 2018 23:52:55 +0000 (23:52 +0000)]
Process irelocs for statically linked binaries from crt1 on x86.

This makes statically linked binaries with ifuncs operational.

Reported and tested by: mjg
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D17363

5 years agoelfcopy: delete filter_reloc, it is broken and unnecessary
emaste [Sat, 13 Oct 2018 21:26:07 +0000 (21:26 +0000)]
elfcopy: delete filter_reloc, it is broken and unnecessary

elfcopy contained logic to filter individual relocations in STRIP_ALL
mode.  However, this is not valid; relocations emitted by the linker are
required, unless they apply to an entire section being removed (which is
handled by other logic in elfcopy).

Note that filter_reloc was also buggy: for RELA relocation sections it
operated on uninitialized rel.r_info resulting in invalid operation.

The logic most likely needs to be inverted: instead of removing
relocations because their associated symbols are being removed, we must
keep symbols referenced by relocations.  That said, in practice we do
not encounter this code path today: objects being stripped are either
dynamically linked binaries which retain .dynsym, or static binaries
with no relocations.

Just remove filter_reloc.  This fixes certain cases including statically
linked binaries containing ifuncs.  Stripping binaries with relocations
referencing removed symbols was already broken, and after this change
may still be broken in a different way.

PR: 232176
Reviewed by: kaiw, kib, markj
Approved by: re (rgrimes)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17519

5 years agoamd64: partially depessimize cpu_fetch_syscall_args and cpu_set_syscall_retval
mjg [Sat, 13 Oct 2018 21:18:31 +0000 (21:18 +0000)]
amd64: partially depessimize cpu_fetch_syscall_args and cpu_set_syscall_retval

Vast majority of syscalls take 6 or less arguments. Move handling of other
cases to a fallback function. Similarly, special casing for _syscall
and __syscall
magic syscalls is moved away.

Return is almost always 0. The change replaces 3 branches with 1 in the common
case. Also the 'frame' variable convinces clang not to reload it on each access.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17542

5 years agoamd64: convert libc bcopy to a C func to avoid future bloat
mjg [Sat, 13 Oct 2018 21:17:28 +0000 (21:17 +0000)]
amd64: convert libc bcopy to a C func to avoid future bloat

The function is of limited use and is an almost a direct clone of
memmove/memcpy (with arguments swapped). Introduction of ERMS variants
of string routines would mean avoidable growth of libc.

bcopy will get redefined to a __builtin_memmove later on with this
symbol only left for compatibility.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17539

5 years agoamd64: import updated kernel memmove to libc
mjg [Sat, 13 Oct 2018 21:15:47 +0000 (21:15 +0000)]
amd64: import updated kernel memmove to libc

bcopy is left alone as it is expected to be converted to a C func.

Due to header mess ALIGN_TEXT is temporarily defined explicitly in memmove.S

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17538

5 years agostrptime: disallow zero hour for %I (defined by POSIX as [01,12]) and %l
yuripv [Sat, 13 Oct 2018 16:25:28 +0000 (16:25 +0000)]
strptime: disallow zero hour for %I (defined by POSIX as [01,12]) and %l
(extension, defined in strftime(3) as 1-12).

Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17543

5 years agoMake `mfiutil show progress` print out the elapsed time estimate in a
allanjude [Sat, 13 Oct 2018 02:21:23 +0000 (02:21 +0000)]
Make `mfiutil show progress` print out the elapsed time estimate in a
more humanized way

PR: 225993
Submitted by: Enji Cooper <yaneurabeya@gmail.com>
Reviewed by: jhb (previous version)
Approved by: re (rgrimes)

5 years agoDocument that sendfile(2) can return ENOTCAPABLE
allanjude [Sat, 13 Oct 2018 02:20:16 +0000 (02:20 +0000)]
Document that sendfile(2) can return ENOTCAPABLE

PR: 232207
Submitted by: Enji Cooper <yaneurabeya@gmail.com>
Approved by: re (rgrimes)

5 years agocxgbe(4): Fix a divide-by-zero that occurs when hw.cxgbe.toecaps_allowed
np [Sat, 13 Oct 2018 00:13:24 +0000 (00:13 +0000)]
cxgbe(4): Fix a divide-by-zero that occurs when hw.cxgbe.toecaps_allowed
is set to 0 with a kernel that has both TCP_OFFLOAD and RATELIMIT.

Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications

5 years agocapsicum: provide cap_rights_fde_inline
mjg [Fri, 12 Oct 2018 23:48:10 +0000 (23:48 +0000)]
capsicum: provide cap_rights_fde_inline

Reading caps is in the hot path (on each successful fd lookup), but
completely unnecessarily requires a function call.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoixl/iavf: Update ixl(4) and iavf(4) [previously ixlv] man pages
erj [Fri, 12 Oct 2018 22:57:52 +0000 (22:57 +0000)]
ixl/iavf: Update ixl(4) and iavf(4) [previously ixlv] man pages

Since there have been major updates to both drivers in r339338,
refresh the man pages with new and updated information.

Reviewed by:    sbruno@, 0mp@, jeffrey.e.pieper@intel.com, manpages
Approved by: re (gjb@, kib@)
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D15927

5 years agoIn udp_input() when walking the pcblist we can come across
bz [Fri, 12 Oct 2018 22:51:45 +0000 (22:51 +0000)]
In udp_input() when walking the pcblist we can come across
an inp marked FREED after the epoch(9) changes.
Check once we hold the lock and skip the inp if it is the case.

Contrary to IPv6 the locking of the inp is outside the multicast
section and hence a single check seems to suffice.

PR: 232192
Reviewed by: mmacy, markj
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17540

5 years agoixl/iavf(4): Change ixlv to iavf and update it to use iflib(9)
erj [Fri, 12 Oct 2018 22:40:54 +0000 (22:40 +0000)]
ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9)

Finishes the conversion of the 40Gb Intel Ethernet drivers to iflib(9) for
FreeBSD 12.0, and fixes numerous bugs in both ixl(4) and iavf(4).

This commit also re-adds the VF driver to GENERIC since it now compiles and
functions.

The VF driver name was changed from ixlv(4) to iavf(4) because the VF driver is
now intended to be used with future products, not just with Fortville/Fort Park
VFs.

A man page update that documents these drivers is forthcoming in a separate
commit.

Reviewed by:    sbruno@, kbowling@
Tested by:      jeffrey.e.pieper@intel.com
Approved by: re (gjb@)
Relnotes:       yes
Sponsored by:   Intel Corporation
Differential Revision: https://reviews.freebsd.org/D16429

5 years agoamd64: employ MEMMOVE in copyin/copyout
mjg [Fri, 12 Oct 2018 21:59:09 +0000 (21:59 +0000)]
amd64: employ MEMMOVE in copyin/copyout

See r339205 for justification.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17526

5 years agoAvoid zero-sized kmem_alloc() in vdev_compact_children().
mav [Fri, 12 Oct 2018 16:55:28 +0000 (16:55 +0000)]
Avoid zero-sized kmem_alloc() in vdev_compact_children().

The device evacuation code adds a dependency that
vdev_compact_children() be able to properly empty the vdev_child
array by setting it to NULL and zeroing vdev_children.  Under Linux,
kmem_alloc() and related functions return a sentinel pointer rather
than NULL for zero-sized allocations.

This is a part of ZoL port of device removal patch:

commit a1d477c24c7badc89c60955995fd84d311938486
Author: Matthew Ahrens <mahrens@delphix.com>
Ported-by: Tim Chase <tim@chase2k.com>
Approved by: re (kib)
MFC after: 1 week

5 years agoloader.efi: add poweroff command
tsoome [Fri, 12 Oct 2018 16:24:49 +0000 (16:24 +0000)]
loader.efi: add poweroff command

Add poweroff command to make life a bit easier.

Reviewed by: imp, allanjude
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17535

5 years agoCall initializecpucache() before ifuncs are resolved.
kib [Fri, 12 Oct 2018 16:00:21 +0000 (16:00 +0000)]
Call initializecpucache() before ifuncs are resolved.

The function tweaks CPU capabilities based on the VM platform and
tunables, which affected selection of the cache flush method before
ifuncs were used, and should affect the cache flush in the same way
after ifunc.

PR: 232081
Reported by: phk
Analyzed by: avg
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

5 years agoInitialize interrupt priority to 0 on all sources.
br [Fri, 12 Oct 2018 15:51:41 +0000 (15:51 +0000)]
Initialize interrupt priority to 0 on all sources.

Without this hardware raises an interrupt regardless of any
pending bits set.

This fixes operation on RocketChip and derivatives (e.g. lowRISC).

Approved by: re (kib)
Sponsored by: DARPA, AFRL

5 years agobhyve: emulate CLFLUSH and CLFLUSHOPT.
kib [Fri, 12 Oct 2018 15:30:15 +0000 (15:30 +0000)]
bhyve: emulate CLFLUSH and CLFLUSHOPT.

Apparently CLFLUSH on mmio can cause VM exit, as reported in the PR.
I do not see that anything useful can be done except emulating page
faults on invalid addresses.

Due to the instruction encoding pecularity, also emulate SFENCE.

PR: 232081
Reported by: phk
Reviewed by: araujo, avg, jhb (all: previous version)
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17482

5 years agoAdd support for the UART device found in lowRISC system-on-a-chip.
br [Fri, 12 Oct 2018 15:19:41 +0000 (15:19 +0000)]
Add support for the UART device found in lowRISC system-on-a-chip.

The only source of documentation for this device is verilog,
so driver is minimalistic.

Reviewed by: Dr Jonathan Kimmitt <jrrk2@cam.ac.uk>
Approved by: re (kib)
Sponsored by: DARPA, AFRL

5 years agoAdd ZIO_TYPE_FREE support for indirect vdevs.
mav [Fri, 12 Oct 2018 15:14:22 +0000 (15:14 +0000)]
Add ZIO_TYPE_FREE support for indirect vdevs.

Upstream code expects only ZIO_TYPE_READ and some ZIO_TYPE_WRITE
requests to removed (indirect) vdevs, while on FreeBSD there is also
ZIO_TYPE_FREE (TRIM).  ZIO_TYPE_FREE requests do not have the data
buffers, so don't need the pointer adjustment.

PR: 228750, 229007
Reviewed by: allanjude, sef
Approved by: re (kib)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17523

5 years agoReplace libldns's bootstrap dependency on libcrypto with one on libssl
des [Fri, 12 Oct 2018 13:01:17 +0000 (13:01 +0000)]
Replace libldns's bootstrap dependency on libcrypto with one on libssl
(which in turn has a bootstrap dependency on libcrypto).

Submitted by: jkim
Approved by: re (gjb)

5 years agor217592 moved the check for imo in udp_input() into the conditional block
bz [Fri, 12 Oct 2018 11:30:46 +0000 (11:30 +0000)]
r217592 moved the check for imo in udp_input() into the conditional block
but leaving the variable assignment outside the block, where it is no longer
used. Move both the variable and the assignment one block further in.

This should result in no functional changes. It will however make upcoming
changes slightly easier to apply.

Reviewed by: markj, jtl, tuexen
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17525

5 years agoMove libssl up in the bootstrap order.
des [Fri, 12 Oct 2018 05:42:38 +0000 (05:42 +0000)]
Move libssl up in the bootstrap order.

Submitted by: jkim
Approved by: re (gjb)

5 years agoAdd libssl to libldns for DANE.
des [Fri, 12 Oct 2018 05:27:58 +0000 (05:27 +0000)]
Add libssl to libldns for DANE.

Approved by: re (gjb)

5 years agoAdd a file missed in r339321
mjg [Fri, 12 Oct 2018 00:32:45 +0000 (00:32 +0000)]
Add a file missed in r339321

Approved by: re (implicit)
Sad face: mjg

5 years agoamd64: make memmove and memcpy less slow with mov
mjg [Thu, 11 Oct 2018 23:37:57 +0000 (23:37 +0000)]
amd64: make memmove and memcpy less slow with mov

The reasoning is the same as with the memset change, see r339205

Reviewed by: kib (previous version)
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17441

5 years agoProvide string functions for use before ifuncs get resolved.
mjg [Thu, 11 Oct 2018 23:28:04 +0000 (23:28 +0000)]
Provide string functions for use before ifuncs get resolved.

The change is a no-op for architectures which don't ifunc memset,
memcpy nor memmove.

Convert places which need them. Xen bits by royger.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17487

5 years agolibmemstat: adjust for per-cpu stats after r338899
mjg [Thu, 11 Oct 2018 23:25:14 +0000 (23:25 +0000)]
libmemstat: adjust for per-cpu stats after r338899

Reported by: yuripv
Reviewed by: kib, markj
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17490

5 years agoFix PNP entries for if_ix and if_ixv properly using the IFLIB_PNP_INFO()
yuripv [Thu, 11 Oct 2018 22:27:12 +0000 (22:27 +0000)]
Fix PNP entries for if_ix and if_ixv properly using the IFLIB_PNP_INFO()
macro.

Reviewed by: imp, sbruno
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17473

5 years agoMODULE_PNP_INFO(9): catch up with r338948, and remove the element size
yuripv [Thu, 11 Oct 2018 21:18:51 +0000 (21:18 +0000)]
MODULE_PNP_INFO(9): catch up with r338948, and remove the element size
parameter from the man page.

Reviewed by: cem, imp
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17436

5 years agoRestore some of the ctype definitions reported in the PR from pre-CLDR
yuripv [Thu, 11 Oct 2018 18:30:12 +0000 (18:30 +0000)]
Restore some of the ctype definitions reported in the PR from pre-CLDR
data, namely 0xE000-0xF8FF private use area, and 0xFF00-0xFFF half- and
fullwidth punctuation.

While here, update tools/tools/locale/README based on my experience
rebuilding the locale data.

PR: 225692
Reviewed by: bapt, cem (previous version)
Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17471

5 years agoFully restore the GDTR, IDTR, and LDTR after VT-x VM exits.
jhb [Thu, 11 Oct 2018 18:27:19 +0000 (18:27 +0000)]
Fully restore the GDTR, IDTR, and LDTR after VT-x VM exits.

The VT-x VMCS only stores the base address of the GDTR and IDTR.  As a
result, VM exits use a fixed limit of 0xffff for the host GDTR and
IDTR losing the smaller limits set in when the initial GDT is loaded
on each CPU during boot.  Explicitly save and restore the full GDTR
and IDTR contents around VM entries and exits to restore the correct
limit.

Similarly, explicitly save and restore the LDT selector.  VM exits
always clear the host LDTR as if the LDT was loaded with a NULL
selector and a userspace hypervisor is probably using a NULL selector
anyway, but save and restore the LDT explicitly just to be safe.

PR: 230773
Reported by: John Levon <levon@movementarian.org>
Reviewed by: kib
Tested by: araujo
Approved by: re (rgrimes)
MFC after: 1 week

5 years agoAdd fbsd:nokeywords to tools/tools/locale/etc/manual-input.UTF-8.
yuripv [Thu, 11 Oct 2018 18:26:18 +0000 (18:26 +0000)]
Add fbsd:nokeywords to tools/tools/locale/etc/manual-input.UTF-8.

Approved by: re (gjb), kib (mentor)

5 years agoRemove re-added header files from ObsoleteFiles.inc.
jkim [Thu, 11 Oct 2018 18:24:11 +0000 (18:24 +0000)]
Remove re-added header files from ObsoleteFiles.inc.

Approved by: re (delphij)

5 years agoDisable kernels_autodetect on installation media
kevans [Thu, 11 Oct 2018 17:18:49 +0000 (17:18 +0000)]
Disable kernels_autodetect on installation media

This feature is disabled on install media as these generally won't have any
interesting kernels to be listed other than the default kernel, so the
potential performance penalty in these situations likely isn't worth it.

Approved by: re (kib)

5 years agoEnable lualoader's kernel autodetection, disabled on install media
kevans [Thu, 11 Oct 2018 17:17:54 +0000 (17:17 +0000)]
Enable lualoader's kernel autodetection, disabled on install media

As documented in loader.conf(5), kernels_autodetect="YES" will cause the
Lua scripts to effectively scan /boot for directories with a "kernel" file
inside, to be listed in the loader menu.

Approved by: re (kib)

5 years agolualoader: Provide a 'menu' command to redraw the menu at the loader prompt
kevans [Thu, 11 Oct 2018 17:16:39 +0000 (17:16 +0000)]
lualoader: Provide a 'menu' command to redraw the menu at the loader prompt

Reported by: allanjude
Approved by: re (kib)

5 years agolibusb(3): Update the link to the libusb homepage.
0mp [Thu, 11 Oct 2018 13:58:51 +0000 (13:58 +0000)]
libusb(3): Update the link to the libusb homepage.

While here, pet mandoc & igor.

Reviewed by: bcr, hselasky
Approved by: re (kib), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17516

5 years agolld: set sh_link and sh_info for .rela.plt sections
emaste [Thu, 11 Oct 2018 13:19:17 +0000 (13:19 +0000)]
lld: set sh_link and sh_info for .rela.plt sections

ELF spec says that for SHT_REL and SHT_RELA sh_link should reference the
associated string table and sh_info should reference the "section to
which the relocation applies."  ELF Tool Chain's elfcopy / strip use
this (in part) to control whether or not the relocation entry is copied
to the output.

LLVM PR 37538 https://bugs.llvm.org/show_bug.cgi?id=37538

Approved by: re (kib)
Obtained from: llvm r344226 (backported for 6.0)

5 years agoRegenerate: remove GOST, enable DANE-TA now that we have OpenSSL 1.1.1.
des [Thu, 11 Oct 2018 08:14:31 +0000 (08:14 +0000)]
Regenerate: remove GOST, enable DANE-TA now that we have OpenSSL 1.1.1.

Approved by: re (gjb)

5 years agoLoader GELI support, like lua loader, seems to be broken on PowerPC as
nwhitehorn [Thu, 11 Oct 2018 00:54:39 +0000 (00:54 +0000)]
Loader GELI support, like lua loader, seems to be broken on PowerPC as
well as on SPARC64 and can cause boot failures even when no encrypted
disks are present. Presumably, the reasons, while unknown, are the same
and most-likely are the result of some endian-unsafe code. Pending
finding the actual problem, extend the blacklist entry for these parts
of loader on SPARC to also cover all PowerPC platforms.

Approved by: re (kib)

5 years agoPull in a follow-on commit to resolve a deadlock in ZFS sequential
allanjude [Wed, 10 Oct 2018 22:59:15 +0000 (22:59 +0000)]
Pull in a follow-on commit to resolve a deadlock in ZFS sequential
resilver (r334844)

MFV/ZoL: Fix deadlock in IO pipeline

commit a76f3d0437e5e974f0f748f8735af3539443b388
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Fri Mar 16 16:46:06 2018 -0700

    Fix deadlock in IO pipeline

    In vdev_queue_aggregate() the zio_execute() bypass should not be
    called under the vdev queue lock.  This can result in a deadlock
    as shown in the stack traces below.

    Drop the vdev queue lock then walk the parents of the aggregate IO
    to determine the list of component IOs to be bypassed.  This can
    be done safely without holding the io_lock since the new aggregate
    IO has not yet been returned and its parents cannot change.

    ---  THREAD 1 ---
    arc_read()
      zio_nowait()
        zio_vdev_io_start()
          vdev_queue_io() <--- mutex_enter(vq->vq_lock)
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
                  zio_vdev_io_assess()
                    zio_wait_for_children() <- mutex_enter(zio->io_lock)

    --- THREAD 2 --- (inverse order)
    arc_read()
      zio_change_priority() <- mutex_enter(zio->zio_lock)
        vdev_queue_change_io_priority() <- mutex_enter(vq->vq_lock)

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reported by: ZFS Leadership Meeting
Reviewed by: mav
Approved by: re (kib)
Obtained from: ZFS-on-Linux
MFC after: 2 weeks
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17495

5 years agoAdd missing sysctls for tuning vdev queue depths for new I/O types
allanjude [Wed, 10 Oct 2018 22:55:31 +0000 (22:55 +0000)]
Add missing sysctls for tuning vdev queue depths for new I/O types

This connects new tunables that were added but not exposed in:
r329502 (zpool remove)
r337007 (zpool initialize)

Reviewed by: avg
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17494

5 years agoTry harder to sanitize the environment before running configure.
des [Wed, 10 Oct 2018 22:29:06 +0000 (22:29 +0000)]
Try harder to sanitize the environment before running configure.
Remove a workaround for older Unbound versions that used sbrk.

Approved by: re (gjb)

5 years agoFix a minor typo in loader.conf(5).
gjb [Wed, 10 Oct 2018 20:25:41 +0000 (20:25 +0000)]
Fix a minor typo in loader.conf(5).

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoAdd graphics/drm-legacy-kmod and graphics/drm-stable-kmod to the
gjb [Wed, 10 Oct 2018 19:57:10 +0000 (19:57 +0000)]
Add graphics/drm-legacy-kmod and graphics/drm-stable-kmod to the
list of packages to include on the dvd installer.

Approved by: re (marius, rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoResolve a hang in ZFS during vnode reclaimation
allanjude [Wed, 10 Oct 2018 19:39:47 +0000 (19:39 +0000)]
Resolve a hang in ZFS during vnode reclaimation

This is caused by a deadlock between zil_commit() and zfs_zget()

Add a way for zfs_zget() to break out of the retry loop in the common case

PR: 229614
Reported by: grembo, Andreas Sommer, many others
Tested by: Andreas Sommer, Vicki Pfau
Reviewed by: avg (no objection)
Approved by: re (gjb)
MFC after: 2 months
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17460