]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r339869,r339870:
tuexen [Mon, 29 Oct 2018 20:08:19 +0000 (20:08 +0000)]
MFC r339869,r339870:

Remove empty line.

Reported by: gjb@
Approved by: re (gjb@)

5 years agoMFC r339791:
tuexen [Mon, 29 Oct 2018 19:01:47 +0000 (19:01 +0000)]
MFC r339791:

Add initial descriptions for SCTP related MIB variable.
This work was mostly done by Marie-Helene Kvello-Aune.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D3583

5 years agoMFC r339600:
hselasky [Mon, 29 Oct 2018 14:06:20 +0000 (14:06 +0000)]
MFC r339600:
Make sure returned value is checked and assert a valid refcount.
While at it fix a print: Unsigned types cannot be negative.

Reviewed by: kib, mjg
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17616
Sponsored by: Mellanox Technologies

5 years agoMFC r339588:
hselasky [Mon, 29 Oct 2018 13:17:41 +0000 (13:17 +0000)]
MFC r339588:
Resolve deadlock between epoch(9) and various network interface
SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch
read lock over typical network IOCTL code paths. This is a regression
issue after r334305.

Reviewed by: ae (network)
Approved by: re (kib)
Differential revision: https://reviews.freebsd.org/D17647
Sponsored by: Mellanox Technologies

5 years agoMFC r339587:
hselasky [Mon, 29 Oct 2018 12:08:15 +0000 (12:08 +0000)]
MFC r339587:
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Approved by: re (kib)
Differential revision: https://reviews.freebsd.org/D16639
Sponsored by: Mellanox Technologies

5 years agoMFC r339740:
ae [Sun, 28 Oct 2018 18:21:14 +0000 (18:21 +0000)]
MFC r339740:
  Use correct format specificator to print setdscp action.

  PR: 232642
Approved by: re (rgrimes)

5 years agoMFC r339548:
vmaffione [Sun, 28 Oct 2018 07:50:15 +0000 (07:50 +0000)]
MFC r339548:

man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

Approved by: re (gjb)

5 years agoFollow up on r331936. gets_s(3) will also fail in the same way that
cy [Sun, 28 Oct 2018 00:57:39 +0000 (00:57 +0000)]
Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by: emaste@
Approved by: re (kib@)

5 years agoMFC r339489:
yuripv [Sat, 27 Oct 2018 21:17:01 +0000 (21:17 +0000)]
MFC r339489:

Add -b/-l options to localedef(1) to specify output endianness and use
it appropriately when building share/ctypedef and share/colldef.

This makes the resulting locale data in EL->EB (amd64->powerpc64) cross
build and in the native EB build match.  Revert the changes done to libc
in r308170 as they are no longer needed.

PR:             231965
Reviewed by:    bapt, emaste, sbruno, 0mp
Approved by:    re (gjb), kib (mentor)
Differential Revision:  https://reviews.freebsd.org/D17603

5 years agoMFC r339514:
jhibbits [Sat, 27 Oct 2018 03:16:32 +0000 (03:16 +0000)]
MFC r339514:

powerpcspe: Implement SPE exception handling

The Signal Processing Engine (SPE) found in Freescale e500 cores (and
others) offloads IEEE-754 compliance (NaN, Inf handling, overflow,
underflow) to software, most likely as a means of simplifying the APU
silicon.  Some software, like AbiWord, needs full IEEE-754 compliance,
including NaN handling.  Implement the necessary bits to enable it.

Approved by: re(kib)

5 years agoMFC r339532 (by glebius):
ae [Fri, 26 Oct 2018 10:20:03 +0000 (10:20 +0000)]
MFC r339532 (by glebius):
  Fix exiting an epoch(9) we never entered. May happen only with MAC.

Approved by: re (kib)

5 years agoUpdate stable/12 from BETA1 to BETA2 as part of the 12.0-RELEASE
gjb [Fri, 26 Oct 2018 00:00:13 +0000 (00:00 +0000)]
Update stable/12 from BETA1 to BETA2 as part of the 12.0-RELEASE
cycle.

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

5 years agoMFC r339741:
gjb [Thu, 25 Oct 2018 19:57:42 +0000 (19:57 +0000)]
MFC r339741:
 Update SHLIB_VERSION_NUMBER following the OpenSSL shared library
 number bump.

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

5 years agoMFC r339703:
brooks [Thu, 25 Oct 2018 17:00:39 +0000 (17:00 +0000)]
MFC r339703:

Deprecate a number of less used 10 and 10/100 Ethernet devices.

The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,
pcn, sf, sn, tl, tx, txp, vx, wb, xe

The list was defined as part of FCP-0101. Per the FCP, devices may be
removed from the deprecation list if enough users are found or they are
converted to iflib.

FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Approved by: re (gjb)
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D17654

5 years agoMFC r339618:
tijl [Thu, 25 Oct 2018 16:01:10 +0000 (16:01 +0000)]
MFC r339618:

Define linuxkpi readq for 64-bit architectures.  It is used by drm-kmod.
Currently the compiler picks up the definition in machine/cpufunc.h.

Add compiler memory barriers to read* and write*.  The Linux x86
implementation of these functions uses inline asm with "memory" clobber.
The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
same inline asm without "memory" clobber.

Implement ioread* and iowrite* in terms of read* and write* so they also
have memory barriers.

Qualify the addr parameter in write* as volatile.

Like Linux, define macros with the same name as the inline functions.

Only define 64-bit versions on 64-bit architectures because generally
32-bit architectures can't do atomic 64-bit loads and stores.

Regroup the functions a bit and add brief comments explaining what they do:
- __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
- read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
- read*, write*: atomic, with barriers, little-endian

Add a comment that says our implementation of ioread* and iowrite*
only handles MMIO and does not support port IO.

Reviewed by: hselasky
Approved by: re (gjb)

5 years agoMFC r339709:
kib [Thu, 25 Oct 2018 15:49:59 +0000 (15:49 +0000)]
MFC r339709:
Bump base OpenSSL libraries versions to avoid conflict with port's libraries.

Approved by: re (gjb)

5 years agoMFC r339493: add wdc as an alias for wds
imp [Thu, 25 Oct 2018 15:35:12 +0000 (15:35 +0000)]
MFC r339493: add wdc as an alias for wds

wdc is the preferred name for Western Digital. wds should never
have been committed in the first place. Add wdc as an alias for 12
and in 13 we'll retire the undocumented wds.

Approved by: re@ (kib)

5 years agoMFC r339451: objcopy: restore behaviour required by GCC's build
emaste [Thu, 25 Oct 2018 15:18:54 +0000 (15:18 +0000)]
MFC r339451: objcopy: restore behaviour required by GCC's build

In r339350 filter_reloc() was removed, to fix the case of stripping
statically linked binaries with relocations (which may come from ifunc
use, for example).  As a side effect this changed the behaviour when
stripping object files - the output was broken both before and after
r339350, in different ways.  Unfortunately GCC's build process relies
on the previous behaviour, so:

- Revert r339350, restoring filter_reloc().
- Fix an unitialized variable use (commited as r3638 in ELF Tool Chain).
- Change filter_reloc() to omit relocations referencing removed
  symbols, while retaining relocations with no symbol reference.
- Retain the entire relocation section if it references the dynamic
  symbol table (fix from kaiw in D17596).

PR: 232176
Approved by: re (gjb, kib)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r339684:
gjb [Thu, 25 Oct 2018 15:11:18 +0000 (15:11 +0000)]
MFC r339684:
 Reduce the GCE image size to 27G to be lower than the free
 quota limit.

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

5 years agoMFC r339582:
hselasky [Thu, 25 Oct 2018 14:53:24 +0000 (14:53 +0000)]
MFC r339582:
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by: Peter Holm <peter@holm.cc>
Approved by: re (rgrimes)
Sponsored by: Mellanox Technologies

5 years agoMFC r339584:
slavash [Thu, 25 Oct 2018 14:07:28 +0000 (14:07 +0000)]
MFC r339584:
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

Approved by:    re(rgrimes), hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoMFC r339581:
hselasky [Thu, 25 Oct 2018 12:27:16 +0000 (12:27 +0000)]
MFC r339581:
Fix off-by-one which can lead to panics.

Found by: Peter Holm <peter@holm.cc>
Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agoMFC: r339562 (remove obsolete drivers from GENERIC)
imp [Thu, 25 Oct 2018 05:18:25 +0000 (05:18 +0000)]
MFC:  r339562 (remove obsolete drivers from GENERIC)

Remove the drivers we'd planned on removing from 12.x from GENERIC.

Approved by: re@ (rgrimes@)

5 years agoMFC r339509: Fix loader.conf(5) "password" feature
dteske [Wed, 24 Oct 2018 23:13:53 +0000 (23:13 +0000)]
MFC r339509: Fix loader.conf(5) "password" feature

Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR: kern/207069
Reported by: david@dcrosstech.com
Approved by: re (rgrimes)
Sponsored by: Smule, Inc.

5 years agoMFC r339547:
kp [Wed, 24 Oct 2018 17:32:31 +0000 (17:32 +0000)]
MFC r339547:

vlan: Fix panic with lagg and vlan

vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context
set. We can end up trying to send ARP messages (through the iflladdr_event
event), which requires a vnet context.

PR: 227654
Approved by: re (kib)

5 years agoRemove debug.witness.trace=0 from the installer sysctl.conf(5),
gjb [Tue, 23 Oct 2018 16:24:26 +0000 (16:24 +0000)]
Remove debug.witness.trace=0 from the installer sysctl.conf(5),
which should have been removed from stable/12 post-branch.

This is a direct commit to stable/12.

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

5 years agoMFC 339475: improve drm messaging in driver and UPDATING
imp [Tue, 23 Oct 2018 03:30:14 +0000 (03:30 +0000)]
MFC 339475: improve drm messaging in driver and UPDATING

Approved by: re@ (rgrimes)

5 years agoMFC r339503: Import tzdata 2018f
philip [Tue, 23 Oct 2018 01:39:26 +0000 (01:39 +0000)]
MFC r339503: Import tzdata 2018f

Approved by: re (kib)

5 years agoMFC r339462: make upgrade from previous FreeBSD versions less painful
eugen [Mon, 22 Oct 2018 17:27:36 +0000 (17:27 +0000)]
MFC r339462: make upgrade from previous FreeBSD versions less painful
and make previously working configuration like this work again:

gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"

PR: 204700
Approved by: re (gjb)

5 years agoUncomment -DNDEBUG in stable/12 after branching stable/12.
gjb [Sun, 21 Oct 2018 17:38:52 +0000 (17:38 +0000)]
Uncomment -DNDEBUG in stable/12 after branching stable/12.
This edit was a mistake in head, and should have been applied
to stable/12 upon branching, not head.

This is a direct commit to stable/12.

Reported by: jbeich, dim
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years ago- Prune svn:mergeinfo from the new branch, as nothing has been merged
gjb [Fri, 19 Oct 2018 00:24:23 +0000 (00:24 +0000)]
- Prune svn:mergeinfo from the new branch, as nothing has been merged
  here.
- Remove debugging from GENERIC* kernel configurations
- Enable MALLOC_PRODUCTION
- Default dumpdev=NO
- Remove UPDATING entry regarding debugging features
- Switch 12.0 from -ALPHA10 to -BETA1 to prepare for builds.

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