]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMerge ACPICA 20170831.
jkim [Thu, 31 Aug 2017 22:47:04 +0000 (22:47 +0000)]
Merge ACPICA 20170831.

6 years agoClear doorbell bits after masking them before processing.
mav [Thu, 31 Aug 2017 21:37:22 +0000 (21:37 +0000)]
Clear doorbell bits after masking them before processing.

In theory this allows to avoid one more expensive doorbell register read
later in some scenarios.  But in practice it also significantly increases
packet rate on PLX hardware, that I can't explain yet, possibly work-
arounding some interrupt delays.

MFC after: 13 days
Sponsored by: iXsystems, Inc.

6 years agoAdd support for quirks while enabling secondary CPUs. This uses the fdt
andrew [Thu, 31 Aug 2017 20:48:05 +0000 (20:48 +0000)]
Add support for quirks while enabling secondary CPUs. This uses the fdt
compatible string to check if the board is compatible with a given quirk.
It's possible this will be moved later, however as it's currently only used
by the MP code put it there.

So far the only instance of a quirk is when the list of CPUs may be
incorrect. This can happen on virtual machines with a hard coded
devicetree, but where the user may then set the number of CPUs as an
argument. This is the case on the ARM models so include the model specific
compat strings for these, including the spelling mistake found in some of
the OpenplatformPkg dtb files.

Sponsored by: DARPA, AFRL

6 years agocxgbe/t4_tom: Add a knob to select the congestion control algorigthm
np [Thu, 31 Aug 2017 20:33:22 +0000 (20:33 +0000)]
cxgbe/t4_tom: Add a knob to select the congestion control algorigthm
used by the TOE hardware for fully offloaded connections.  The knob
affects new connections only.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoAllow kldload tcpmd5
jpaetzel [Thu, 31 Aug 2017 20:16:28 +0000 (20:16 +0000)]
Allow kldload tcpmd5

PR: 220170
MFC after: 2 weeks

6 years agoamdtemp.4: Update BKDG URL to current location
cem [Thu, 31 Aug 2017 18:39:18 +0000 (18:39 +0000)]
amdtemp.4: Update BKDG URL to current location

Sponsored by: Dell EMC Isilon

6 years agoAdd UCS2->UTF8 option.
imp [Thu, 31 Aug 2017 17:53:50 +0000 (17:53 +0000)]
Add UCS2->UTF8 option.

Many UEFI variables are UCS2 strings (some NUL terminated, others
not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing.

Sponsored by: Netflix

6 years agoSave where we're booted from
imp [Thu, 31 Aug 2017 17:32:24 +0000 (17:32 +0000)]
Save where we're booted from

Record the file path for boot1.efi as the UEFI environemnt variable
FreeBSDBootVarGUID:Boot1Path. Record the device this came from as
FreeBSDBootVarGUID:Boot1Dev. While later stages of the boot may be
able to guess these values by retrieving UEFIGlobal:BootCurrent and
groveling through the correct UEFIGlobal:BootXXXX, this provides
certanty in the face of behavior from any part of the boot loader
chain that might "guess" what to do next. These env variables are
volatile and will disappear on reboot.

Sponsored by: Netflix

6 years agoExit rather than panic for most errors.
imp [Thu, 31 Aug 2017 17:32:19 +0000 (17:32 +0000)]
Exit rather than panic for most errors.

In the FreeBSD UEFI boot protocol, boot1.efi exits back to UEFI if it
can't boot the image for most reasons (so that further items in the
EFI boot manger list can be tried). Rename panic to efi_panic, make it
static and give it an extra status argument. Exit back to UEFI with
that status argument so the next loader can be tried.

Use malloc/free exclusively instead of mixing malloc/free and
AllocatePool/FreePool. The code is smaller.

Sponsored by: Netflix

6 years agoboot1.efi: print more info about where boot1.efi is loaded from
imp [Thu, 31 Aug 2017 17:32:14 +0000 (17:32 +0000)]
boot1.efi: print more info about where boot1.efi is loaded from

Print the device that boot1.efi was loaded from. Print the path as
well (since it isn't included in DeviceHandle). Move block where we do
this earlier so all the block handle code is now together.

Sponsored by: Netflix

6 years agoMake efichar.c routines available to libefi.
imp [Thu, 31 Aug 2017 17:32:09 +0000 (17:32 +0000)]
Make efichar.c routines available to libefi.

Make efichar.c routines available to libefi as well as
libefivar. Define LIBEFI when building so we can conditionally include
stand.h vs the normal userland stuff.

6 years agoImport ACPICA 20170831.
jkim [Thu, 31 Aug 2017 17:21:06 +0000 (17:21 +0000)]
Import ACPICA 20170831.

6 years agoRemove unneeded pmap_change_attr() calls.
mav [Thu, 31 Aug 2017 17:02:06 +0000 (17:02 +0000)]
Remove unneeded pmap_change_attr() calls.

Reported by: kib
MFC after: 13 days

6 years agoAdd/polish some defines.
mav [Thu, 31 Aug 2017 16:32:11 +0000 (16:32 +0000)]
Add/polish some defines.

MFC after: 13 days

6 years agoFix parsing File() nodes in device paths.
imp [Thu, 31 Aug 2017 15:53:47 +0000 (15:53 +0000)]
Fix parsing File() nodes in device paths.

o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we
  don't include 'File()' in the supposed path name. This happens because
  of a possible misfeature in the EDK2 code where any path that's not
  recognized is treated as a File() node.
o Convert utf8 input into ucs2 output rather than just copying the
  utf8 and hoping for the best (no good comes from that).
o Remove bogus comment about needing to add 1. The dummy array already
  is length 1, so that's included in sizeof the struct, so there's no
  need to add it.

Sponsored by: Netflix

6 years agoFix printing File() nodes in device paths.
imp [Thu, 31 Aug 2017 15:53:27 +0000 (15:53 +0000)]
Fix printing File() nodes in device paths.

Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not
ASCII/UTF8. Convert to utf8 and print that when printing File
paths. Also, since File may be at the end of a long device path,
output File() around the path so it doesn't just show up as random
nodes that might accidentally match real node paths names and cause
errors.

6 years agoThe nvme module should explicitly declare dependency on the cam.
kib [Thu, 31 Aug 2017 14:21:32 +0000 (14:21 +0000)]
The nvme module should explicitly declare dependency on the cam.

If both nvme and cam are compiled as modules, nvme cannot be kldloaded
otherwise.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix port control for PEX 8749.
mav [Thu, 31 Aug 2017 13:41:44 +0000 (13:41 +0000)]
Fix port control for PEX 8749.

That chip has three Station Ports, so previous address math was incorrect.

MFC after: 13 days
Sponsored by: iXsystems, Inc.

6 years agoAdd sysctls for arc shrinking and growing values
bapt [Thu, 31 Aug 2017 13:02:17 +0000 (13:02 +0000)]
Add sysctls for arc shrinking and growing values

The default value for arc_no_grow_shift may not be optimal when using
several GiB ARC. Expose it via sysctl allows users to tune it easily.

Also expose arc_grow_retry via sysctl for the same reason. The default value of
60s might, in case of intensive load, be too long.

Submitted by: Nikita Kozlov <nikita.kozlov@blade-group.com>
Reviewed by: mav, manu, bapt
MFC after: 2 weeks
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12144

6 years agoMerge upstream r4302 to support multiple concurrently valid anchors.
des [Thu, 31 Aug 2017 12:02:14 +0000 (12:02 +0000)]
Merge upstream r4302 to support multiple concurrently valid anchors.

If an unpatched unbound-anchor is run without a preexisting root anchor
between 2017-09-11 and 2017-10-11, it will fail and Unbound will not be
able to start unless the validator is disabled.  An EN will be issued
with patches for existing systems and information on how to work around
the issue on new installations.

6 years agoMake ntb_set_ctx() always generate fake link event.
mav [Thu, 31 Aug 2017 10:59:39 +0000 (10:59 +0000)]
Make ntb_set_ctx() always generate fake link event.

It allows application driver get initial link state without racing with
hardware interrupts, thanks to the context rmlock held here.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

6 years agoMake ntb_transport(4) ready receive early link events.
mav [Thu, 31 Aug 2017 10:53:10 +0000 (10:53 +0000)]
Make ntb_transport(4) ready receive early link events.

Those events may be reported as soon as callback is registered, if the link
is enabled by hardware or some other application.

While there, clean link_is_up variable on link down event.

MFC after: 1 week

6 years agoFix flags field decoding in ACPI_NFIT_CONTROL_REGION.
mav [Thu, 31 Aug 2017 09:08:06 +0000 (09:08 +0000)]
Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.

It looked like incomplete copy/paste, printing absolute garbage.

While there, print ValidFields field ax hex, since it is a bitmask.

MFC after: 3 days

6 years agoSpelling.
grog [Wed, 30 Aug 2017 23:49:14 +0000 (23:49 +0000)]
Spelling.

6 years agocxgbe(4): Add two new debug flags -- one to allow manual firmware
np [Wed, 30 Aug 2017 23:41:04 +0000 (23:41 +0000)]
cxgbe(4): Add two new debug flags -- one to allow manual firmware
install after full initialization, and another to disable the TCB
cache (T6+).  The latter works as a tunable only.

Note that debug_flags are for debugging only and should not be set
normally.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoxls_ehci: eliminate 'format string is not a string literal' warning
emaste [Wed, 30 Aug 2017 22:58:11 +0000 (22:58 +0000)]
xls_ehci: eliminate 'format string is not a string literal' warning

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoocteon_ebt3000_cf: eliminate 'format string is not a string literal' warning
emaste [Wed, 30 Aug 2017 22:54:11 +0000 (22:54 +0000)]
octeon_ebt3000_cf: eliminate 'format string is not a string literal' warning

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoAdd NTB driver for PLX/Avago/Broadcom PCIe switches.
mav [Wed, 30 Aug 2017 21:16:32 +0000 (21:16 +0000)]
Add NTB driver for PLX/Avago/Broadcom PCIe switches.

This driver supports both NTB-to-NTB and NTB-to-Root Port modes (though
the second with predictable complications on hot-plug and reboot events).
I tested it with PEX 8717 and PEX 8733 chips, but expect it should work
with many other compatible ones too.  It supports up to two NT bridges
per chip, each of which can have up to 2 64-bit or 4 32-bit memory windows,
6 or 12 scratchpad registers and 16 doorbells.  There are also 4 DMA engines
in those chips, but they are not yet supported.

While there, rename Intel NTB driver from generic ntb_hw(4) to more specific
ntb_hw_intel(4), so now it is on par with this new ntb_hw_plx(4) driver and
alike to Linux naming.

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

6 years agoCompile reloc.o with -fno-jump-tables on MIPS.
jhb [Wed, 30 Aug 2017 20:00:15 +0000 (20:00 +0000)]
Compile reloc.o with -fno-jump-tables on MIPS.

In particular, the switch statement on the type of dynamic entries
in _rtld_relocate_nonplt_self() needs to not use a jump table since
jump tables on MIPS use local GOT entries which aren't initialized
until after this loop.

Suggested by: arichardson
Reviewed by: emaste
Sponsored by: DARPA / AFRL

6 years agoApply 64k padding to stack pointer for 32-bit processes.
jhb [Wed, 30 Aug 2017 19:21:11 +0000 (19:21 +0000)]
Apply 64k padding to stack pointer for 32-bit processes.

In particular, MIPS now has COMPAT_FREEBSD32 for n64 kernels so this
cannot be ignored for n64.  On the other hand, it is unneeded for o32
MIPS kernels as the issue is only present when using 64-bit registers,
so remove the workaround from o32 kernels.

Reviewed by: jmallett
Sponsored by: DARPA / AFRL

6 years agoDon't include GNU object attributes when building with clang.
jhb [Wed, 30 Aug 2017 19:19:31 +0000 (19:19 +0000)]
Don't include GNU object attributes when building with clang.

LLVM's MIPS assembler parser does not understand the GNU as
'.gnu_attribute' keyword.  This could be re-enabled if LLVM is updated
in the future.  The desired floating point ABI is already described in
the .MIPS.abiflags section.

Reviewed by: emaste
Sponsored by: DARPA / AFRL

6 years agoRevert r323008 and its conversion of e1000/iflib to using SX locks.
sbruno [Wed, 30 Aug 2017 18:56:24 +0000 (18:56 +0000)]
Revert r323008 and its conversion of e1000/iflib to using SX locks.

This seems to be missing something on the 82574L causing NFS root mounts
to hang.

Reported by: kib

6 years agocxgbe(4): Zero out the memory allocated for the debug dump.
np [Wed, 30 Aug 2017 18:46:38 +0000 (18:46 +0000)]
cxgbe(4): Zero out the memory allocated for the debug dump.
cudbg_collect seems to expect it this way.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoRead max_stack_flags from correct object.
jhb [Wed, 30 Aug 2017 18:22:52 +0000 (18:22 +0000)]
Read max_stack_flags from correct object.

'obj' is not initialized here.

Reviewed by: kib
MFC after: 1 week
Sponsored by: DARPA / AFRL

6 years agoOnly make the if_ix module depend on netmap when netmap is configured.
kib [Wed, 30 Aug 2017 18:19:25 +0000 (18:19 +0000)]
Only make the if_ix module depend on netmap when netmap is configured.

Approved by: erj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobhnd: initialize variable before use
emaste [Wed, 30 Aug 2017 17:39:51 +0000 (17:39 +0000)]
bhnd: initialize variable before use

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoarge: correct bzero sizeof (pointed-to object, not pointer)
emaste [Wed, 30 Aug 2017 17:38:55 +0000 (17:38 +0000)]
arge: correct bzero sizeof (pointed-to object, not pointer)

Reported by: Clang
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoDecode signal information returned by system calls.
jhb [Wed, 30 Aug 2017 15:45:23 +0000 (15:45 +0000)]
Decode signal information returned by system calls.

Specifically, decode the siginfo structure returned by sigtimedwait(),
sigwaitinfo(), and wait6().  While here, also decode the signal number
returned in the second argument to sigwait().

6 years agoTrim stale prototype for ioctlname().
jhb [Wed, 30 Aug 2017 15:32:47 +0000 (15:32 +0000)]
Trim stale prototype for ioctlname().

6 years agoAdd proper support for the md_label into md(4) ioctl compat layer.
sobomax [Wed, 30 Aug 2017 15:07:10 +0000 (15:07 +0000)]
Add proper support for the md_label into md(4) ioctl compat layer.
While I am here, declare struct md_ioctl32 as packed which allows
us to stop playing tricks with sizeof(md_ioctl32)+y as well as
simplifies md_pad handling. Both were necessary because of different
alignment preferences on amd64 vs i386.

MFC after: 4 weeks

6 years agoAdjust interface of swapon_check_swzone() to its actual usage.
kib [Wed, 30 Aug 2017 10:17:00 +0000 (10:17 +0000)]
Adjust interface of swapon_check_swzone() to its actual usage.

The function return value is not used.  Its argument is always
swap_total/PAGE_SIZE, so make it not take any arguments.

Submitted by: ota@j.email.ne.jp
PR: 221356
MFC after: 1 week

6 years agoMake the swap_pager_full variable static.
kib [Wed, 30 Aug 2017 09:44:05 +0000 (09:44 +0000)]
Make the swap_pager_full variable static.

r290920 removed the use of the variable from vm/vm_pageout.c.

Submitted by: ota@j.email.ne.jp
PR: 221356
MFC after: 1 week

6 years agoDon't call kresolv_list() if using netstat on live kernel
bapt [Wed, 30 Aug 2017 07:58:33 +0000 (07:58 +0000)]
Don't call kresolv_list() if using netstat on live kernel

kresolve_list() is calling many kldsym(2). Removing that call on when collecting
stats for the running kernel improves the startup time and CPU usage.

Submitted by: Nikita Kozlov (nikita.kozlov@blade-group.com)
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12151

6 years agoComplete the CloudABI networking refactoring.
ed [Wed, 30 Aug 2017 07:30:06 +0000 (07:30 +0000)]
Complete the CloudABI networking refactoring.

Now that all of the packaged software has been adjusted to either use
Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing
network connections or can have connections injected, there is no longer
need to keep accept() around. It is now a lot easier to write networked
services that are address family independent, dual-stack, testable, etc.

Remove all of the bits related to accept(), but also to
getsockopt(SO_ACCEPTCONN).

6 years agoFollow-up to r323001: if the actually selected CPUTYPE is capable of
dim [Wed, 30 Aug 2017 07:05:29 +0000 (07:05 +0000)]
Follow-up to r323001: if the actually selected CPUTYPE is capable of
SSE2 instructions, we can use them.

Suggested by: jkim
PR: 221733
MFC after: 1 week
X-MFC-With: r323001

6 years agousb: Add external "Intenso Memory" disk UQ_MSC_NO_INQUIRY quirk
emaste [Wed, 30 Aug 2017 01:44:11 +0000 (01:44 +0000)]
usb: Add external "Intenso Memory" disk UQ_MSC_NO_INQUIRY quirk

PR: 221852
Submitted by: Fabian Keil
Reviewed by: hselasky
Obtained from: ElectroBSD
MFC after: 1 week

6 years agohv_vss.4: Fix spelling of 'responsibility'
emaste [Wed, 30 Aug 2017 01:37:58 +0000 (01:37 +0000)]
hv_vss.4: Fix spelling of 'responsibility'

PR: 221300
Submitted by: Fabian Keil
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoContinuation of lock cleanup in e1000.
sbruno [Wed, 30 Aug 2017 00:20:43 +0000 (00:20 +0000)]
Continuation of lock cleanup in e1000.

Post-cold sleep instead of DELAY when waiting for firmware.

Convert softc mutex to an SX lock.  Change all waits to sleeps
once interrupts are enabled (and it is safe to sleep).

Submitted by: Matt Macy <matt@mattmacy.io>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12101

6 years agoAllow execution of FreeBSD/mips shared objects.
jhb [Wed, 30 Aug 2017 00:14:36 +0000 (00:14 +0000)]
Allow execution of FreeBSD/mips shared objects.

This was applied to all other FreeBSD architectures in r169846 but wasn't
included in the intial MIPS import.

Sponsored by: DARPA / AFRL

6 years agocxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0.
np [Tue, 29 Aug 2017 23:37:26 +0000 (23:37 +0000)]
cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0.

These firmwares come from a pre-release snapshot.  The final firmwares
in this Chelsio release cycle will likely be .61.0 or later and those
will be the next "long lived" firmwares in FreeBSD head and stable
branches.  .59 is being provided in head (only) for wider test exposure.

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

6 years agolib/msun: add more csqrt unit tests for precision and overflow
rlibby [Tue, 29 Aug 2017 22:37:24 +0000 (22:37 +0000)]
lib/msun: add more csqrt unit tests for precision and overflow

Reviewed by: bde
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon

6 years agolib/msun: avoid referring to broken LDBL_MAX
rlibby [Tue, 29 Aug 2017 22:32:29 +0000 (22:32 +0000)]
lib/msun: avoid referring to broken LDBL_MAX

LDBL_MAX is broken on i386:
https://lists.freebsd.org/pipermail/freebsd-numerics/2012-September/000288.html

Gcc has produced +Infinity for LDBL_MAX on i386 and amd64 with -m32
for some time, and newer versions of gcc are now warning that the
"floating constant exceeds range of 'long double'".  Avoid this by
referring to proxy values instead.

Reviewed by: bde
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon

6 years agozfs: do not advertise edonr which is not yet supported
emaste [Tue, 29 Aug 2017 22:24:22 +0000 (22:24 +0000)]
zfs: do not advertise edonr which is not yet supported

illumos 4185 ("add new cryptographic checksums to ZFS: SHA-512,
Skein, Edon-R") was intentionally merged only partially in r289422,
without adding support for skein, sha512 and edonr on FreeBSD.

Support for skein and sha512 was added later on, but edonr is still not
implemented in FreeBSD.

Prior to this commit zfs(8) correctly rejected edonr, but with an error
message that claimed support:

fk@r500 ~ $zfs set checksum=edonr tank
cannot set property for 'tank': 'checksum' must be one of 'on | off | fletcher2 | fletcher4 | sha256 | sha512 | skein | edonr'

PR: 204055
Submitted by: Fabian Keil
Approved by: allanjude
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoIn compiler-rt, a few assembler implementations for i386 floating point
dim [Tue, 29 Aug 2017 21:45:00 +0000 (21:45 +0000)]
In compiler-rt, a few assembler implementations for i386 floating point
conversion functions use SSE2 instructions, but these are not guarded by
#ifdef __SSE2__, and there is no implementation using general purpose
registers.  For these functions, use the generic C variants instead,
otherwise they will cause SIGILL on older processors.

Reported by: bsdpr@phoe.frmug.org
PR: 221733
MFC after: 1 week

6 years agoAdd missing test for NVME CCBs for nvme passthru support.
imp [Tue, 29 Aug 2017 21:04:29 +0000 (21:04 +0000)]
Add missing test for NVME CCBs for nvme passthru support.

Submitted by: Chuck Tuffli

6 years agoFix NVMe's use of XPT_GDEV_TYPE
imp [Tue, 29 Aug 2017 17:03:30 +0000 (17:03 +0000)]
Fix NVMe's use of XPT_GDEV_TYPE

This patch changes the way XPT_GDEV_TYPE works for NVMe. The current
ccb_getdev structure includes pointers to the NVMe Identify Controller
and Namespace structures, but these are kernel virtual addresses which
are not accessible from user space.

As an alternative, the patch changes the pointers into padding in
ccb_getdev and adds two new types to ccb_dev_advinfo to retrieve the
Identify Controller (CDAI_TYPE_NVME_CNTRL) and Namespace
(CDAI_TYPE_NVME_NS) data structures.

Reviewed By: rpokala, imp
Differential Revision: https://reviews.freebsd.org/D10466
Submitted by: Chuck Tuffli

6 years agoFix a few overlooked spots where the coded uses 16-bit NSIDs. Chuck
imp [Tue, 29 Aug 2017 15:46:34 +0000 (15:46 +0000)]
Fix a few overlooked spots where the coded uses 16-bit NSIDs. Chuck
Tuffli had submitted a more thorough patch that I was unaware of when
I did my work and this brings in the bits I missed from that patch.

PR: 220267
Submitted by: Chuck Tuffli

6 years agoAdd CAM/NVMe support for CAM_DATA_SG
imp [Tue, 29 Aug 2017 15:29:57 +0000 (15:29 +0000)]
Add CAM/NVMe support for CAM_DATA_SG

This adds support in pass(4) for data to be described with a
scatter-gather list (sglist) to augment the existing (single) virtual
address.

Differential Revision: https://reviews.freebsd.org/D11361
Submitted by: Chuck Tuffli
Reviewed by: imp@, scottl@, kenm@

6 years agoAdd new compile-time option NVME_USE_NVD that sets the default value
imp [Mon, 28 Aug 2017 23:54:25 +0000 (23:54 +0000)]
Add new compile-time option NVME_USE_NVD that sets the default value
of the runtime hw.nvme.use_vnd tunable. We still default to nvd unless
otherwise requested.

Sponsored by: Netflix

6 years agoSet the max transactions for NVMe drives better.
imp [Mon, 28 Aug 2017 23:54:20 +0000 (23:54 +0000)]
Set the max transactions for NVMe drives better.

Provided a better estimate for the number of transactions that can be
pending at one time. This will be number of queues * number of
trackers / 4, as suggested by Jim Harris. This gives a better estimate
of the number of transactions that CAM should queue before applying
back pressure. This should be revisted when we have real multi-queue
support in CAM and the upper layers of the I/O stack.

Sponsored by: Netflix

6 years agoAdd nvme_sim.c since that's not runtime switchable.
imp [Mon, 28 Aug 2017 23:54:16 +0000 (23:54 +0000)]
Add nvme_sim.c since that's not runtime switchable.

Sponsored by: Netflix

6 years agoPrint the controller's ID in identify.
imp [Mon, 28 Aug 2017 23:54:08 +0000 (23:54 +0000)]
Print the controller's ID in identify.

Submitted by: Matt Williams
Sponsored by: Netflix

6 years agoFix a day-one typo in tty.4 - the sysctls in question are "tty", not "tk"
rpokala [Mon, 28 Aug 2017 23:30:11 +0000 (23:30 +0000)]
Fix a day-one typo in tty.4 - the sysctls in question are "tty", not "tk"

Sponsored by: Panasas, Inc.

6 years agocxgbe(4): Do not access the mailbox without appropriate locks while
np [Mon, 28 Aug 2017 22:41:15 +0000 (22:41 +0000)]
cxgbe(4): Do not access the mailbox without appropriate locks while
creating hardware VIs.

This fixes a bad race on systems with hw.cxgbe.num_vis > 1.

Reported by: olivier@
MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoDrop CACHE_LINE_SIZE to 64 bytes on x86
cem [Mon, 28 Aug 2017 22:28:41 +0000 (22:28 +0000)]
Drop CACHE_LINE_SIZE to 64 bytes on x86

The actual cache line size has always been 64 bytes.

The 128 number arose as an optimization for Core 2 era Intel processors.  By
default (configurable in BIOS), these CPUs would prefetch adjacent cache
lines unintelligently.  Newer CPUs prefetch more intelligently.

The latest Core 2 era CPU was introduced in September 2008 (Xeon 7400
series, "Dunnington").  If you are still using one of these CPUs, especially
in a multi-socket configuration, consider locating the "adjacent cache line
prefetch" option in BIOS and disabling it.

Reported by: mjg
Reviewed by: np
Discussed with: jhb
Sponsored by: Dell EMC Isilon

6 years agortwn(4): some initial preparations for (basic) VHT support.
avos [Mon, 28 Aug 2017 22:14:16 +0000 (22:14 +0000)]
rtwn(4): some initial preparations for (basic) VHT support.

Rename RTWN_RIDX_MCS to RTWN_RIDX_HT_MCS before adding 802.11ac
MCS rate indexes (they have different offset).

No functional change intended.

6 years agoSynchronize page laundering with pmap_extract_and_hold().
markj [Mon, 28 Aug 2017 22:10:15 +0000 (22:10 +0000)]
Synchronize page laundering with pmap_extract_and_hold().

Before r207410, the hold count of a page in a page queue was protected
by the queue lock, and, before laundering a page, the page daemon
removed managed writeable mappings of the page before releasing the
queue lock. This ensured that other threads could not concurrently
create transient writeable mappings using pmap_extract_and_hold() on a
user map, as is done for example by vmapbuf(). With that revision,
however, a race can allow the creation of such a mapping, meaning that
the page might be modified as it is being laundered, potentially
resulting in it being marked clean when its contents do not match
those given to the pager. Close the race by using the page lock to
synchronize the hold count check in vm_pageout_cluster() with the
removal of writeable managed mappings.

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

6 years agoDon't set any WOL enabling hardware bits if WOL isn't requested
marius [Mon, 28 Aug 2017 22:09:12 +0000 (22:09 +0000)]
Don't set any WOL enabling hardware bits if WOL isn't requested
according to the enabled interface capability bits. Also remove
some dead code, which tried to preserve already set contents of
E1000_WUC while that register is completely overwritten shortly
after in all cases.

6 years agocxgbe(4): Maintain one ifmedia per physical port instead of one per
np [Mon, 28 Aug 2017 21:44:25 +0000 (21:44 +0000)]
cxgbe(4): Maintain one ifmedia per physical port instead of one per
Virtual Interface (VI).  All autonomous VIs that share a port share the
same media.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoStyle.
kib [Mon, 28 Aug 2017 21:04:56 +0000 (21:04 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoVerify that the BPB media descriptor and FAT ID match.
kib [Mon, 28 Aug 2017 20:52:32 +0000 (20:52 +0000)]
Verify that the BPB media descriptor and FAT ID match.

FAT specification requires that for valid FAT, FAT cluster 0 has a
specific value derived from the BPB media descriptor.  The lowest
(little-endian) byte must be equal to bpb.bpbMedia, other bits in the
cluster number must be all 1's.  Implement the check to reduce the
chance of the randomly corrupted FAT to pass the mount attempt.

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D12124

6 years agoMask doorbells while processing them.
mav [Mon, 28 Aug 2017 20:00:21 +0000 (20:00 +0000)]
Mask doorbells while processing them.

This fixes interrupt storms on hardware using legacy level-triggered
interrupts, since doorbell processing could take time after interrupt
handler completion, that triggered extra interrupts in a loop.

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

6 years agoFix fake interrupt when set doorbell is unmasked.
mav [Mon, 28 Aug 2017 19:52:57 +0000 (19:52 +0000)]
Fix fake interrupt when set doorbell is unmasked.

Since the doorbell bit is already set when interrupt handler is called,
the event was not propagated to upper layer.  It was working normally
because present code was not using masking actively, but that is going
to change.

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

6 years agoAdding personal information about pizzamig as port committer
pizzamig [Mon, 28 Aug 2017 19:34:39 +0000 (19:34 +0000)]
Adding personal information about pizzamig as port committer

Approved by: olivier (mentor)
Approved by: lme (mentor)
Differential Revision: https://reviews.freebsd.org/D12145

6 years agoAllow vdrop() of a vnode not yet on the per-mount list after r306512.
bdrewery [Mon, 28 Aug 2017 19:29:51 +0000 (19:29 +0000)]
Allow vdrop() of a vnode not yet on the per-mount list after r306512.

The old code allowed calling vdrop() before insmntque() to place the vnode back
onto the freelist for later recycling.  Some downstream consumers may rely on
this support.  Normally insmntque() failing is fine since is uses vgone() and
immediately frees the vnode rather than attempting to add it to the freelist if
vdrop() were used instead.

Also assert that vhold() cannot be used on such a vnode.

Reviewed by: kib, cem, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12126

6 years agoAdd comment about where we need to place this routine, and why.
imp [Mon, 28 Aug 2017 19:27:33 +0000 (19:27 +0000)]
Add comment about where we need to place this routine, and why.

Sponsored by: Netflix

6 years agoAdd comment about where we need to place this routine, and why.
imp [Mon, 28 Aug 2017 19:25:49 +0000 (19:25 +0000)]
Add comment about where we need to place this routine, and why.

Sponsored by: Netflix

6 years agoUpdate a couple vm_object lock assertions in the swap pager to reflect the
alc [Mon, 28 Aug 2017 17:02:25 +0000 (17:02 +0000)]
Update a couple vm_object lock assertions in the swap pager to reflect the
new use of the vm_object's lock to synchronize updates to a radix trie
mapping per-vm object page indices to on-disk swap blocks.

Fix a typo in a nearby comment.

Reviewed by: kib, markj
X-MFC with: r322913
Differential Revision: https://reviews.freebsd.org/D12134

6 years agoSwitching from a global hash table to per-vm_object radix tries for mapping
alc [Mon, 28 Aug 2017 16:55:43 +0000 (16:55 +0000)]
Switching from a global hash table to per-vm_object radix tries for mapping
vm_object page indices to on-disk swap space (r322913) has changed the
synchronization requirements for a couple swap pager functions.  Whereas
before a read lock on the vm object sufficed because of the global mutex
on the hash table, a write lock on the vm object may now be required.  In
particular, calls to vm_pager_page_unswapped() now require a write lock on
the vm_object.  Consequently, vm_fault()'s fast path cannot call
vm_pager_page_unswapped().  The swap space will have to be released at a
later point.

Reviewed by: kib, markj
X-MFC with: r322913
Differential Revision: https://reviews.freebsd.org/D12134

6 years agoAdd ability to label md(4) devices.
sobomax [Mon, 28 Aug 2017 15:54:07 +0000 (15:54 +0000)]
Add ability to label md(4) devices.

This feature comes from the fact that we rely memory-backed md(4)
in our build process heavily. However, if the build goes haywire
the allocated resources (i.e. swap and memory-backed md(4)'s) need
to be purged. It is extremely useful to have ability to attach
arbitrary labels to each of the virtual disks so that they can
be identified and GC'ed if neecessary.

MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D10457

6 years agoIncrease the Amazon EC2 AMI image size from 2GB to 3GB to prevent
gjb [Mon, 28 Aug 2017 14:49:26 +0000 (14:49 +0000)]
Increase the Amazon EC2 AMI image size from 2GB to 3GB to prevent
image build failures due to a full md(4)-backed filesystem.

Sponsored by: The FreeBSD Foundation

6 years agoFix blackhole detection.
tuexen [Mon, 28 Aug 2017 11:41:18 +0000 (11:41 +0000)]
Fix blackhole detection.

There were two bugs related to the blackhole detection:
* The smalles size was tried more than two times.
* The restored MSS was not the original one, but the second
  candidate.

MFC after: 1 week
Sponsored by: Netflix, Inc.

6 years agoMake _Static_assert() work with GCC in older C++ standards.
ed [Mon, 28 Aug 2017 09:35:17 +0000 (09:35 +0000)]
Make _Static_assert() work with GCC in older C++ standards.

GCC only activates C11 keywords in C mode, not C++ mode. This means
that when targeting an older C++ standard, we cannot fall back to using
_Static_assert(). In this case, do define _Static_assert() as a macro
that uses a typedef'ed array.

Discussed in: r322875 commit thread
Reported by: Mark MIllard
MFC after: 1 month

6 years agocxgbe(4): vi_mac_funcs should include the base Ethernet function. It is
np [Mon, 28 Aug 2017 07:50:54 +0000 (07:50 +0000)]
cxgbe(4): vi_mac_funcs should include the base Ethernet function.  It is
already used in the driver as if it does.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agocxgbe(4): Remove write only variable from t4_port_init.
np [Mon, 28 Aug 2017 04:06:40 +0000 (04:06 +0000)]
cxgbe(4): Remove write only variable from t4_port_init.

MFC after: 3 days

6 years agocxgbe(4): Fix some assertions during driver detach. The netmap queues
np [Mon, 28 Aug 2017 03:25:41 +0000 (03:25 +0000)]
cxgbe(4): Fix some assertions during driver detach.  The netmap queues
can't be initialized if the VI isn't.

MFC after: 3 days

6 years agocxgbe(4): Verify that the driver accesses the firmware mailbox in a
np [Mon, 28 Aug 2017 03:13:16 +0000 (03:13 +0000)]
cxgbe(4): Verify that the driver accesses the firmware mailbox in a
thread-safe manner.

MFC after: 3 days

6 years agoDecode extra signal information for caught signals.
jhb [Mon, 28 Aug 2017 02:42:20 +0000 (02:42 +0000)]
Decode extra signal information for caught signals.

Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a
signal is caught by a traced process.  This includes the signal code
(si_code) as well as additional members such as si_addr, si_pid, etc.

6 years agonet80211: fix a typo (premable -> preamble).
avos [Sun, 27 Aug 2017 22:13:03 +0000 (22:13 +0000)]
net80211: fix a typo (premable -> preamble).

6 years agoEnhance debugibility of sysctl leaf re-use warnings
cem [Sun, 27 Aug 2017 17:12:30 +0000 (17:12 +0000)]
Enhance debugibility of sysctl leaf re-use warnings

Print the full conflicting oid path, and include the function name in the
warning so it is clear that the warnings are sysctl-related.

PR: 221853
Submitted by: Fabian Keil <fk AT fabiankeil.de> (earlier version)
Sponsored by: Dell EMC Isilon

6 years agoRevert change (r322952) that was not yet destined for ^/head
ngie [Sun, 27 Aug 2017 17:08:08 +0000 (17:08 +0000)]
Revert change (r322952) that was not yet destined for ^/head

This unbreaks the build.

This happened because of a botched "svn switch".

Reported by: cem

6 years agoTry and rebase the bsd.lib.mk changes after ^/head@r322824 was merged in
ngie [Sun, 27 Aug 2017 16:46:51 +0000 (16:46 +0000)]
Try and rebase the bsd.lib.mk changes after ^/head@r322824 was merged in

Unfortunately the snippet's now broken -- need to get the matching expressions to
work properly.

6 years agoRespect MK_TCSH with build-tools and native-xtools
ngie [Sun, 27 Aug 2017 16:15:37 +0000 (16:15 +0000)]
Respect MK_TCSH with build-tools and native-xtools

This helps reduce the WORLDTMP footprint slightly.

Based on a patch I submitted 5 years ago to GNATS.

PR: 174051
MFC after: 2 weeks
Relnotes: yes (anyone who cross-builds with MK_TCSH=yes will run into
     build failures if the host doesn't have tcsh(1))
Reminded by: Fabian Keil <fk@fabiankeil.de>

6 years agortwn(4): deduplicate r92c_write_txpower().
avos [Sun, 27 Aug 2017 13:02:51 +0000 (13:02 +0000)]
rtwn(4): deduplicate r92c_write_txpower().

6 years agortwn(4): change type for Tx power values (RTL8192C / RTL8188EU).
avos [Sun, 27 Aug 2017 12:44:56 +0000 (12:44 +0000)]
rtwn(4): change type for Tx power values (RTL8192C / RTL8188EU).

Tx power values can easily fit into uint8_t + only 8 bits are written
to registers; values may overflow only in case if ROM contains
malformed data (but limit is checked anyway).

Tested with RTL8188CUS, dev.rtwn.1.debug=0x2000 (no changes).

6 years agoLet g_access() log the actual error number.
kib [Sun, 27 Aug 2017 12:24:25 +0000 (12:24 +0000)]
Let g_access() log the actual error number.

Submitted by:  Fabian Keil <fk@fabiankeil.de>
PR: 221855
MFC after: 1 week

6 years agoAdd PCI Id for MosChip MCS9900.
kib [Sun, 27 Aug 2017 11:37:07 +0000 (11:37 +0000)]
Add PCI Id for MosChip MCS9900.

Submitted by: Robert Clausecker <fuz@fuz.su>
PR: 214670
MFC after: 1 week

6 years agoStart overhauling debug printing in the MPS and MPR drivers. The focus of this
scottl [Sun, 27 Aug 2017 06:24:06 +0000 (06:24 +0000)]
Start overhauling debug printing in the MPS and MPR drivers.  The focus of this
commit it to make initiazation less chatty in the normal case, and more useful
and informative when real debugging is turned on.

Reviewed by: ken (earlier version)
Sponsored by: Netflix

6 years agoImprove scheduler performance
cem [Sun, 27 Aug 2017 05:14:48 +0000 (05:14 +0000)]
Improve scheduler performance

Improve scheduler performance by flattening nonsensical topology layers
(layers with only one child don't serve any purpose).

This is especially relevant on non-AMD Zen systems after r322776.  On my
dual core Intel laptop, this brings the kern.sched.topology_spec table down
from three levels to two.

Submitted by: jeff
Reviewed by: attilio
Sponsored by: Dell EMC Isilon

6 years agoEliminate redunant device path matching.
imp [Sun, 27 Aug 2017 03:10:16 +0000 (03:10 +0000)]
Eliminate redunant device path matching.

Use efi_devpath_match instead of device_paths_match. They are
functionally the same. Remove device_paths_match from boot1.c and call
efi_devpath_match instead.

Sponsored by: Netflix