]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agorelease: arm: Copy boot.scr from ports
manu [Mon, 26 Mar 2018 18:39:38 +0000 (18:39 +0000)]
release: arm: Copy boot.scr from ports

Latest u-boot update need u-boot script to load and start ubldr.
(See D14230 for more details)
Copy this file for our arm release on the fat partition.

Approved by: gjb

6 years agoFix a bug introduced in r329612 that slowly invalidates all clean bufs.
jeff [Mon, 26 Mar 2018 18:36:17 +0000 (18:36 +0000)]
Fix a bug introduced in r329612 that slowly invalidates all clean bufs.

Reported by: bde
Reviewed by: bde
Sponsored by: Netflix, Dell/EMC Isilon

6 years agoEscape trailing newlines in a long variable list for consistency.
gjb [Mon, 26 Mar 2018 18:24:16 +0000 (18:24 +0000)]
Escape trailing newlines in a long variable list for consistency.

Submitted by: garga
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoAllow to specify for vm_fault_quick_hold_pages() that nofault mode
kib [Mon, 26 Mar 2018 16:31:12 +0000 (16:31 +0000)]
Allow to specify for vm_fault_quick_hold_pages() that nofault mode
should be honored.

We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is
specified.  On the other hand, there were some callers in the tree
which set TDP_NOFAULTING for larger scope than needed, I fixed the
code which I wrote, but I suspect that linuxkpi and out of tree drm
drivers might abuse this still.

So only enable the mode for vm_fault_quick_hold_pages() where
vm_fault_hold() is not called when specifically asked by user.  I
decided to use vm_prot_t flag to not change KPI.  Since number of
flags in vm_prot_t is limited, I reused the same flag which was
already consumed for vm_map_lookup().

Reported and tested by: pho (as part of the larger patch)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14825

6 years agoaw_sid(4): Release resources and destroy mutex on failure
kevans [Mon, 26 Mar 2018 14:03:39 +0000 (14:03 +0000)]
aw_sid(4): Release resources and destroy mutex on failure

Submitted by: Eugene Sevastyanov <eval@iptk.ru>

6 years agoloader efifb: implement uga_autoresize as a call to text_autoresize
kevans [Mon, 26 Mar 2018 13:45:17 +0000 (13:45 +0000)]
loader efifb: implement uga_autoresize as a call to text_autoresize

UGA does not have the same kind of mode enumeration that GOP does. Implement
it instead as a call to text_autoresize so that firmwares with only UGA
present still get some kind of autoresizing behavior.

While here, rename a typo'd "gop" to "uga", although it will remain unused
for the time being.

6 years agopf: reload and resync do the same thing
kp [Mon, 26 Mar 2018 09:36:22 +0000 (09:36 +0000)]
pf: reload and resync do the same thing

The reload and resync commands for the startup script do exactly the same
thing, so implement one as a call to the other.

MFC after: 3 weeks

6 years agoClamp IFLIB_RX_COPY_THRESH to MHLEN in iflib_rxd_pkt_get().
markj [Sun, 25 Mar 2018 23:23:19 +0000 (23:23 +0000)]
Clamp IFLIB_RX_COPY_THRESH to MHLEN in iflib_rxd_pkt_get().

If one has added fields to struct mbuf such that MHLEN is smaller than
this threshold (128), iflib_rxd_pkt_get() may otherwise overrun the
internal mbuf buffer while copying.

Reviewed by: mmacy
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14843

6 years agoAdd an entry dealing with the makefs ISO9660 EFI tagging changes.
benno [Sun, 25 Mar 2018 21:07:59 +0000 (21:07 +0000)]
Add an entry dealing with the makefs ISO9660 EFI tagging changes.

If you're building -CURRENT releases and it fails when building ISO images on
amd64 you'll need to update makefs.

Reported by: dch
Sponsored by: iXsystems, Inc.

6 years agoUse LIST_FOREACH_SAFE in sleepq_chains_remove_matching().
markj [Sun, 25 Mar 2018 20:12:14 +0000 (20:12 +0000)]
Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching().

We may remove a sleepqueue from the hash table in
sleepq_resume_thread().

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14847

6 years agoNote that MODULE_PNP_INFO has to come after a DRIVER_MODULE.
imp [Sun, 25 Mar 2018 17:12:09 +0000 (17:12 +0000)]
Note that MODULE_PNP_INFO has to come after a DRIVER_MODULE.

6 years ago[pci-vendors] Update to 2018-03-21
eadler [Sun, 25 Mar 2018 16:57:21 +0000 (16:57 +0000)]
[pci-vendors] Update to 2018-03-21

MFC After: 3 days

6 years agoThe PNP info has to follow the module definition. Move it from just
imp [Sun, 25 Mar 2018 16:56:49 +0000 (16:56 +0000)]
The PNP info has to follow the module definition. Move it from just
after the array to its proper location. Otherwise, the linker.hints
file has things out of order and we associated it with whatever was
the previous module.

6 years agoRemove redundant prototype to fix compilation with GCC.
hselasky [Sun, 25 Mar 2018 08:55:53 +0000 (08:55 +0000)]
Remove redundant prototype to fix compilation with GCC.

Reported by: jeff@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd missing file from 4331508
jeff [Sun, 25 Mar 2018 07:42:44 +0000 (07:42 +0000)]
Add missing file from 4331508

Document cpuset_{get,set}domain()

6 years agoUpdate a TBD string with a real model number
scottl [Sun, 25 Mar 2018 06:08:18 +0000 (06:08 +0000)]
Update a TBD string with a real model number

Submitted by: Sam Gwydir

6 years agoAdd VMCI (Virtual Machine Communication Interface) driver
mp [Sun, 25 Mar 2018 00:57:00 +0000 (00:57 +0000)]
Add VMCI (Virtual Machine Communication Interface) driver

In a virtual machine, VMCI is exposed as a regular PCI device. The primary
communication mechanisms supported are a point-to-point bidirectional
transport based on a pair of memory-mapped queues, and asynchronous
notifications in the form of datagrams and doorbells. These features are
available to kernel level components such as vSockets through the VMCI
kernel API. In addition to this, the VMCI kernel API provides support for
receiving events related to the state of the VMCI communication channels,
and the virtual machine itself.

Submitted by: Vishnu Dasa <vdasa@vmware.com>
Reviewed by: bcr, imp
Obtained from: VMware
Differential Revision: https://reviews.freebsd.org/D14289

6 years agoDocument new NUMA related syscalls and utility options.
jeff [Sat, 24 Mar 2018 23:58:44 +0000 (23:58 +0000)]
Document new NUMA related syscalls and utility options.

Sponsored by: Netflix, Dell/EMC Isilon

6 years agoAdd dtb overlays support
manu [Sat, 24 Mar 2018 21:30:24 +0000 (21:30 +0000)]
Add dtb overlays support

DTB Overlays are useful to change/add nodes to a dtb without the need to
modify it.
Add support for building dtbo during buildkernel.
The goal of DTBO present in the FreeBSD source tree is to fill a gap in
time when we submit changes upstream (Linux). Instead of waiting 2 to 4 months
we can add a DTBO in tree in the meantime.
This is not for adding DTBO for capes/hat/addon boards, those will be
better to put in a ports.
This is also not for enabling a i2c/spi/pwm controller on certain pins,
each user have a different use case for those (which pins to use etc ...)
and we cannot have all possible configuration.

Add a dtbo for sun8i-h3-sid which add the SID node missing in upstream dts.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D14782

6 years agoWhen freeing a superblock returned by ffs_sbget, be sure to also
mckusick [Sat, 24 Mar 2018 15:36:25 +0000 (15:36 +0000)]
When freeing a superblock returned by ffs_sbget, be sure to also
free the superblock summary information.

Reported by: Peter Holm (pho@)
Tested by: Peter Holm (pho@)

6 years agoAccount the size of the vslock-ed memory by the thread.
kib [Sat, 24 Mar 2018 13:51:27 +0000 (13:51 +0000)]
Account the size of the vslock-ed memory by the thread.
Assert that all such memory is unwired on return to usermode.

The count of the wired memory will be used to detect the copyout mode.

Tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFor vm_zone_stats() sysctl handler, do not drain sbuf calling
kib [Sat, 24 Mar 2018 13:48:53 +0000 (13:48 +0000)]
For vm_zone_stats() sysctl handler, do not drain sbuf calling
copyout(9) while owning zone lock.

Despite old value sysctl buffer is wired, spurious faults might still
occur.

Note that we still own the uma_rwlock there, but this lock does not
participate in sensitive lock orders.

Reported and tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoThis change adds a flag to the DAD entry to indicate whether it is
jtl [Sat, 24 Mar 2018 13:18:09 +0000 (13:18 +0000)]
This change adds a flag to the DAD entry to indicate whether it is
currently on the queue. This prevents accidentally doubly-removing a DAD
entry from the queue, while also simplifying some of the logic in
nd6_dad_stop().

Reviewed by: ae, hrs, vangyzen
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D10943

6 years agoIn vn_io_fault1(), reduce the scope where pagefaults are disabled.
kib [Sat, 24 Mar 2018 13:13:52 +0000 (13:13 +0000)]
In vn_io_fault1(), reduce the scope where pagefaults are disabled.

Most important for the future use, do not call
vm_fault_quick_hold_pages() with disabled pagefaults.

Reported and tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoImprove the lcall $7,$0 syscall emulation on amd64.
kib [Sat, 24 Mar 2018 12:57:58 +0000 (12:57 +0000)]
Improve the lcall $7,$0 syscall emulation on amd64.

Current code, which copies the potential syscall arguments into the
current frame, puts an arbitrary limit on the number of syscall
arguments.  Apparently, mmap(2) and lseek(2) (?) require larger
number.  But there is an issue that stack is only need to be mapped to
contain the number of arguments required by the syscall, so copying
arbitrary large number of words from the stack is not completely safe.

Use different approach to convert lcall frame into int $0x80 frame in
place, by doing the retl in kernel.  This also allows to stop proceed
vfork case specially, and stop making assumptions about %cs at the
syscall time.

Also, improve comments with the formulations provided by bde.

Reviewed and tested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoMake the TCP blackbox code committed in r331347 be an optional feature
jtl [Sat, 24 Mar 2018 12:48:10 +0000 (12:48 +0000)]
Make the TCP blackbox code committed in r331347 be an optional feature
controlled by the TCP_BLACKBOX option.

Enable this as part of amd64 GENERIC. For now, leave it disabled on
other platforms.

Sponsored by: Netflix, Inc.

6 years agoRemove some unneccessary variable sets in IPv6 code, as detected by
jtl [Sat, 24 Mar 2018 12:43:34 +0000 (12:43 +0000)]
Remove some unneccessary variable sets in IPv6 code, as detected by
clang's static analyzer.

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D10940

6 years agoFix compilation for platforms that don't support atomic_fetchadd_64()
jtl [Sat, 24 Mar 2018 12:40:45 +0000 (12:40 +0000)]
Fix compilation for platforms that don't support atomic_fetchadd_64()
after r331347.

Reported by: avg, br, jhibbits
Sponsored by: Netflix, Inc.

6 years agoAdded myself to committers-ports.dot.
mfechner [Sat, 24 Mar 2018 09:10:50 +0000 (09:10 +0000)]
Added myself to committers-ports.dot.

Reviewed by: tz (mentor)
Approved by: tz (mentor)
Differential Revision: https://reviews.freebsd.org/40631

6 years agoImport tzdata 2018d
philip [Sat, 24 Mar 2018 04:52:29 +0000 (04:52 +0000)]
Import tzdata 2018d

Changes: https://github.com/eggert/tz/blob/2018d/NEWS

MFC after: 3 days

6 years agoImport tzdata 2018d
philip [Sat, 24 Mar 2018 04:41:49 +0000 (04:41 +0000)]
Import tzdata 2018d

6 years agominor work smithing...
jmg [Sat, 24 Mar 2018 04:21:22 +0000 (04:21 +0000)]
minor work smithing...

6 years agolualoader: Privatize some more config.lua bits
kevans [Sat, 24 Mar 2018 04:03:55 +0000 (04:03 +0000)]
lualoader: Privatize some more config.lua bits

These functions are also not quite suitable for a public API, so privatize
them to config.

6 years agolualoader: Make config env-related bits private API
kevans [Sat, 24 Mar 2018 04:00:01 +0000 (04:00 +0000)]
lualoader: Make config env-related bits private API

This pertains exclusively to the set/restore functionality that we offer,
where any changes made by loader.conf previously will be effectively removed
upon reload of the configuration. We don't currently have a need to export
these, so don't bother.

6 years agoloader consoles: Implement SGR 24, 25
kevans [Sat, 24 Mar 2018 02:01:25 +0000 (02:01 +0000)]
loader consoles: Implement SGR 24, 25

Mostly for completeness sake- implement 24 (no underline) and 25 (no blink)

MFC after: 3 days

6 years agoefi loader: Choose a console mode instead if hw.vga.textmode is set
kevans [Sat, 24 Mar 2018 01:53:43 +0000 (01:53 +0000)]
efi loader: Choose a console mode instead if hw.vga.textmode is set

Not all systems use efifb; pull hw.vga.textmode and choose a good console
mode instead if it's set to something non-zero. This is basically a revival
of the code that used to live in boot1, but instead rebased onto this
different way of doing mode selection in loader.efi.

Interestingly enough, the regression that was previously introduced where
GOP would not reflect the console setting does not seem to exist when
console mode selection is done here. I've not done any investigation as to
why this is the case. Nevertheless, boot1.efi is still not the best place to
do mode selection.

6 years agocxgbe(4): Always initialize requested_speed to a valid value.
np [Sat, 24 Mar 2018 01:07:58 +0000 (01:07 +0000)]
cxgbe(4): Always initialize requested_speed to a valid value.

This fixes an avoidable EINVAL when the user tries to disable AN after
the port is initialized but l1cfg doesn't have a valid speed to use.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoloader.conf(5): Convert list of values to much better looking table format
kevans [Fri, 23 Mar 2018 23:46:59 +0000 (23:46 +0000)]
loader.conf(5): Convert list of values to much better looking  table format

Discussed with: jhb, rpokala

6 years agoloader.conf(5): Document efi_max_resolution
kevans [Fri, 23 Mar 2018 23:02:50 +0000 (23:02 +0000)]
loader.conf(5): Document efi_max_resolution

6 years agoDon't try to modify El Torito section headers if there aren't any.
benno [Fri, 23 Mar 2018 22:59:45 +0000 (22:59 +0000)]
Don't try to modify El Torito section headers if there aren't any.

MFC after: 1 week

6 years agoCorrectly mark the last El Torito section header.
benno [Fri, 23 Mar 2018 22:52:26 +0000 (22:52 +0000)]
Correctly mark the last El Torito section header.

Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: emaste, imp
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14812

6 years agoAdd a workaround to the hypervisor detection for older versions of KVM.
jhb [Fri, 23 Mar 2018 22:36:24 +0000 (22:36 +0000)]
Add a workaround to the hypervisor detection for older versions of KVM.

Originally KVM set %eax to 0 in the cpuid leaf 0x4000000 rather than
to the highest supported leaf in the hypervisor "branch".  Detect this
case and fixup the %eax value so that the hypervisor is still
detected.

Reported by: jpaetzel
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14810

6 years agoefi loader: Respect efi_max_resolution in loader.conf(5)
kevans [Fri, 23 Mar 2018 21:02:46 +0000 (21:02 +0000)]
efi loader: Respect efi_max_resolution in loader.conf(5)

Default the max resolution to 1080p, we'll accept Width x Height
specifications along with the following presets:

- 480p
- 720p
- 1080p
- 2160p or 4k
- 5k

PR: 224825
Differential Revision: https://reviews.freebsd.org/D14801

6 years agoAllow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.
benno [Fri, 23 Mar 2018 20:56:18 +0000 (20:56 +0000)]
Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.

UEFI booting requires an EFI System Partition (ESP). On most storage devices
this will be in a specific partition type. To allow booting from CD/ISO
filesystems, UEFI will look for an ESP in the form of a FAT filesystem image
embedded in the image. Historically FreeBSD has added one of these to its
amd64 ISO images but marked it as simply another i386 boot image. Luckily for
us most UEFI implementations are rather forgiving and work this out for us.

This change adds the ability to mark a boot image as being a UEFI image. It
also modifies our ISO generation to use this marking for the UEFI image we
embed.

Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: emaste, imp
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14809

6 years agoRemove redundant cast from Linuxulator SYSINITs
emaste [Fri, 23 Mar 2018 20:32:54 +0000 (20:32 +0000)]
Remove redundant cast from Linuxulator SYSINITs

6 years agoMove remaining EF_MIPS_* flags to <sys/elf_common.h>.
jhb [Fri, 23 Mar 2018 19:31:52 +0000 (19:31 +0000)]
Move remaining EF_MIPS_* flags to <sys/elf_common.h>.

Reviewed by: brooks
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D14789

6 years agoDon't wait for completions when a mlx5en(4) device is in internal
hselasky [Fri, 23 Mar 2018 18:38:12 +0000 (18:38 +0000)]
Don't wait for completions when a mlx5en(4) device is in internal
error state.

If the device is in internal error state the hardware will not
generate completions. Just move on to destroy the resources.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix incorrect page count when mlx5core is in internal error.
hselasky [Fri, 23 Mar 2018 18:35:59 +0000 (18:35 +0000)]
Fix incorrect page count when mlx5core is in internal error.

Change page cleanup flow when in internal error to properly decrement
the page counts when reclaiming pages. That prevents timing out
waiting for extra pages that were actually cleaned up previously.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRevert r331379 as the "simple" lock changes have revealed a deeper problem
sbruno [Fri, 23 Mar 2018 18:34:38 +0000 (18:34 +0000)]
Revert r331379 as the "simple" lock changes have revealed a deeper problem
and need for a rethink.

Submitted by: Jason Eggleston <jason@eggnet.com>
Sponsored by: Limelight Networks

6 years agoDon't save PCI state when PCI error is detected in mlx5core.
hselasky [Fri, 23 Mar 2018 18:34:35 +0000 (18:34 +0000)]
Don't save PCI state when PCI error is detected in mlx5core.

When a PCI error is detected the PCI state could be corrupt, don't
save it in that flow. Save the state after initialization. After
restoring the PCI state during slot reset save it again, restoring
the state destroys the previously saved state info.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd mutual exclusion mechanism for software reset of firmware in mlx5core.
hselasky [Fri, 23 Mar 2018 18:32:03 +0000 (18:32 +0000)]
Add mutual exclusion mechanism for software reset of firmware in mlx5core.

Since the FW can be shared between PCI functions it is common that
more than one health poll will detected a failure, this can lead to
multiple resets.

The solution is to use a FW locking mechanism using semaphore space to
provide a way to synchronize between functions. The FW semaphore is
acquired via config cycle access. First the VSEC gateway must be
acquired, then the semaphore can be locked by writing a value to it
and confirmed it's locked by reading the same value back. The process
in the same to free the semaphore, except the value written should be
zero.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoIssue a software reset on firmware assert in mlx5core.
hselasky [Fri, 23 Mar 2018 18:24:09 +0000 (18:24 +0000)]
Issue a software reset on firmware assert in mlx5core.

If a FW assert is considered fatal, indicated by a new bit in the
health buffer, reset the FW. After the reset, follow the normal
recovery flow.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix two compliation problems on non-amd64 architectures.
jeff [Fri, 23 Mar 2018 18:24:02 +0000 (18:24 +0000)]
Fix two compliation problems on non-amd64 architectures.

6 years agoHandle software reset of firmware in error flow in mlx5core.
hselasky [Fri, 23 Mar 2018 18:20:42 +0000 (18:20 +0000)]
Handle software reset of firmware in error flow in mlx5core.

Some mlx5 adapter firmware allows the driver to reset the firmware in
the event of an error. When a software reset is issued on any physical
function all PFs enter reset state. This is a recoverable condition.
The existing recovery flow was designed to allow the recovery of a
VF after a PF driver reload. This patch expands the scope of that
flow to recover PFs or VFs after a SW reset has been issued.
When a software reset is issued the following occurs:

1. The NIC interface mode is set to SW_RESET (7) while the reset is in
   progress.
2. Once the reset completes the NIC interface mode is set to NIC
   disabled (1).

After the reset has been issued (added in a subsequent patch) the
health poll for other functions will detect that the NIC interface
state has been set to disabled. This will cause it to enter the
existing recovery flow.  If the PCI is still working (meaning it
doesn't return 0xff on all reads) it means recovery can proceed
immediately instead of waiting 60 seconds.

The error detetion has also been refactored to avoid incorrect or
misleading log messages.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoHide verbose proclamation of error when forced in mlx5core.
hselasky [Fri, 23 Mar 2018 18:11:06 +0000 (18:11 +0000)]
Hide verbose proclamation of error when forced in mlx5core.

When mlx5_enter_error_state() operation is forced by shutdown, the
messages surrounding setting the error state are not informational
and confuse users.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoCancel delayed recovery work when unloading the mlx5core driver.
hselasky [Fri, 23 Mar 2018 18:09:09 +0000 (18:09 +0000)]
Cancel delayed recovery work when unloading the mlx5core driver.

linux commit 2a0165a034ac024b60cca49c61e46f4afa2e4d98

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for fast unload in shutdown flow in mlx5core.
hselasky [Fri, 23 Mar 2018 18:02:20 +0000 (18:02 +0000)]
Add support for fast unload in shutdown flow in mlx5core.

This patch accumulates the following Linux commits:

8812c24d28f4972c4f2b9998bf30b1f2a1b62adf
  net/mlx5: Add fast unload support in shutdown flow
59211bd3b6329c3e5f4a90ac3d7f87ffa7867073
  net/mlx5: Split the load/unload flow into hardware and software flows
4525abeaae54560254a1bb8970b3d4c225d32ef4
  net/mlx5: Expose command polling interface

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoImprove support for health recovery in mlx5core.
hselasky [Fri, 23 Mar 2018 17:33:14 +0000 (17:33 +0000)]
Improve support for health recovery in mlx5core.

This patch accumulates the following Linux commits:

04c0c1ab38e95105d950db5b84e727637e149ce7
  net/mlx5: PCI error recovery health care simulation
0179720d6be2096b8d0a4d143254ff9e77747daa
  net/mlx5: Introduce trigger_health_work function
3fece5d676939f42f434c63dfe1bd42d7d94e6f0
  net/mlx5: Continue health polling until it is explicitly stopped

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFixup return style(9) in amd64 linux*_sysvec.c
emaste [Fri, 23 Mar 2018 17:28:04 +0000 (17:28 +0000)]
Fixup return style(9) in amd64 linux*_sysvec.c

Sponsored by: Turing Robotic Industries Inc.

6 years agoIn __sync_bool_compare_and_swap(), return true if the returned value is the
cognet [Fri, 23 Mar 2018 17:25:19 +0000 (17:25 +0000)]
In __sync_bool_compare_and_swap(), return true if the returned value is the
same as the expected one, not the desired one.

Pointy hat to: cognet
MFC after: 3 days

6 years agoMatch broken style of vidconsole.c
kevans [Fri, 23 Mar 2018 17:22:28 +0000 (17:22 +0000)]
Match broken style of vidconsole.c

This particular function uses a broken mix of indentation styles. Match it
for the newly added SGR 22 bits.

Reported by: jkim
X-MFC-With: r331416

6 years agoSort headers in MD Linuxulator files
emaste [Fri, 23 Mar 2018 17:16:36 +0000 (17:16 +0000)]
Sort headers in MD Linuxulator files

Bring #includes closer to style(9) and reduce differences between the
(three) MD versions of linux_machdep.c and linux_sysvec.c.

Sponsored by: Turing Robotic Industries Inc.

6 years agoExit krping on device removal to avoid endless hang situation.
hselasky [Fri, 23 Mar 2018 17:03:42 +0000 (17:03 +0000)]
Exit krping on device removal to avoid endless hang situation.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoCreate designated workqueue for each mlx5en(4) device instance.
hselasky [Fri, 23 Mar 2018 16:59:51 +0000 (16:59 +0000)]
Create designated workqueue for each mlx5en(4) device instance.

The mlx5e_destroy_ifp() function may be called from the system workqueue and
in this case trying to flush all works will cause a dead lock.
Instead of using the system workqueue, create a designated workqueue
for each mlx5en(4) device instance.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agonetpfil: Introduce PFIL_FWD flag
kp [Fri, 23 Mar 2018 16:56:44 +0000 (16:56 +0000)]
netpfil: Introduce PFIL_FWD flag

Forwarded packets passed through PFIL_OUT, which made it difficult for
firewalls to figure out if they were forwarding or producing packets. This in
turn is an issue for pf for IPv6 fragment handling: it needs to call
ip6_output() or ip6_forward() to handle the fragments. Figuring out which was
difficult (and until now, incorrect).
Having pfil distinguish the two removes an ugly piece of code from pf.

Introduce a new variant of the netpfil callbacks with a flags variable, which
has PFIL_FWD set for forwarded packets. This allows pf to reliably work out if
a packet is forwarded.

Reviewed by: ae, kevans
Differential Revision: https://reviews.freebsd.org/D13715

6 years agoFlag when we have a pending TUR. Don't schedule another one when we
imp [Fri, 23 Mar 2018 16:23:15 +0000 (16:23 +0000)]
Flag when we have a pending TUR. Don't schedule another one when we
have one pending. Otherwise, we can race and send two, which is
wasteful in close proximity. It can also cause the acaquire/release
count for TUR to be > 1, which is undexpected.

PR: 226510
Differential Review: https://reviews.freebsd.org/D14792

6 years agolinuxkpi whitespace cleanup
emaste [Fri, 23 Mar 2018 15:50:01 +0000 (15:50 +0000)]
linuxkpi whitespace cleanup

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

6 years agoThere is no need to disable interrupts around npxsave call.
kib [Fri, 23 Mar 2018 15:46:53 +0000 (15:46 +0000)]
There is no need to disable interrupts around npxsave call.

i386 was changed to only require critical section around the thread
FPU state manipulations, and vm86_bioscall callers already enter
critical section for other reasons.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoUpdate comment to match current field names.
kib [Fri, 23 Mar 2018 15:44:31 +0000 (15:44 +0000)]
Update comment to match current field names.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoConvert the PCI ID selection from a simple if into a table.
imp [Fri, 23 Mar 2018 15:35:19 +0000 (15:35 +0000)]
Convert the PCI ID selection from a simple if into a table.
Mark the table with PNP info.
Fix compilation by returning FILTER_STRAY in two places, as suggested by comments.
Create a simple module from this. Left unconnected because I can't test it as a module.

6 years agoAdd PNP info to xl as an example.
imp [Fri, 23 Mar 2018 15:35:15 +0000 (15:35 +0000)]
Add PNP info to xl as an example.

6 years agokill traling white space
imp [Fri, 23 Mar 2018 15:35:07 +0000 (15:35 +0000)]
kill traling white space

6 years agoRationalize license text on Linuxolator files
emaste [Fri, 23 Mar 2018 14:39:34 +0000 (14:39 +0000)]
Rationalize license text on Linuxolator files

Many licenses on Linuxolator files contained small variations from the
standard FreeBSD license text.  To avoid license proliferation switch to
the standard 2-Clause FreeBSD license for those files where I have
permission from each of the listed copyright holders.

Approved by: rdivacky, marcel
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoCorrect a couple of assertion messages in vm_page_reclaim_run().
markj [Fri, 23 Mar 2018 14:38:56 +0000 (14:38 +0000)]
Correct a couple of assertion messages in vm_page_reclaim_run().

MFC after: 3 days

6 years agoDisable T10 Protection Information / EEDP handling for type 2 protection.
ken [Fri, 23 Mar 2018 13:52:26 +0000 (13:52 +0000)]
Disable T10 Protection Information / EEDP handling for type 2 protection.

The mps(4) and mpr(4) drivers and hardware handle T10 Protection
Information, which is a system of checksums and guard blocks to protect
data while it is being transferred and while it is on disk.  It is also
known as T10 DIF.  For more details, see section 4.22 of the SBC-4 spec.

Supporting Type 2 protection requires using 32 byte CDBs, and filling in
the fields in those CDBs.  We don't yet support that in the da(4) driver.

Type 1 and Type 3 protection don't require that, and can be handled by
the mps(4)/mpr(4) driver's code and firmware without any additional
input from the da(4) driver.

If a drive has Type 2 protection enabled (you frequently see this with
SAS drives shipped from Dell), don't set the various EEDP fields in the
mps(4)/mpr(4) driver command fields.  Otherwise, you wind up with errors
like this that would otherwise make no sense:

(da9:mpr0:0:18:0): READ(10). CDB: 28 00 00 00 00 00 00 02 00 00
(da9:mpr0:0:18:0): CAM status: SCSI Status Error
(da9:mpr0:0:18:0): SCSI status: Check Condition
(da9:mpr0:0:18:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code)
(da9:mpr0:0:18:0):
(da9:mpr0:0:18:0): Field Replaceable Unit: 0
(da9:mpr0:0:18:0): Command Specific Info: 0
(da9:mpr0:0:18:0):
(da9:mpr0:0:18:0): Descriptor 0x80: f8 21
(da9:mpr0:0:18:0): Descriptor 0x81: 00 00 00 00 00 00
(da9:mpr0:0:18:0): Error 22, Unretryable error

In other words, what kind of strange SAS hard drive doesn't support a
standard 10 byte SCSI READ command?  In this case, one that has Type 2
protection enabled.

We can revisit this when we put Type 2 protection support in the da(4)
driver, but for now this will help people who put Type 2 formatted drives
in a system and wonder what in the world is going on.

MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoIf sc->sc_ep_max is already set use it to find the number of RX and TX
andrew [Fri, 23 Mar 2018 11:08:59 +0000 (11:08 +0000)]
If sc->sc_ep_max is already set use it to find the number of RX and TX
endpoints. The Allwinner driver will need to set this as the EPINFO
register isn't useful there.

Submitted by: jmcneill
Reviewed by: hselasky
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D5881

6 years agozfs: fix mismatch between format specifier and type
avg [Fri, 23 Mar 2018 09:42:47 +0000 (09:42 +0000)]
zfs: fix mismatch between format specifier and type

vdev_dbgmsg_print_tree printed vdev_id of uint64_t type with %u format
specifier.  That caused subsequent parameters to be incorrectly read
from the stack and lead to a crash when a wrong value was interpreted as
a string pointer.

This should be upstreamed.

Reported by: pho
MFC after: 3 days

6 years agoAllow the libusb20_dev_get_port_path() function to be called when the
hselasky [Fri, 23 Mar 2018 09:40:41 +0000 (09:40 +0000)]
Allow the libusb20_dev_get_port_path() function to be called when the
USB device is closed. This fixes a compatibility issue with upstream
libusb.

Found by: romain@
MFC after: 1 week

6 years agocryptocheck: Add support for Blake2{B,S} hashes
cem [Fri, 23 Mar 2018 05:37:18 +0000 (05:37 +0000)]
cryptocheck: Add support for Blake2{B,S} hashes

Since they are not yet present in the version of openssl in base, this will
require installing the ports openssl.

Sponsored by: Dell EMC Isilon

6 years agoBring in JHB's cryptocheck tool
cem [Fri, 23 Mar 2018 04:31:19 +0000 (04:31 +0000)]
Bring in JHB's cryptocheck tool

It can be used to validate basic algorithm correctness on a variety of inputs,
by comarison to openssl.

While here, add some sanity to the crypto/Makefile.

The tool may not be perfect, but getting it in tree where collaboration can
happen is a nice first step.  The pace of development outside of svn seems
to have slowed down mid-2017.

Obtained from: github bsdjhb/freebsd:cryptocheck
Sponsored by: Dell EMC Isilon

6 years agoLoader consoles: Implement SGR 22, reset intensity
kevans [Fri, 23 Mar 2018 03:48:45 +0000 (03:48 +0000)]
Loader consoles: Implement SGR 22, reset intensity

MFC after: 3 days

6 years agoFix build on i386 without INVARIANTS following r331369.
cy [Fri, 23 Mar 2018 03:22:30 +0000 (03:22 +0000)]
Fix build on i386 without INVARIANTS following r331369.

--- vm_reserv.o ---
In file included from /opt/src/svn-current/sys/vm/vm_reserv.c:48:
In file included from /opt/src/svn-current/sys/sys/counter.h:37:
./machine/counter.h:174:3: error: implicit declaration of function
'critical_enter' is invalid in C99 [-Werror,-Wimplicit-function-declarat
ion]
                critical_enter();

Reviewed by: jeff@

6 years agoReduce struct aggsum_bucket padding to fit into one cache line.
mav [Fri, 23 Mar 2018 02:50:38 +0000 (02:50 +0000)]
Reduce struct aggsum_bucket padding to fit into one cache line.

Reported by: mjg

6 years agoefidev: Drop a quick note in about efi_cfgtbl/efi_runtime
kevans [Fri, 23 Mar 2018 02:45:09 +0000 (02:45 +0000)]
efidev: Drop a quick note in about efi_cfgtbl/efi_runtime

There's no real annotation for it, so it's not immediately obvious to the
unfamiliar that these pointers are to locations in the EFI runtime map
unlike the system table pointer immediately above them.

6 years agoMFV r331407: 9213 zfs: sytem typo
mav [Fri, 23 Mar 2018 02:30:29 +0000 (02:30 +0000)]
MFV r331407: 9213 zfs: sytem typo

illumos/illumos-gate@edc8ef7d921c96b23969898aeb766cb24960bda7

Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author: Toomas Soome <tsoome@me.com>

6 years agoMFV r331405: 9084 spa_*_ashift must ignore spare devices
mav [Fri, 23 Mar 2018 02:24:52 +0000 (02:24 +0000)]
MFV r331405: 9084 spa_*_ashift must ignore spare devices

illumos/illumos-gate@b037f3dbd69cef4a7ffd576ad33e07bfaf0b1e84

Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

6 years agoMFV r331400: 8484 Implement aggregate sum and use for arc counters
mav [Fri, 23 Mar 2018 02:15:05 +0000 (02:15 +0000)]
MFV r331400: 8484 Implement aggregate sum and use for arc counters

In pursuit of improving performance on multi-core systems, we should
implements fanned out counters and use them to improve the performance of
some of the arc statistics. These stats are updated extremely frequently,
and can consume a significant amount of CPU time.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

6 years agoDebug interrupts aren't instruction traps
jhibbits [Fri, 23 Mar 2018 00:40:08 +0000 (00:40 +0000)]
Debug interrupts aren't instruction traps

The EXC_DEBUG type is akin to the MPC74xx "Instruction Breakpoint" trap.
Don't treat it as a trap instruction.

6 years ago8484 Implement aggregate sum and use for arc counters
mav [Fri, 23 Mar 2018 00:20:42 +0000 (00:20 +0000)]
8484 Implement aggregate sum and use for arc counters

In pursuit of improving performance on multi-core systems, we should
implements fanned out counters and use them to improve the performance of
some of the arc statistics. These stats are updated extremely frequently,
and can consume a significant amount of CPU time.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

6 years agoRefactor ip6_getpcbopt() for better locking and memory management
sbruno [Thu, 22 Mar 2018 23:34:48 +0000 (23:34 +0000)]
Refactor ip6_getpcbopt() for better locking and memory management

Created GET_PKTOPT_EXT_HDR() and GET_PKTOPT_SOCKADDR() macros to
handle safely fetching options from in6p_outputopts, including
properly dealing with in6p locking and preparing memory for
sooptcopyout().

Changed the function signature of ip6_getpcbopt() to allow the
function to acquire and release locks on in6p as needed.

Submitted by: Jason Eggleston <jason@eggnet.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14619

6 years agoSimple locking fixes in ip_ctloutput, ip6_ctloutput, rip_ctloutput.
sbruno [Thu, 22 Mar 2018 22:29:32 +0000 (22:29 +0000)]
Simple locking fixes in ip_ctloutput, ip6_ctloutput, rip_ctloutput.

Submitted by: Jason Eggleston <jason@eggnet.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14624

6 years agoAdd missing NULL checks when calling malloc(M_NOWAIT) in
landonf [Thu, 22 Mar 2018 22:13:46 +0000 (22:13 +0000)]
Add missing NULL checks when calling malloc(M_NOWAIT) in
bhnd_nv_strdup/bhnd_nv_strndup.

If malloc(9) failed during initial bhnd(4) attach, while allocating the root
NVRAM path string ("/"), the returned NULL pointer would be passed as the
destination to memcpy().

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>

6 years agoHandle locking and memory safety for IPV6_PATHMTU in ip6_ctloutput().
sbruno [Thu, 22 Mar 2018 21:18:34 +0000 (21:18 +0000)]
Handle locking and memory safety for IPV6_PATHMTU in ip6_ctloutput().

Submitted by: Jason Eggleston <jason@eggnet.com>
Reviewed by: ae
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14622

6 years agoDo not send signals to init directly from shutdown_nice(9), do it from
kib [Thu, 22 Mar 2018 20:47:25 +0000 (20:47 +0000)]
Do not send signals to init directly from shutdown_nice(9), do it from
the task context.

shutdown_nice() is used from the fast interrupt handlers, mostly for
console drivers, where we cannot lock blockable locks.  Schedule the
task in the fast queue to send the signal from the proper context.

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

6 years agoFixes for ptrace(PT_GETXSTATE_INFO) related to the padding in struct
kib [Thu, 22 Mar 2018 20:44:27 +0000 (20:44 +0000)]
Fixes for ptrace(PT_GETXSTATE_INFO) related to the padding in struct
ptrace_xstate_info).

struct ptrace_xstate_info has 64bit member but ends up with 32bit
one. As result, on amd64 there is a 32bit padding at the end, but not
on i386.

We must clear the padding before doing the copyout. For compat32 case,
we must copyout the structure which does not have the padding at the
end.  The later fixes 32bit gdb display of the YMM registers when
running on amd64 kernel.

Reported by: Vlad Tsyrklevich
Reviewed by: brooks (previous version)
Sponsored by: The FreeBSD Foundation
admbugs: 765
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14794

6 years agoImprove write locking in ip6_ctloutput() with macros.
sbruno [Thu, 22 Mar 2018 20:21:05 +0000 (20:21 +0000)]
Improve write locking in ip6_ctloutput() with macros.

Submitted by: Jason Eggleston <jason@eggnet.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14620

6 years agoLock reservations with a dedicated lock in each reservation. Protect the
jeff [Thu, 22 Mar 2018 19:21:11 +0000 (19:21 +0000)]
Lock reservations with a dedicated lock in each reservation.  Protect the
vmd_free_count with atomics.

This allows us to allocate and free from reservations without the free lock
except where a superpage is allocated from the physical layer, which is
roughly 1/512 of the operations on amd64.

Use the counter api to eliminate cache conention on counters.

Reviewed by: markj
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14707

6 years agoStart witness much earlier in boot so that we can shrink the pend list and
jeff [Thu, 22 Mar 2018 19:11:43 +0000 (19:11 +0000)]
Start witness much earlier in boot so that we can shrink the pend list and
make it more immune to further change.

Reviewed by: markj, imp (Part of D14707)
Sponsored by: Netflix, Dell/EMC Isilon

6 years agoUse read_mostly and alignment tags to eliminate or limit false sharing.
jeff [Thu, 22 Mar 2018 19:06:50 +0000 (19:06 +0000)]
Use read_mostly and alignment tags to eliminate or limit false sharing.

Reviewed by: markj (Part of D14707)
Sponsored by: Netflix, Dell/EMC Isilon

6 years agoPull in r327101 from upstream llvm trunk (by Rafael Espindola):
dim [Thu, 22 Mar 2018 18:58:34 +0000 (18:58 +0000)]
Pull in r327101 from upstream llvm trunk (by Rafael Espindola):

  Don't treat .symver as a regular alias definition.

  This patch starts simplifying the handling of .symver.

  For now it just moves the responsibility for creating an alias down to
  the streamer. With that the asm streamer can pass a .symver unchanged,
  which is nice since gas cannot parse "foo@bar = zed".

  In a followup I hope to move the handling down to the writer so that
  we don't need special hacks for avoiding breaking names with @@@ on
  windows.

Pull in r327160 from upstream llvm trunk (by Rafael Espindola):

  Delay creating an alias for @@@.

  With this we only create an alias for @@@ once we know if it should
  use @ or @@. This avoids last minutes renames and hacks to handle MS
  names.

  This only handles the ELF writer. LTO still has issues with @@@
  aliases.

Pull in r327928 from upstream llvm trunk (by Vitaly Buka):

  Object: Move attribute calculation into RecordStreamer. NFC

  Summary: Preparation for D44274

  Reviewers: pcc, espindola

  Subscribers: hiraditya

  Differential Revision: https://reviews.llvm.org/D44276

Pull in r327930 from upstream llvm trunk (by Vitaly Buka):

  Object: Fix handling of @@@ in .symver directive

  Summary:
  name@@@nodename is going to be replaced with name@@nodename if symbols is
  defined in the assembled file, or name@nodename if undefined.
  https://sourceware.org/binutils/docs/as/Symver.html

  Fixes PR36623

  Reviewers: pcc, espindola

  Subscribers: mehdi_amini, hiraditya

  Differential Revision: https://reviews.llvm.org/D44274

Together, these changes fix handling of @@@ in .symver directives when
doing Link Time Optimization.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>
MFC after: 3 months
X-MFC-With: r327952