]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoConvert share/examples/Makefile over to using FILES and FILESDIR.
brd [Wed, 9 May 2018 13:53:10 +0000 (13:53 +0000)]
Convert share/examples/Makefile over to using FILES and FILESDIR.

The goal is to avoid using install directly so we can make changes the affect
how the entire system is installed, without having to touch many places.

This is part of the packaging base work.

Reviewed by: will
Approved by: bapt (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D1513

6 years agoEnable directory creation with FILESDIR.
brd [Wed, 9 May 2018 13:44:54 +0000 (13:44 +0000)]
Enable directory creation with FILESDIR.

This is part of packaging base work.

Reviewed by: will
Approved by: bapt (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D15130

6 years agoUpdate NAT64 documentation, now we support any IPv6 prefixes.
ae [Wed, 9 May 2018 12:25:23 +0000 (12:25 +0000)]
Update NAT64 documentation, now we support any IPv6 prefixes.

MFC after: 1 month

6 years agoRemove PG_U from the rest of the kernel pmap ptes.
kib [Wed, 9 May 2018 12:09:08 +0000 (12:09 +0000)]
Remove PG_U from the rest of the kernel pmap ptes.

Supposedly, they PG_U bits there were set to easier making some kernel
page accessible to userspace in-place.  Since it was not used for the
whole existence of the amd64 pmap.c and current design of the shared
pages prefers double-mapping over the in-place access, remove PG_U
both from the direct map and KVA slots.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRemove PG_U from the recursive pte for kernel pmap' PML4 page.
kib [Wed, 9 May 2018 12:03:40 +0000 (12:03 +0000)]
Remove PG_U from the recursive pte for kernel pmap' PML4 page.

This PML4 page is never used for the userspace process, so there is no
security implications.  But the configuration trips SMAP check, which
should be corrected.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoBring in some last changes in NAT64 implementation:
ae [Wed, 9 May 2018 11:59:24 +0000 (11:59 +0000)]
Bring in some last changes in NAT64 implementation:

o Modify ipfw(8) to be able set any prefix6 not just Well-Known,
  and also show configured prefix6;
o relocate some definitions and macros into proper place;
o convert nat64_debug and nat64_allow_private variables to be
  VNET-compatible;
o add struct nat64_config that keeps generic configuration needed
  to NAT64 code;
o add nat64_check_prefix6() function to check validness of specified
  by user IPv6 prefix according to RFC6052;
o use nat64_check_private_ip4() and nat64_embed_ip4() functions
  instead of nat64_get_ip4() and nat64_set_ip4() macros. This allows
  to use any configured IPv6 prefixes that are allowed by RFC6052;
o introduce NAT64_WKPFX flag, that is set when IPv6 prefix is
  Well-Known IPv6 prefix. It is used to reduce overhead to check this;
o modify nat64lsn_cfg and nat64stl_cfg structures to use nat64_config
  structure. And respectivelly modify the rest of code;
o remove now unused ro argument from nat64_output() function;
o remove __FreeBSD_version ifdef, NAT64 was not merged to older versions;
o add commented -DIPFIREWALL_NAT64_DIRECT_OUTPUT flag to module's Makefile
  as example.

Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC

6 years agolld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC
emaste [Wed, 9 May 2018 11:17:01 +0000 (11:17 +0000)]
lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC

A non-alloc note section should not have a PT_NOTE program header.

Found while linking ghc (Haskell compiler) with lld on FreeBSD.  Haskell
emits a .debug-ghc-link-info note section (as the name suggests, it
contains link info) as a SHT_NOTE section without SHF_ALLOC set.

For this case ld.bfd does not emit a PT_NOTE segment for
.debug-ghc-link-info.  lld previously emitted a PT_NOTE with p_vaddr = 0
and FreeBSD's rtld segfaulted when trying to parse a note at address 0.

LLVM PR: https://llvm.org/pr37361
LLVM review: https://reviews.llvm.org/D46623

PR: 226872
Reviewed by: dim
Sponsored by: The FreeBSD Foundation

6 years agoAdd IFCAP_LINKSTATE support to if_loop(4).
ae [Wed, 9 May 2018 10:50:51 +0000 (10:50 +0000)]
Add IFCAP_LINKSTATE support to if_loop(4).

Reviewed by: wollman
Obtained from: Yandex LLC
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15278

6 years agoNow that a special no-SSP libc is used for rtld, allow
kib [Wed, 9 May 2018 10:33:25 +0000 (10:33 +0000)]
Now that a special no-SSP libc is used for rtld, allow
-fstack-protector-all for normal libc builds.

Submitted by: Luis Pires
Reviewed by: brooks
Differential revision: https://reviews.freebsd.org/D15340

6 years agoMake rtld use libc_nossp_pic.a. Remove SSP shims.
kib [Wed, 9 May 2018 10:30:56 +0000 (10:30 +0000)]
Make rtld use libc_nossp_pic.a.  Remove SSP shims.

Submitted by: Luis Pires
Reviewed by: brooks
Differential revision: https://reviews.freebsd.org/D15341

6 years agoCreated static libc PIC/no-SSP library to be used by rtld.
kib [Wed, 9 May 2018 10:28:24 +0000 (10:28 +0000)]
Created static libc PIC/no-SSP library to be used by rtld.

Rtld is not compatible with SSP, and since we link libc_pic.a to rtld
to have the basic support like memory and string copy functions, we
have to both carefully limit libc use, and to provide the ssp support
shims.  This change makes the libc use in rtld more straighforward but
still limited, and allows to remove the shims, to be done in the next
commit.

Submitted by: Luis Pires
Reviewed by: bdrewery, brooks
Differential revision: https://reviews.freebsd.org/D15283

6 years agoAdd myself to copyright in the LinuxKPI RCU support layer.
hselasky [Wed, 9 May 2018 08:50:42 +0000 (08:50 +0000)]
Add myself to copyright in the LinuxKPI RCU support layer.

Suggested by: mmacy@
Sponsored by: Mellanox Technologies

6 years agoenigma(1) Remove reference to PGP; modernize a bit
eadler [Wed, 9 May 2018 07:46:57 +0000 (07:46 +0000)]
enigma(1) Remove reference to PGP; modernize a bit

- the port was removed 2017-06-07 in r442847
- gnupg1 is the older version of gpg with legacy PGP support
- remove unused macro
- remove now-false statement about export restrictions

6 years agocxgbe(4): Add support for hash filters.
np [Wed, 9 May 2018 04:09:49 +0000 (04:09 +0000)]
cxgbe(4): Add support for hash filters.

These filters reside in the card's memory instead of its TCAM and can be
configured via a new "hashfilter" subcommand in cxgbetool.  Hash and
normal TCAM filters can be used together.  The hardware does an
exact-match of packet fields for hash filters, unlike the masked match
performed for TCAM filters.  Any T5/T6 card with memory can support at
least half a million hash filters.  The sample config file with the
driver configures 512K of these, it is possible to double this to 1
million+ in some cases.

The chip does an exact-match of fields of incoming datagrams with hash
filters and performs the action configured for the filter if it matches.
The fields to match are specified in a "filter mask" in the firmware
config file.  The filter mask always includes the 5-tuple (sip, dip,
sport, dport, ipproto).  It can, optionally, also include any subset of
the filter mode (see filterMode and filterMask in the firmware config
file).

For example:
filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
filterMask = protocol, port, vlan

Exact values of the 5-tuple, the physical port, and VLAN tag would have
to be provided while setting up a hash filter with the chip
configuration above.

Hash filters support all actions supported by TCAM filters.  A packet
that hits a hash filter can be dropped, let through (with optional
steering to a specific queue or RSS region), switched out of another
port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed.
(Support for some of these will show up in the driver in a follow-up
commit very shortly).

Sponsored by: Chelsio Communications

6 years agoDocument intentional fallthrough. (CID 976535)
cy [Wed, 9 May 2018 02:07:09 +0000 (02:07 +0000)]
Document intentional fallthrough. (CID 976535)

MFC after: 1 week

6 years agoFix memory leak. (CID 1199373).
cy [Wed, 9 May 2018 02:02:58 +0000 (02:02 +0000)]
Fix memory leak. (CID 1199373).

MFC after: 1 week

6 years agoRemove 'All Rights Reserved' from the collection copyright and templates.
imp [Wed, 9 May 2018 02:02:49 +0000 (02:02 +0000)]
Remove 'All Rights Reserved' from the collection copyright and templates.

The original Berkeley Software Distributions were made in the 1980's
and 1990's. At that time, the Buenos Ares Convention of 1910 was in
force in most of the countries in the Americas. It required an
affirmative statement of rights reservation, typically using 'All
Rights Reserved.' The Regents included this phrase in their copyright
notices to invoke this treaty to ensure maximal copyright protection.

In the 1990's, Latin America coutries ratifeid the Berne Convention on
copyrights which prohibited them from requiring an affirmative
statement to reserve the rights. When Nicaragua ratified in 2000, the
Buenos Ares Convention of 1910 was effectively repealed. This made all
the 'All Rights Reserved' phrases obsolete and legal deadweight most
of the time, and certainly in the cases removed here.

Since it's no longer required, and is in fact meaningless, core has
decided to dropped it from the project's collection copyright and
sample templates. It encourages other rights holders to do the same
after consultation with their legal department.

More see https://en.wikipedia.org/wiki/Buenos_Aires_Convention for
more information.

Approved by: core@ (emaste@, jhb@)
Differential Review:  https://reviews.freebsd.org/D15264

6 years agoReduce overhead of ktrace checks in the common case.
mmacy [Wed, 9 May 2018 00:00:47 +0000 (00:00 +0000)]
Reduce overhead of ktrace checks in the common case.

KTRPOINT() checks both if we are tracing _and_ if we are recursing within
ktrace. The second condition is only ever executed if ktrace is actually
enabled. This change moves the check out of the hot path in to the functions
themselves.

Discussed with mjg@

Reported by: mjg@
Approved by: sbruno@

6 years agoUpgrade to OpenSSH 7.6p1. This will be followed shortly by 7.7p1.
des [Tue, 8 May 2018 23:13:11 +0000 (23:13 +0000)]
Upgrade to OpenSSH 7.6p1.  This will be followed shortly by 7.7p1.

This completely removes client-side support for the SSH 1 protocol,
which was already disabled in 12 but is still enabled in 11.  For that
reason, we will not be able to merge 7.6p1 or newer back to 11.

6 years agonxge(4):
sbruno [Tue, 8 May 2018 21:14:29 +0000 (21:14 +0000)]
nxge(4):
Remove nxge(4) and associated man page and tools in FreeBSD 12.0.

Submitted by: kbowling
Reviewed by: brooks
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D1529

6 years agoUpdate svn_private_config.h - I misread an autoconf change.
peter [Tue, 8 May 2018 21:01:04 +0000 (21:01 +0000)]
Update svn_private_config.h - I misread an autoconf change.
SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL
SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF
SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN

6 years agoFix two typos reported by N. J. Mann, which were introduced in
tuexen [Tue, 8 May 2018 20:39:35 +0000 (20:39 +0000)]
Fix two typos reported by N. J. Mann, which were introduced in
https://svnweb.freebsd.org/changeset/base/333382 by me.

MFC after: 3 days

6 years agoRemove ignored command line options
imp [Tue, 8 May 2018 20:02:44 +0000 (20:02 +0000)]
Remove ignored command line options

The --device and --part command line options were planned for Linux
compatibility mode. However, that mode will never happen, so remove
them as last vestiges of a false start.

Submitted by: Vlad Movchan

6 years agoefibootmgr.8: fix example
imp [Tue, 8 May 2018 20:02:39 +0000 (20:02 +0000)]
efibootmgr.8: fix example

The example given was for the old, and now deleted, Linux
compatibility mode. Update the example for the current code.

Submitted by: Vlad Movchan

6 years agoImprove printing the boot variables.
imp [Tue, 8 May 2018 19:43:57 +0000 (19:43 +0000)]
Improve printing the boot variables.

Print the boot variables in the order in the BootOrder variable, if it
exists, and then in verbose mode print any unreferneced BootXXXX
variables. If BootOrder isn't set, fall back to printing all the
variables.

Sponsored by: Netflix

6 years agoWhen reporting ERROR or ABORT chunks, don't use more data
tuexen [Tue, 8 May 2018 18:48:51 +0000 (18:48 +0000)]
When reporting ERROR or ABORT chunks, don't use more data
that is guaranteed to be contigous.
Thanks to Felix Weinrank for finding and reporting this bug
by fuzzing the usrsctp stack.

MFC after: 3 days

6 years agoInline print_order(). It's used one palce.
imp [Tue, 8 May 2018 18:25:37 +0000 (18:25 +0000)]
Inline print_order(). It's used one palce.

6 years agoMFV: r333378
jkim [Tue, 8 May 2018 18:18:27 +0000 (18:18 +0000)]
MFV: r333378

Import ACPICA 20180508.

6 years agoUse vYYYYMMDD in the timestamp suffix for Google Compute Engine
gjb [Tue, 8 May 2018 17:15:12 +0000 (17:15 +0000)]
Use vYYYYMMDD in the timestamp suffix for Google Compute Engine
snapshot images for consistency with other OSes.

MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation

6 years agoiflib: print message when iflib_tx_structures_setup fails
shurd [Tue, 8 May 2018 17:15:10 +0000 (17:15 +0000)]
iflib: print message when iflib_tx_structures_setup fails

Print a message when iflib_tx_structures_setup fails, like we do for
iflib_rx_structures_setup.

Now that we always print a message from within
iflib_qset_structures_setup when it fails, stop printing one in
iflib_device_register() at the call site.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15300

6 years agoPrepare DB# handler for deferred trigger of watchpoints.
kib [Tue, 8 May 2018 17:00:34 +0000 (17:00 +0000)]
Prepare DB# handler for deferred trigger of watchpoints.

Since pop %ss/mov %ss instructions defer all interrupts and exceptions
for the next instruction, it is possible that the userspace watchpoint
trap executes on the first instruction of the kernel entry for
syscall/bpt.

In this case, DB# should be treated similarly to NMI: on amd64 we must
always load GSBASE even if the trap comes from kernel mode, and load
the kernel page table root into %cr3.  Moreover, the trap must
use the dedicated stack, because we are still on the user stack when
trapped on syscall entry.

For i386, we must reload %cr3.  The syscall instruction is not configured,
so there is no issue with executing on user stack when trapping.

Due to some CPU erratas it is not always possible to detect that the
userspace watchpoint triggered by inspecting %dr6.  In trap(), compare the
trap %rip with the known unsafe entry points and if matched pretend that
the watchpoint did not fire at all.

Thank you to the MSRC Incident Response Team, and in particular Greg
Lenti and Nate Warfield, for coordinating the response to this issue
across multiple vendors.

Thanks to Computer Recycling at The Working Center of Kitchener for
making hardware available to allow us to test the patch on additional
CPU families.

Reviewed by: jhb
Discussed with: Matthew Dillon
Tested by: emaste
Sponsored by: The FreeBSD Foundation
Security: CVE-2018-8897
Security: FreeBSD-SA-18:06.debugreg

6 years agoiflib: cleanup queues when iflib_device_register fail
shurd [Tue, 8 May 2018 16:56:02 +0000 (16:56 +0000)]
iflib: cleanup queues when iflib_device_register fail

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15299

6 years agoWe don't use f_devdata, so don't set it. Should that need to change
imp [Tue, 8 May 2018 16:16:56 +0000 (16:16 +0000)]
We don't use f_devdata, so don't set it. Should that need to change
later, we can. This leaves ZFS as the only irregular f_devdata
user in the tree.

6 years agoFix wrong cpu0 identification
jhibbits [Tue, 8 May 2018 13:23:39 +0000 (13:23 +0000)]
Fix wrong cpu0 identification

Summary:
chrp_cpuref_init() was relying on the boot strap processor to be
the first child of /cpus. That was not always the case, specially
on pseries with FDT.

This change uses the "reg" property of each CPU instead and also
adds several sanity checks to avoid unexpected behavior (maybe
too many panics?).

The main observed symptom was interrupts being missed by the main
processor, leading to timeouts and the kernel aborting the boot.

Submitted by: Leandro Lupori
Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15174

6 years agoFix for missing network interface address event when adding the default IPv6
hselasky [Tue, 8 May 2018 11:39:01 +0000 (11:39 +0000)]
Fix for missing network interface address event when adding the default IPv6
based link-local address.

The default link local address for IPv6 is added as part of bringing the
network interface up. Move the call to "EVENTHANDLER_INVOKE(ifaddr_event,)"
from the SIOCAIFADDR_IN6 ioctl(2) handler to in6_notify_ifa() which should
catch all the cases of adding IPv6 based addresses to a network interface.
Add a witness warning in case the event handler is not allowed to sleep.

Reviewed by: network (ae), kib
Differential Revision: https://reviews.freebsd.org/D13407
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRevert r333353 - FTS5 uses log(3) which currently breakes non-amd64 builds.
peter [Tue, 8 May 2018 06:09:49 +0000 (06:09 +0000)]
Revert r333353 - FTS5 uses log(3) which currently breakes non-amd64 builds.

Reported by: lwhsu

6 years agoUpdate svn/svnlite from 1.9.7 to 1.10.0
peter [Tue, 8 May 2018 04:54:36 +0000 (04:54 +0000)]
Update svn/svnlite from 1.9.7 to 1.10.0

6 years agoUpdate svn-1.9.7 to 1.10.0.
peter [Tue, 8 May 2018 04:52:52 +0000 (04:52 +0000)]
Update svn-1.9.7 to 1.10.0.

6 years agoUpdate private sqlite from sqlite3-3.20.0 to sqlite3-3.23.1
peter [Tue, 8 May 2018 04:51:47 +0000 (04:51 +0000)]
Update private sqlite from sqlite3-3.20.0 to sqlite3-3.23.1

6 years agoUpdate private sqlite from sqlite3-3.20.0 to sqlite3-3.23.1
peter [Tue, 8 May 2018 04:51:15 +0000 (04:51 +0000)]
Update private sqlite from sqlite3-3.20.0 to sqlite3-3.23.1

6 years agobsdgrep: Allow "-" to be passed to -f to mean "standard input"
kevans [Tue, 8 May 2018 03:53:46 +0000 (03:53 +0000)]
bsdgrep: Allow "-" to be passed to -f to mean "standard input"

A version of this patch was originally sent to me by se@, matching behavior
from newer versions of GNU grep.

While there have been some differences of opinion on whether stdin should be
closed or not after depleting it in process of -f, I've opted to leave stdin
open and just let the later matching stuff fail and result in a no-match.
I'm not married to the current behavior- it was generally chosen since we
are adopting this in particular from GNU grep, and I would like to stay
consistent without a strong argument to the contrary. The current behavior
isn't technically wrong, it's just fairly unfriendly to the developer-user
of grep that may not realize their usage is trivially invalid.

Submitted by: se

6 years agoImport Subversion-1.10.0
peter [Tue, 8 May 2018 03:44:38 +0000 (03:44 +0000)]
Import Subversion-1.10.0

6 years agoFix spurious retransmit recovery on low latency networks
mmacy [Tue, 8 May 2018 02:22:34 +0000 (02:22 +0000)]
Fix spurious retransmit recovery on low latency networks

TCP's smoothed RTT (SRTT) can be much larger than an actual observed RTT. This can be either because of hz restricting the calculable RTT to 10ms in VMs or 1ms using the default 1000hz or simply because SRTT recently incorporated a larger value.

If an ACK arrives before the calculated badrxtwin (now + SRTT):
tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1));

We'll erroneously reset snd_una to snd_max. If multiple segments were dropped and this happens repeatedly the transmit rate will be limited to 1MSS per RTO until we've retransmitted all drops.

Reported by: rstone
Reviewed by: hiren, transport
Approved by: sbruno
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8556

6 years agoSleep rather than spin in e1000 when doing long running config operations.
mmacy [Tue, 8 May 2018 01:39:45 +0000 (01:39 +0000)]
Sleep rather than spin in e1000 when doing long running config operations.

With r333218 it is now possible for drivers to use an sx lock and thus sleep while
waiting on long running operations rather than DELAY().

Reported by: gallatin
Reviewed by: sbruno
Approved by: sbruno
MFC after: 1 month
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14984

6 years agoInlined sched_userret.
mjg [Mon, 7 May 2018 23:36:16 +0000 (23:36 +0000)]
Inlined sched_userret.

The tested condition is rarely true and it induces a function call
on each return to userspace.

Bumps getuid rate by about 1% on Broadwell.

6 years agoChange trap_enotcap to bool and annotate with __read_frequently
mjg [Mon, 7 May 2018 23:10:12 +0000 (23:10 +0000)]
Change trap_enotcap to bool and annotate with __read_frequently

It is read on each return to user space.

6 years agoAvoid calls to syscall_thread_enter/exit for statically defined syscalls
mjg [Mon, 7 May 2018 22:29:32 +0000 (22:29 +0000)]
Avoid calls to syscall_thread_enter/exit for statically defined syscalls

The entire mechanism is rarely used and is quite not performant due to
atomci ops on the syscall table. It also has added overhead for completely
unrelated syscalls.

Reduce it by avoiding the func calls if possible (which consistutes vast
majority of cases).

Provides about 3% syscall rate speed up for getuid on Broadwell.

6 years agoamd64: stop asserting params != NULL in the syscall path
mjg [Mon, 7 May 2018 21:32:08 +0000 (21:32 +0000)]
amd64: stop asserting params != NULL in the syscall path

The parameter is effectively controllable by userspace. It does not matter
what it is set to as it is being passed to copyin - worst case the operation
will just fail.

While here stop computing it unless it is going to be used.

Noted by: dillon@backplane.com

6 years agoPut the CPU starting on one line.
imp [Mon, 7 May 2018 21:09:21 +0000 (21:09 +0000)]
Put the CPU starting on one line.

6 years agoUse device_quiet_children to silence verbose CPU probe messages.
imp [Mon, 7 May 2018 21:09:17 +0000 (21:09 +0000)]
Use device_quiet_children to silence verbose CPU probe messages.

Have cpu0 be noisy, but all the other CPU devices be quiet on boot.

6 years agoAdd device_quiet_children() and device_has_quiet_children()
imp [Mon, 7 May 2018 21:09:08 +0000 (21:09 +0000)]
Add device_quiet_children() and device_has_quiet_children()

If you add a child to a device that has quiet children, we'll
automatically set the quiet flag on the children, and its
children.

This is indended for things like CPU that have a large amount of
repetition in booting that adds nothing.

6 years agoamd64: fix up memset added in r333324
mjg [Mon, 7 May 2018 20:54:42 +0000 (20:54 +0000)]
amd64: fix up memset added in r333324

There was a missing trick expanding the passed pattern to a full word
by multiplication. As a side effect non-zero patterns would be
incorrectly laid down.

This stems from the use of rep stosq which is word-sized, while the passed
argument is byte-sized.

I initially repurposed memcpy into memset without taking this into account.
All but non-bzero testing was performed with a variant utilizing ERMS, i.e.
using only stosb which happens to not into the problem whatsoever. So my bad
twice.

Thanks to Oliver Pinter for noting the problem and providing a testcase.

6 years agoIntroduce caph_enter and caph_enter_casper.
oshogbo [Mon, 7 May 2018 20:38:09 +0000 (20:38 +0000)]
Introduce caph_enter and caph_enter_casper.

The caph_enter function should made it easier to sandbox application
and not force us to remember that we need to check errno on failure.
Another function is also checking if casper is present.

Reviewed by: emaste, cem (partially)
Differential Revision: https://reviews.freebsd.org/D14557

6 years agoFix an off-by-one error when deciding to request a tx interrupt
gallatin [Mon, 7 May 2018 18:11:22 +0000 (18:11 +0000)]
Fix an off-by-one error when deciding to request a tx interrupt

The canonical check for whether or not a ring is drainable is
TXQ_AVAIL() > MAX_TX_DESC() + 2.  Use this same construct here,
in order to avoid a potential off-by-one error where we might otherwise
fail to request an interrupt.

Reviewed by: mmacy
Sponsored by: Netflix

6 years agoamd64: tweak the memmove comment regarding authorship
mjg [Mon, 7 May 2018 17:37:07 +0000 (17:37 +0000)]
amd64: tweak the memmove comment regarding authorship

To make it clear the mentioned author did not write memmove.

6 years agoBoost thread priority while changing CPU frequency
gallatin [Mon, 7 May 2018 15:24:03 +0000 (15:24 +0000)]
Boost thread priority while changing CPU frequency

Boost the priority of user-space threads when they set
their affinity to a core to adjust its frequency.   This avoids a situation
where a CPU bound kernel thread with the same affinity is running on a
down-clocked core, and will "block" powerd from up-clocking the core
until the kernel thread yields.   This can lead to poor perfomance,
and to things potentially getting stuck on Giant.

Reviewed by: kib (imp reviewed earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15246

6 years agoamd64: replace libkern's memset and memmove with assembly variants
mjg [Mon, 7 May 2018 15:07:28 +0000 (15:07 +0000)]
amd64: replace libkern's memset and memmove with assembly variants

memmove is repurposed bcopy (arguments swapped, return value added)
The libkern variant is a wrapper around bcopy, so this is a big
improvement.

memset is repurposed memcpy. The librkern variant is doing fishy stuff,
including branching on 0 and calling bzero.

Both functions are rather crude and subject to partial depessimization.

This is a soft prerequisite to adding variants utilizing the
'Enhanced REP MOVSB/STOSB' bit and let the kernel patch at runtime.

6 years agoKeep CARP state as INIT when net.inet.carp.allow=0.
mav [Mon, 7 May 2018 14:44:55 +0000 (14:44 +0000)]
Keep CARP state as INIT when net.inet.carp.allow=0.

Currently when net.inet.carp.allow=0 CARP state remains as MASTER, which is
not very useful (if there are other masters -- it can lead to split brain,
if there are none -- it makes no sense).  Having it as INIT makes it clear
that carp packets are disabled.

Submitted by: wg
MFC after: 1 month
Relnotes: yes
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14477

6 years agox86 cpususpend_handler: call wbinvd after setting suspend state bits
avg [Mon, 7 May 2018 12:22:25 +0000 (12:22 +0000)]
x86 cpususpend_handler: call wbinvd after setting suspend state bits

Without a subsequent wbinvd the changes to suspended_cpus (and
resuming_cpus) can be lost at least on AMD systems that use MOESI cache
coherency protocol.  That can happen because one of APs ends up as an
Owner of the corresponding cache line(s) and the changes may never reach
the main memory before the AP is reset.

While here, move clearing of suspended_cpus a little bit earlier as the
fact of returning from savectx (with zero return value) means that the
CPU has fully restored it execution context.

Also, rework the comment that describes the need for resuming_cpus.

This change fixed suspend to RAM a previously broken AMD-based system.

Reviewed by: kib
Discussed with: bde
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15295

6 years agoclk: clk_set_assigned: Skip frequency of value 0
manu [Mon, 7 May 2018 09:42:35 +0000 (09:42 +0000)]
clk: clk_set_assigned: Skip frequency of value 0

A frequency of value 0 mean that we don't want to change the frequency so
skip it.

6 years agoarm64: rockchip: cru: Call clk_set_assigned
manu [Mon, 7 May 2018 07:31:25 +0000 (07:31 +0000)]
arm64: rockchip: cru: Call clk_set_assigned

We need to call clk_set_assigned after all the clock have been registered
to set the parents/rates described in the dtb.

6 years agoclk: Add support for assigned-clock-rates
manu [Mon, 7 May 2018 07:30:40 +0000 (07:30 +0000)]
clk: Add support for assigned-clock-rates

The properties 'assigned-clocks', 'assigned-clock-parents' and
'assigned-clock-rates' all work together.
'assigned-clocks' holds the list of clock for which we need to either
assign a new parent or a new frequency.
The old code just supported assigning a new parents, add support for
assigning a new frequency too.

6 years agoarm64: rockchip: clk: Add support to reparent to clk_composite
manu [Mon, 7 May 2018 07:29:48 +0000 (07:29 +0000)]
arm64: rockchip: clk: Add support to reparent to clk_composite

All clk_composite type have the possibility to reparent (choosing another
parent to find a better frequency), add the support for that.

6 years agoarm64: rk3328: Add pll rates tables
manu [Mon, 7 May 2018 07:28:47 +0000 (07:28 +0000)]
arm64: rk3328: Add pll rates tables

Add the known value to be safe for the rk3328 PLLs

6 years agoarm64: rk: Add support for setting pll rate
manu [Mon, 7 May 2018 07:28:10 +0000 (07:28 +0000)]
arm64: rk: Add support for setting pll rate

Add support for setting pll rate. On RockChip SoC two kind of plls are
supported, integer mode and fractional mode.
The two modes are intended to support more frequencies for the core plls.
While here change the recalc method as it appears that the datasheet is
wrong on the calculation method.

6 years agoarm64: rockchip: rk3328: Add armclk clock
manu [Mon, 7 May 2018 07:26:48 +0000 (07:26 +0000)]
arm64: rockchip: rk3328: Add armclk clock

Add the clock definition for the arm clock.
While here remove the indexes in the clock table as we will need clock
with a 0 index (non-exported clocks).

6 years agomsdosfs: use vfs_timestamp() to generate timestamps instead of getnanotime().
pfg [Sun, 6 May 2018 21:29:29 +0000 (21:29 +0000)]
msdosfs: use vfs_timestamp() to generate timestamps instead of getnanotime().

Most filesystems, with the notable exceptions of msdosfs and autofs use
only vfs_timestamp() to read the current time. This has the benefit of
configurable granularity (using the vfs.timestamp_precision sysctl).

For convenience, use it on msdosfs too.

Submitted by: Damjan Jovanovic
Differential Revision: https://reviews.freebsd.org/D15297

6 years agoWith the fall-back hack for lint gone, I have no copyright claim on this file.
phk [Sun, 6 May 2018 21:22:46 +0000 (21:22 +0000)]
With the fall-back hack for lint gone, I have no copyright claim on this file.

6 years agor333175 introduced deferred deletion of multicast addresses in order to permit the...
mmacy [Sun, 6 May 2018 20:34:13 +0000 (20:34 +0000)]
r333175 introduced deferred deletion of multicast addresses in order to permit the driver ioctl
to sleep on commands to the NIC when updating multicast filters. More generally this permitted
driver's to use an sx as a softc lock. Unfortunately this change introduced a race whereby a
a multicast update would still be queued for deletion when ifconfig deleted the interface
thus calling down in to _purgemaddrs and synchronously deleting _all_ of the multicast addresses
on the interface.

Synchronously remove all external references to a multicast address before enqueueing for delete.

Reported by: lwhsu
Approved by: sbruno

6 years agoThe ifnet pointer (ifp) in rt_newaddrmsg can be valid without ifp->if_addr being...
mmacy [Sun, 6 May 2018 20:32:47 +0000 (20:32 +0000)]
The ifnet pointer (ifp) in rt_newaddrmsg can be valid without ifp->if_addr being set if
if the ifnet is still live by way of a reference but
in line for deletion. Check ifp->if_addr before dereferencing.

Approved by: sbruno

6 years agoCleanup sundry clang warnings for code that is not upstream in illumos.
sbruno [Sun, 6 May 2018 16:22:02 +0000 (16:22 +0000)]
Cleanup sundry clang warnings for code that is not upstream in illumos.
https://github.com/illumos/illumos-gate/edit/master/usr/src/lib/libzfs/common/libzfs_sendrecv.c

Patch our version of it to quiesce warnings until someone decides to sync
up our code:

libzfs_sendrecv.c:2555:30: warning: format specifies type 'unsigned long'
  but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                sprintf(guidname, "%lu", thisguid);
                                                   ~~~   ^~~~~~~~
                                                   %llu
libzfs_sendrecv.c:2612:29: warning: format specifies type 'unsigned long'
  but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                        sprintf(guidname, "%lu", parent_fromsnap_guid);
                                           ~~~   ^~~~~~~~~~~~~~~~~~~~
                                           %llu
libzfs_sendrecv.c:2645:29: warning: format specifies type 'unsigned long'
  but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                        sprintf(guidname, "%lu", parent_fromsnap_guid);
                                           ~~~   ^~~~~~~~~~~~~~~~~~~~
                                           %llu

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D15325

6 years agoFix spelling of --output long option in fetch.1
bjk [Sun, 6 May 2018 15:59:03 +0000 (15:59 +0000)]
Fix spelling of --output long option in fetch.1

PR: 228017
Reported by: rff1917@yahoo.com

6 years agoam335x_prcm: Delay the frequencies read check
manu [Sun, 6 May 2018 14:37:11 +0000 (14:37 +0000)]
am335x_prcm: Delay the frequencies read check

With Linux 4.17 dts the compatible for the prcm added 'simplebus' we mean
that the simplebus driver will attach to it at the BUS_PASS_BUS pass.
Change the pass for the prcm driver to be at BUS_PASS_BUS so we will win
the attach.
This introduce a problem as this driver needs the ti_scm one to be already
attached. ti_scm also attach at BUS_PASS_BUS but after the prcm one as it is
after in the dtb and the simplebus driver simpy walk the tree to attach it's
children.
Use the bus_new_pass method to defer the frequencies read at BUS_PASS_TIMER.
This fixes booting on BeagleBone*

Reported by: many

6 years agoEnsure we are not dereferencing a NULL pointer.
tuexen [Sun, 6 May 2018 14:19:50 +0000 (14:19 +0000)]
Ensure we are not dereferencing a NULL pointer.

This was found by Coverity scanning the usrsctp stack (CID 203808).

MFC after: 3 days

6 years agoUpdate the repository URLs.
des [Sun, 6 May 2018 13:21:44 +0000 (13:21 +0000)]
Update the repository URLs.

6 years agoVendor import of OpenSSH 7.6p1.
des [Sun, 6 May 2018 12:24:45 +0000 (12:24 +0000)]
Vendor import of OpenSSH 7.6p1.

6 years agoAdd netdump support to iflib.
markj [Sun, 6 May 2018 00:57:52 +0000 (00:57 +0000)]
Add netdump support to iflib.

em(4) and igb(4) were tested by me, and ixgbe(4) and bnxt(4) were
tested by sbruno.

Reviewed by: mmacy, shurd
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15262

6 years agoAdd netdump support to vtnet(4).
markj [Sun, 6 May 2018 00:53:52 +0000 (00:53 +0000)]
Add netdump support to vtnet(4).

Tested with bhyve.

Reviewed by: bryanv, julian
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15261

6 years agoAdd netdump support to re(4).
markj [Sun, 6 May 2018 00:52:17 +0000 (00:52 +0000)]
Add netdump support to re(4).

Tested with a RealTek 8101E adapter.

Reviewed by: sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15260

6 years agoAdd netdump support to cxgb(4).
markj [Sun, 6 May 2018 00:48:43 +0000 (00:48 +0000)]
Add netdump support to cxgb(4).

Tested with a T320 adapter.

Reviewed by: np
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15258

6 years agoAdd netdump support to bxe(4).
markj [Sun, 6 May 2018 00:47:39 +0000 (00:47 +0000)]
Add netdump support to bxe(4).

Tested with a NetXtreme II BCM57810 adapter.

Reviewed by: davidcs
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15257

6 years agoAdd netdump hooks to bge(4).
markj [Sun, 6 May 2018 00:45:41 +0000 (00:45 +0000)]
Add netdump hooks to bge(4).

Tested with a NetXtreme BCM5727 adapter.

Reviewed by: julian
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15256

6 years agoAdd netdump hooks to alc(4).
markj [Sun, 6 May 2018 00:43:46 +0000 (00:43 +0000)]
Add netdump hooks to alc(4).

Tested with an AR8162.

Reviewed by: julian, sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15255

6 years agoAdd netdump support to dumpon(8).
markj [Sun, 6 May 2018 00:42:30 +0000 (00:42 +0000)]
Add netdump support to dumpon(8).

A new usage is added so that parameters for netdump may be specified.
Specifically, one configures an interface for netdump with:

# dumpon -c <client IP> -s <server IP> [-g <gateway IP>] <iface name>

Reviewed by: bdrewery, cem (earlier versions), sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15254

6 years agoImport the netdump client code.
markj [Sun, 6 May 2018 00:38:29 +0000 (00:38 +0000)]
Import the netdump client code.

This is a component of a system which lets the kernel dump core to
a remote host after a panic, rather than to a local storage device.
The server component is available in the ports tree. netdump is
particularly useful on diskless systems.

The netdump(4) man page contains some details describing the protocol.
Support for configuring netdump will be added to dumpon(8) in a future
commit. To use netdump, the kernel must have been compiled with the
NETDUMP option.

The initial revision of netdump was written by Darrell Anderson and
was integrated into Sandvine's OS, from which this version was derived.

Reviewed by: bdrewery, cem (earlier versions), julian, sbruno
MFC after: 1 month
X-MFC note: use a spare field in struct ifnet
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15253

6 years agoRefactor some of the MI kernel dump code in preparation for netdump.
markj [Sun, 6 May 2018 00:22:38 +0000 (00:22 +0000)]
Refactor some of the MI kernel dump code in preparation for netdump.

- Add clear_dumper() to complement set_dumper().
- Drain netdump's preallocated mbuf pool when clearing the dumper.
- Don't do bounds checking for dumpers with mediasize 0.
- Add dumper callbacks for initialization for writing out headers.

Reviewed by: sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15252

6 years agoAdd an mbuf allocator for netdump.
markj [Sun, 6 May 2018 00:19:48 +0000 (00:19 +0000)]
Add an mbuf allocator for netdump.

The aim is to permit mbuf allocations after a panic without calling into
the page allocator, without imposing any runtime overhead during regular
operation of the system, and without modifying driver code. The approach
taken is to preallocate a number of mbufs and clusters, storing them
in linked lists, and using the lists to back some UMA cache zones. At
panic time, the mbuf and cluster zone pointers are overwritten with
those of the cache zones so that the mbuf allocator returns
preallocated items.

Using this scheme, drivers which cache mbuf zone pointers from
m_getzone() require special handling when implementing netdump support.

Reviewed by: cem (earlier version), julian, sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15251

6 years agoStyle.
markj [Sun, 6 May 2018 00:11:30 +0000 (00:11 +0000)]
Style.

MFC after: 3 days

6 years agoRemove a redundant assertion.
markj [Sun, 6 May 2018 00:05:03 +0000 (00:05 +0000)]
Remove a redundant assertion.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoAvoid dropping the topology lock in gmirror's dumpconf implementation.
markj [Sun, 6 May 2018 00:03:24 +0000 (00:03 +0000)]
Avoid dropping the topology lock in gmirror's dumpconf implementation.

Doing so introduces races which can lead to a use-after-free when
grabbing a snapshot of the GEOM mesh.

To ensure that a mirror's disk list remains stable, change its locking
protocol: both the softc lock and the topology lock are now required
to modify the list, so either lock is sufficient for traversal.

Tested by: pho
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoCurrently in_pcbfree will unconditionally wunlock the pcbinfo lock
mmacy [Sat, 5 May 2018 22:40:40 +0000 (22:40 +0000)]
Currently in_pcbfree will unconditionally wunlock the pcbinfo lock
to avoid a LOR on the multicast list lock in the freemoptions routines.
As it turns out, tcp_usr_detach can acquire the tcbinfo lock readonly.
Trying to wunlock the pcbinfo lock in that context has caused a number
of reported crashes.

This change unclutters in_pcbfree and moves the handling of wunlock vs
runlock of pcbinfo to the freemoptions routine.

Reported by: mjg@, bde@, o.hartmann at walstatt.org
Approved by: sbruno

6 years agocxgbe(4): Update all firmwares to 1.19.1.0.
np [Sat, 5 May 2018 20:16:08 +0000 (20:16 +0000)]
cxgbe(4): Update all firmwares to 1.19.1.0.

These firmwares and the following list of changes are from the public
ChelsioUwire-3.7.1.0 release.

T6 Firmware
================================================================================
Version : 1.19.1.0
Date    : 04/23/2018
================================================================================

Fixes
-----

BASE:
- Fixed traffic stall when rate-limit is modified while running traffic.
- Fixes a firmware crash in FW_ETH_TX_EO_WR handling.
- Fixes host DCB support when FW_PORT_CMD is used.

ETH:
- Exit Auto-Negotiation if we don't receive base page from peer within 10s.
  This fixes some cases where in we keep on restarting auto negotiation without
  ever exiting, resulting in link failure.
- Fixes an issue where VF packets counter were not increasing if VF packets
  coalesced WR is used by driver.

OFLD:
- Kernel and user mode NVMEoF performance enhancements.

FOiSCSI:
- Fixes fw crash when trying to connect to non-existence IPv6 iSNS target.

================================================================================
Version : 1.18.9.0
Date    : 03/27/2018
================================================================================

Fixes
-----

BASE:
- For Ethernet frames less than 64B, pad them with zero bytes as per IEEE spec
  (RFC 894).
- Added a new parameter iqtype to FW_IQ_CMD to identify the ingress NIC or offload
  queues. This fixes an issue where driver was receiving interrupt with no new
  messages in queue.
- FW_PARAMS_CMD processes all the valaid paramaters and returns value 0UL for
  any unknown parameter.

OFLD:
- Fixes connection failure during SRQ reuse.
- Fixes incorrect cqe in case of WRITE with immediate operation.

FOiSCSI:
- Fixes a fw crash when wrong node-id is passed to FW_FOISCSI_CTRL_WR.

FOFCoE:
- Fixes a fw hang while creating NPIV.

Enhancements
------------

ETH:
- A new WR FW_ETH_TX_PKTS_VM_WR added to support VM packet coalescing.

================================================================================
Version : 1.18.4.0
Date    : 02/28/2018
================================================================================

Fixes
-----

BASE:
- Fixed Rate limiting not working for 101Mbps<=rate limit<=163Mbps range.
- Fixed starting more than 32 VMs on PF4 causing firmware hang.

ETH:
- Fixed link failure due to FEC mismatch with optics.
- Fixed link failure with link toggle stress tests.
- Only BaseR FEC is supported for 50G.
- Fixed a bug in next page handling which sometimes causes link down.
- Fixed port down due to failre to read eeprom contents of some modules.
- Fixed a bug causing adapter to fail with spider configuration.

FOiSCSI:
- Fixed a bug causing login failure when connecting to multiple targets.

Enhancements
------------

BASE:
- Added a new firmware API to retrieve the maximum temperaturethreshold for
  the chip (FW_PARAM_DEV_DIAG_MAXTMPTHRESH).

ETH:
- Added support for user to contol pause negotiation during auto negotiation.

FOiSCSI:
- Added a new facility to redirect few fw events to offload rx queue
  (based on driver's configration)
- Driver can ignore providing ipv6 prefix len during ipv6 address configuration.

================================================================================
Version : 1.17.14.0
Date    : 12/27/2017
================================================================================

FIXES
-----

BASE:
- Fixed an FLR failure during simulteneous power up of VM.
- Fixed an issue in vlan acl which was limiting vlan range to 1024.

ETH:
- Enabled RS-FEC for 25G active copper cable and 25GBASE-SR.
- When auto negotiation is enabled, final pause settings are resolved
  based on local and peer pause settings.
- Handle NACK for an I2C access.

OFLD
- Fixed rdma connection cleanup in SO adpater.
- Fixed rdma connections during read invalidate.
- Fixed the crash when invalid BW rate is passed to fw.
- Fixed the traffic hang when BW allocation is changed from switch during traffic.

FOFCoE:
- Fixed an issue where initiator remains logged-in even after LLDP is disabled
  on switch.

ENHANCEMENTS
------------

BASE:
- Added support for 248 VFs.
- Added fw driver periodic calibration for MC.

ETH:
- Added XLAUI port type support.
- Added raw mac entry deletion support (FW_VI_MAC_ID_BASED_FREE).

OFLD:
- Inline IPSec support added (flag F_FW_ULPTX_WR_DATA indicates the inline
  IPSec WR).
- New work request FW_RI_RDMA_WRITE_CMPL_WR (write with completion) added to

T5 Firmware
================================================================================
Version : 1.19.1.0
Date    : 04/23/2018
================================================================================

Fixes
-----

BASE:
- Fixes a firmware crash in FW_ETH_TX_EO_WR handling.
- Fixes host DCB support when FW_PORT_CMD is used.

ETH:
- Fixes an issue where VF packets counter were not increasing if VF packets
  coalesced WR is used by driver.

OFLD:
- Fixes an issue where fw hangs if max traffic rate passed is 0.

FOiSCSI:
-  Fixes fw crash when trying to connect to non-existence IPv6 iSNS target.

================================================================================
Version : 1.18.9.0
Date    : 03/27/2018
================================================================================

Fixes
-----

BASE:
- For Ethernet frames less than 64B, pad them with zero bytes as per IEEE spec
  (RFC 894).
- Added a new parameter iqtype to FW_IQ_CMD to identify the ingress NIC or offload
  queues. This fixes an issue where driver was receiving interrupt with no new
  messages in queue.

ETH:
- Pad the Ethernet packets of size less than 64B with zeros. This fixes the
  incorrect checksum generation of packets less then 64B.

FOiSCSI:
- Fixes a fw crash when wrong node-id is passed to FW_FOISCSI_CTRL_WR.

FOFCoE:
- Fixes a fw hang while creating NPIV.

Enhancements
------------

ETH:
- A new WR FW_ETH_TX_PKTS_VM_WR added to support VM packet coalescing.

================================================================================
Version : 1.18.4.0
Date    : 02/28/2018
================================================================================

Fixes
-----

BASE:
- Fixed starting more than 32 VMs on PF4 causing firmware hang.

FOiSCSI:
- Fixed a bug causing login failure when connecting to multiple targets.

Enhancements
------------

BASE:
- Added a new firmware API to retrieve the maximum temperaturethreshold for
  the chip (FW_PARAM_DEV_DIAG_MAXTMPTHRESH).

ETH:
- Added support for user to contol pause negotiation during auto negotiation.

FOiSCSI:
- Added a new facility to redirect few fw events to offload rx queue
  (based on driver's configration)
- Driver can ignore providing ipv6 prefix len during ipv6 address configuration.

================================================================================
Version : 1.17.14.0
Date    : 12/27/2017
================================================================================

FIXES
-----

BASE:
- Fixed an issue in vlan acl which was limiting vlan range to 1024.

ETH:
- Corrected lane inversion logic.
- Fixed improper LED behavior in T580 cards.
- When auto negotiation is enabled, final pause settings are resolved
  based on local and peer pause settings.
- Handle NACK for an I2C access.

OFLD
- Fixed rdma connections during read invalidate.

FOiSCSI:
- Fixed a connections hang when link is toggled frequently.

FOFCoE:
- Fixed an issue where initiator remains logged-in even after LLDP is disabled
  on switch.

ENHANCEMENTS
------------

BASE:
- Added support for 124 VFs.

ETH:
- Added XLAUI port type support.
- Added raw mac entry deletion support (FW_VI_MAC_ID_BASED_FREE).

OFLD:
- New work request FW_RI_RDMA_WRITE_CMPL_WR (write with completion) added to
  optimize NVMEoF write.

T4 Firmware
================================================================================
Version : 1.19.1.0
Date    : 04/23/2018
================================================================================

Fixes
-----

BASE:
- Fixes a firmware crash in FW_ETH_TX_EO_WR handling.
- Fixes host DCB support when FW_PORT_CMD is used.

FOiSCSI:
-  Fixes fw crash when trying to connect to non-existence IPv6 iSNS target.

================================================================================
Version : 1.18.9.0
Date    : 03/27/2018
================================================================================

Fixes
-----

BASE:
- Added a new paramter iqtype to FW_IQ_CMD to identify the ingress NIC or
  offload queues. This fixes an issue where driver was receiving interrupt with
  no new messages in queue.

FOFCoE:
- Fixes a fw hang while creating NPIV.

Enhancements
------------

ETH:
- A new WR FW_ETH_TX_PKTS_VM_WR added to support VM packet coalescing.

================================================================================
Version : 1.18.4.0
Date    : 02/28/2018
================================================================================

Enhancements
------------

BASE:
- Added a new firmware API to retrieve the maximum temperaturethreshold for
  the chip (FW_PARAM_DEV_DIAG_MAXTMPTHRESH).

================================================================================
Version : 1.17.14.0
Date    : 12/27/2017
================================================================================

FIXES
-----

BASE:
- Fixed an issue in vlan acl which was limiting vlan range to 1024.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoAdd NVMe Namespace Management support to nvmecontrol(8).
mav [Sat, 5 May 2018 20:08:03 +0000 (20:08 +0000)]
Add NVMe Namespace Management support to nvmecontrol(8).

This allows create/delete/attach/detach namespaces on new NVMe controllers.
This is only a first user-level part of the bigger change set.  Kernel part
required to detect and handle the configuration changes without reboot is
completely independent and will be added separately.

Submitted by: Matt Williams <mffbsdw@gmail.com> (original version)
Differential Revision: https://reviews.freebsd.org/D11399

6 years agoRemove accidentally committed debug statement that induced the following
sbruno [Sat, 5 May 2018 18:39:54 +0000 (18:39 +0000)]
Remove accidentally committed debug statement that induced the following
warning:

make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: duplicate
script for target "_scriptsinstall" ignored
make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: using
previous script for "_scriptsinstall" defined here

Reviewed by: kevans

6 years agoAdd support for powernv POWER9 MMU initialization
jhibbits [Sat, 5 May 2018 16:00:02 +0000 (16:00 +0000)]
Add support for powernv POWER9 MMU initialization

The POWER9 MMU (PowerISA 3.0) is slightly different from current
configurations, using a partition table even for hypervisor mode, and
dropping the SDR1 register.  Key off the newly early-enabled CPU features
flags for the new architecture, and configure the MMU appropriately.

The POWER9 MMU ignores the "PSIZ" field in the PTCR, and expects a 64kB
table.  As we are enabled for powernv (hypervisor mode, no VMs), only
initialize partition table entry 0, and zero out the rest.  The actual
contents of the register are identical to SDR1 from previous architectures.

Along with this, fix a bug in the page table allocation with very large
memory.  The table can be allocated on any 256k boundary.  The
bootstrap_alloc alignment argument is an int, and with large amounts of
memory passing the size of the table as the alignment will overflow an
integer.  Hard-code the alignment at 256k as wider alignment is not
necessary.

Reviewed by: nwhitehorn
Tested by: Breno Leitao
Relnotes: Yes

6 years agoBreak out the cpu_features setup to its own function, to be run earlier
jhibbits [Sat, 5 May 2018 15:48:39 +0000 (15:48 +0000)]
Break out the cpu_features setup to its own function, to be run earlier

The new POWER9 MMU configuration is slightly different from current setups.
Rather than special-casing on POWER9, move the initialization of cpu_features
and cpu_features2 to as early as possible, so that platform and MMU
configuration can be based upon CPU features instead of specific CPUs if at all
possible.

Reviewed by: nwhitehorn

6 years agoAdd POWER9 to the POWER8 bootstrap case blocks
jhibbits [Sat, 5 May 2018 15:42:58 +0000 (15:42 +0000)]
Add POWER9 to the POWER8 bootstrap case blocks

POWER8 and POWER9 have similar configuration requirements for hypervisor setup,
and in the cases here they're identical.  Add the POWER9 constant to the POWER8
list so it's initialized correctly.

Reviewed by: nwhitehorn

6 years ago[skel] Remove dot.rhosts from share/skel
eadler [Sat, 5 May 2018 08:16:19 +0000 (08:16 +0000)]
[skel] Remove dot.rhosts from share/skel

The rcmds were removed in r324351. Chase that removal.

6 years agoamdsbwd: fix reboot status reporting
avg [Sat, 5 May 2018 05:22:11 +0000 (05:22 +0000)]
amdsbwd: fix reboot status reporting

Originally, I overlooked that PMIO register 0xc0 has a dual personality.
It can either be S5/Reset Status register or Misc. Fix register (aka
debug status register).  The mode is controlled by bit 2 in PMIO
register 0xc4.  Apparently there are register programming requirements
for the second personality, so many BIOSes leave the register, after
programming it, in that mode.  So, we need to switch the register to the
correct mode.

Additionally, AMDSB8_WD_RST_STS was defined incorrectly as bit 13 while
it is actually bit 25 (and the register's width is 32 bits, not 16).

With this change I see the following in dmesg after a reset by the
watchdog:
amdsbwd0: ResetStatus = 0x42000000
amdsbwd0: Previous Reset was caused by Watchdog

MFC after: 2 weeks

6 years agofor bus suspend, detach and shutdown iterate children in reverse order
avg [Sat, 5 May 2018 05:19:32 +0000 (05:19 +0000)]
for bus suspend, detach and shutdown iterate children in reverse order

For most buses all children are equal, so the order does not matter.
Other buses, such as acpi, carefully order their child devices to
express implicit dependencies between them.  For such buses it is safer
to bring down devices in the reverse order.

I believe that this is the reason why hpet_suspend had to be disabled.
Some drivers depend on a working event timer until they are suspended.
But previously we would suspend hpet very early.

I tested this change by makinbg hpet_suspend actually stop HPET timers
and tested that too.

Note that this change is not a complete solution as it does not take
into account bus passes.
A better approach would be to track the actual attach order of the
devices and to use the reverse of that.

Reviewed by: imp, mav
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15291