]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

6 years agoRe-work efidev ordering to fix efirt preloaded by loader on amd64
kevans [Thu, 22 Mar 2018 18:24:00 +0000 (18:24 +0000)]
Re-work efidev ordering to fix efirt preloaded by loader on amd64

On amd64, efi_enter calls fpu_kern_enter(). This may not be called until
fpuinitstate has been invoked, resulting in a kernel panic with
efirt_load="YES" in loader.conf(5).

Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze
efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be
after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at
SI_SUB_DRIVER, SI_ORDER_ANY.

The not immediately obvious dependency of fpuinitstate by efirt has been
noted in both places.

Discussed with: kib, andrew
Reported by: Jakob Alvermark <jakob@alvermark.net>
X-MFC-With: r330868

6 years agoRemove google_accounts_manager from VM_RC_LIST in the GCE configuration
gjb [Thu, 22 Mar 2018 17:49:27 +0000 (17:49 +0000)]
Remove google_accounts_manager from VM_RC_LIST in the GCE configuration
file, no longer needed.

PR: 221714
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoDrop any recursed taking of Giant once and for all at the top of
imp [Thu, 22 Mar 2018 15:34:37 +0000 (15:34 +0000)]
Drop any recursed taking of Giant once and for all at the top of
kern_reboot(). The shutdown path is now safe to run without Giant.

Discussed with: kib@
Sponsored by: Netflix

6 years agoEnter into the EFI environment before dereferencing the runtime services
andrew [Thu, 22 Mar 2018 15:32:57 +0000 (15:32 +0000)]
Enter into the EFI environment before dereferencing the runtime services
pointer. This may be within the EFI address space and not the FreeBSD
kernel address space.

X-MFC-With: r330868
Sponsored by: DARPA, AFRL

6 years agoIncrease the size of the endpoint buffers. They are double buffered so
andrew [Thu, 22 Mar 2018 15:24:26 +0000 (15:24 +0000)]
Increase the size of the endpoint buffers. They are double buffered so
need to be twice the size.

Sponsored by: DARPA, AFRL

6 years agoRevert r331298
imp [Thu, 22 Mar 2018 15:11:53 +0000 (15:11 +0000)]
Revert r331298

Normally, shutdown_nice() just signals init. However, sometimes it
calls kern_reboot directly. For that case, r331298 dropped the Giant
lock before calling it. This turns out to be incorrect for the more
common case where init exists and we just signal it. Restore the old
behavior. The direct call to kern_reboot() doesn't sync buffers to the
disk, so should work with Giant held, so we don't need to drop locks
here for that.

Noticed by: bde@
Sponsored by: Netflix

6 years agotftpd: misc Coverity cleanup in the tests
asomers [Thu, 22 Mar 2018 14:51:05 +0000 (14:51 +0000)]
tftpd: misc Coverity cleanup in the tests

A bunch of unchecked return values from open(2) and read(2)

Reported by: Coverity
CID: 138690013869111386926138692813869321386942
CID: 13869611386979
MFC after: 8 days
X-MFC-With: 330696

6 years agoThe pci_disable_device() function is also expected to clear the PCI
hselasky [Thu, 22 Mar 2018 13:30:35 +0000 (13:30 +0000)]
The pci_disable_device() function is also expected to clear the PCI
busmaster. This fixes LinuxKPI compliancy with Linux.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoShare Linux errno table with libsysdecode
emaste [Thu, 22 Mar 2018 12:58:49 +0000 (12:58 +0000)]
Share Linux errno table with libsysdecode

Requested by: jhb
Reviewed by: jhb
Sponsored by: Turing Robotic Industries Inc.

6 years agoClear old MSIX IRQ numbers in the LinuxKPI.
hselasky [Thu, 22 Mar 2018 12:26:27 +0000 (12:26 +0000)]
Clear old MSIX IRQ numbers in the LinuxKPI.

When disabling the MSIX IRQ vectors for a PCI device through the
LinuxKPI, make sure any old MSIX IRQ numbers are no longer visible to
the linux_pci_find_irq_dev() function else IRQs can be requested from
the wrong PCI device.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoPartially revert r328780
kevans [Thu, 22 Mar 2018 11:57:59 +0000 (11:57 +0000)]
Partially revert r328780

efi.4th was added to ObsoleteFiles and disconnected from the build, but not
removed from hte repo. We've since found a mild use for it that makes some
amount of sense, so partially revert r328780 and bring it back to life.

Reported by: many
X-MFC-With: r331326

6 years agoBump netstat.1's .Dd after r331347.
jtl [Thu, 22 Mar 2018 09:43:15 +0000 (09:43 +0000)]
Bump netstat.1's .Dd after r331347.

6 years agoAdd the "TCP Blackbox Recorder" which we discussed at the developer
jtl [Thu, 22 Mar 2018 09:40:08 +0000 (09:40 +0000)]
Add the "TCP Blackbox Recorder" which we discussed at the developer
summits at BSDCan and BSDCam in 2017.

The TCP Blackbox Recorder allows you to capture events on a TCP connection
in a ring buffer. It stores metadata with the event. It optionally stores
the TCP header associated with an event (if the event is associated with a
packet) and also optionally stores information on the sockets.

It supports setting a log ID on a TCP connection and using this to correlate
multiple connections that share a common log ID.

You can log connections in different modes. If you are doing a coordinated
test with a particular connection, you may tell the system to put it in
mode 4 (continuous dump). Or, if you just want to monitor for errors, you
can put it in mode 1 (ring buffer) and dump all the ring buffers associated
with the connection ID when we receive an error signal for that connection
ID. You can set a default mode that will be applied to a particular ratio
of incoming connections. You can also manually set a mode using a socket
option.

This commit includes only basic probes. rrs@ has added quite an abundance
of probes in his TCP development work. He plans to commit those soon.

There are user-space programs which we plan to commit as ports. These read
the data from the log device and output pcapng files, and then let you
analyze the data (and metadata) in the pcapng files.

Reviewed by: gnn (previous version)
Obtained from: Netflix, Inc.
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11085

6 years agoFix build.
lwhsu [Thu, 22 Mar 2018 08:32:39 +0000 (08:32 +0000)]
Fix build.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D14793

6 years agojedec_dimm: Use correct string length when populating sc->slotid_str
rpokala [Thu, 22 Mar 2018 06:31:05 +0000 (06:31 +0000)]
jedec_dimm: Use correct string length when populating sc->slotid_str

Don't limit the copy to the size of the target string *pointer* (always
4 on 32-bit / 8 on 64-bit). Instead, just use strdup().

Reported by: Coverity
CID: 1386912
Reviewed by: cem, imp
MFC after: 1 week

6 years agoRedo r331328. We need to fix not only type but also format. While
glebius [Thu, 22 Mar 2018 05:26:27 +0000 (05:26 +0000)]
Redo r331328. We need to fix not only type but also format. While
here again notice that we are fixing regression from r331106.

6 years agoFix LINT-NOINET build initializing local to false. This is
glebius [Thu, 22 Mar 2018 05:07:57 +0000 (05:07 +0000)]
Fix LINT-NOINET build initializing local to false. This is
a dead code, since for NOINET build isipv6 is always true,
but this dead code makes it compilable.

Reported by: rpokala

6 years agocxgbe(4): Do not read MFG diags information from custom boards.
np [Thu, 22 Mar 2018 04:42:29 +0000 (04:42 +0000)]
cxgbe(4): Do not read MFG diags information from custom boards.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoforthloader: Don't break BIOS boots...
kevans [Thu, 22 Mar 2018 04:16:14 +0000 (04:16 +0000)]
forthloader: Don't break BIOS boots...

I thought I tested this scenario, but clearly I failed to. =(

BIOS boots won't have efi-autoresizecons, so trying to use it as a forth
word fails during include. Use evaluate on "efi-autoresizecons" as a string
instead to move any potential errors to runtime- safely after we've already
checked that we're booting UEFI.

Pointy hat to: me
Reported by: cy

6 years agocxgbe(4): Tunnel congestion drops on a port should be cleared when the
np [Thu, 22 Mar 2018 02:04:57 +0000 (02:04 +0000)]
cxgbe(4): Tunnel congestion drops on a port should be cleared when the
stats for that port are cleared.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoCorrect signedness bug in drm_modeset_ctl
emaste [Thu, 22 Mar 2018 01:00:55 +0000 (01:00 +0000)]
Correct signedness bug in drm_modeset_ctl

drm_modeset_ctl() takes a signed in from userland, does a boundscheck,
and then uses it to index into a structure and write to it.  The
boundscheck only checks upper bound, and never checks for nagative
values.  If the int coming from userland is negative [after conversion]
it will bypass the boundscheck, perform a negative index into an array
and write to it, causing memory corruption.

Note that this is in the "old" drm driver; this issue does not exist
in drm2.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: cem
MFC after: 1 day
Sponsored by: The FreeBSD Foundation

6 years agogetentropy(3): Fallback to kern.arandom sysctl on older kernels
cem [Wed, 21 Mar 2018 23:52:37 +0000 (23:52 +0000)]
getentropy(3): Fallback to kern.arandom sysctl on older kernels

On older kernels, when userspace program disables SIGSYS, catch ENOSYS and
emulate getrandom(2) syscall with the kern.arandom sysctl (via existing
arc4_sysctl wrapper).

Special care is taken to faithfully emulate EFAULT on NULL pointers, because
sysctl(3) as used by kern.arandom ignores NULL oldp.  (This was caught by
getentropy(3) ATF tests.)

Reported by: kib
Reviewed by: kib
Discussed with: delphij
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14785

6 years agoFix kernel memory disclosure in drm_infobufs
emaste [Wed, 21 Mar 2018 23:51:14 +0000 (23:51 +0000)]
Fix kernel memory disclosure in drm_infobufs

drm_infobufs() has a structure on the stack, fills it out and copies it
to userland.  There are 2 elements in the struct that are not filled out
and left uninitialized.  This will leak uninitialized kernel stack data
to userland.

Submitted by: Domagoj Stolfa <ds815@cam.ac.uk>
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 1 day
Security: Kernel memory disclosure (798)

6 years agoIf a jail parameter isn't found, try loading a related kernel module.
jamie [Wed, 21 Mar 2018 23:50:46 +0000 (23:50 +0000)]
If a jail parameter isn't found, try loading a related kernel module.

6 years agoApply r228478 (CTASSERT => _Static_assert()) to stand bootstrap.h
cem [Wed, 21 Mar 2018 23:46:26 +0000 (23:46 +0000)]
Apply r228478 (CTASSERT => _Static_assert()) to stand bootstrap.h

Reported by: GCC (it doesn't like the unused array)
Sponsored by: Dell EMC Isilon

6 years agoFix kernel memory disclosure in ibcs2_getdents
emaste [Wed, 21 Mar 2018 23:26:42 +0000 (23:26 +0000)]
Fix kernel memory disclosure in ibcs2_getdents

ibcs2_getdents() copies a dirent structure to userland.  The ibcs2
dirent structure contains a 2 byte pad element.  This element is never
initialized, but copied to userland none-the-less.

Note that ibcs2 has not built on HEAD since r302095.

Submitted by: Domagoj Stolfa <ds815@cam.ac.uk>
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 3 days
Security: Kernel memory disclosure (803)

6 years agoFix sysctl types broken in r329612.
glebius [Wed, 21 Mar 2018 23:21:32 +0000 (23:21 +0000)]
Fix sysctl types broken in r329612.

6 years agoAdd ) missing from r330297
emaste [Wed, 21 Mar 2018 23:17:26 +0000 (23:17 +0000)]
Add ) missing from r330297

Sponsored by: The FreeBSD Foundation

6 years agoForth version of EFI autoresizing
kevans [Wed, 21 Mar 2018 22:01:51 +0000 (22:01 +0000)]
Forth version of EFI autoresizing

r331321 delegated autoresizing to an efi-autoresizecons command that
currently is expected to be done in forth/lua prior to drawing anything
useful.

Add the Forth version of the lua addition in r331321, hook efi.4th up to be
installed.

efiboot? was written by dteske@; anything outside of that may be blamed on
me.