]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFV r337027:
Alexander Motin [Wed, 1 Aug 2018 03:07:33 +0000 (03:07 +0000)]
MFV r337027:
9328 zap code can take advantage of c99
9329 panic in zap_leaf_lookup() due to concurrent zapification

illumos/illumos-gate@bf26014c5541b6119f34e0d95294b7f2eb105ac2

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years ago9328 zap code can take advantage of c99
Alexander Motin [Wed, 1 Aug 2018 03:03:15 +0000 (03:03 +0000)]
9328 zap code can take advantage of c99
9329 panic in zap_leaf_lookup() due to concurrent zapification

illumos/illumos-gate@bf26014c5541b6119f34e0d95294b7f2eb105ac2

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years agoAs non-sparc64 undconditionally returns 1, simplify #ifdefs.
Cy Schubert [Wed, 1 Aug 2018 02:59:56 +0000 (02:59 +0000)]
As non-sparc64 undconditionally returns 1, simplify #ifdefs.

MFC after: 1 week

5 years agoMFV r337022:
Alexander Motin [Wed, 1 Aug 2018 02:39:44 +0000 (02:39 +0000)]
MFV r337022:
9403 assertion failed in arc_buf_destroy() when concurrently reading block with checksum error

This assertion (VERIFY) failure was reported when reading a block. Turns out
the problem is that if we get an i/o error (ECKSUM in this case), and there
are multiple concurrent ARC reads of the same block (from different clones),
then the ARC will put multiple buf's on the same ANON hdr, which isn't
supposed to happen, and then causes a panic when we try to arc_buf_destroy()
the buf.

illumos/illumos-gate@fa98e487a9619b7902f218663be219e787a57dad

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years ago- Add the ability to run bhyve(8) within a jail(8).
Marcelo Araujo [Wed, 1 Aug 2018 00:39:21 +0000 (00:39 +0000)]
- Add the ability to run bhyve(8) within a jail(8).

This patch adds a new sysctl(8) knob "security.jail.vmm_allowed",
by default this option is disable.

Submitted by: Shawn Webb <shawn.webb____hardenedbsd.org>
Reviewed by: jamie@ and myself.
Relnotes: Yes.
Sponsored by: HardenedBSD and G2, Inc.
Differential Revision: https://reviews.freebsd.org/D16057

5 years ago9403 assertion failed in arc_buf_destroy() when concurrently reading block with check...
Alexander Motin [Tue, 31 Jul 2018 23:44:13 +0000 (23:44 +0000)]
9403 assertion failed in arc_buf_destroy() when concurrently reading block with checksum error

This assertion (VERIFY) failure was reported when reading a block. Turns out
the problem is that if we get an i/o error (ECKSUM in this case), and there
are multiple concurrent ARC reads of the same block (from different clones),
then the ARC will put multiple buf's on the same ANON hdr, which isn't
supposed to happen, and then causes a panic when we try to arc_buf_destroy()
the buf.

illumos/illumos-gate@fa98e487a9619b7902f218663be219e787a57dad

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years agoMFV r337020:9443 panic when scrub a v10 pool
Alexander Motin [Tue, 31 Jul 2018 23:00:58 +0000 (23:00 +0000)]
MFV r337020:9443 panic when scrub a v10 pool

illumos/illumos-gate@bb1f424574ac8e08069d0ba993c2a41ffe796794

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years ago9443 panic when scrub a v10 pool
Alexander Motin [Tue, 31 Jul 2018 22:59:48 +0000 (22:59 +0000)]
9443 panic when scrub a v10 pool

illumos/illumos-gate@bb1f424574ac8e08069d0ba993c2a41ffe796794

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years agoAdd a dtrace provider for UDP-Lite.
Michael Tuexen [Tue, 31 Jul 2018 22:56:03 +0000 (22:56 +0000)]
Add a dtrace provider for UDP-Lite.

The dtrace provider for UDP-Lite is modeled after the UDP provider.
This fixes the bug that UDP-Lite packets were triggering the UDP
provider.
Thanks to dteske@ for providing the dwatch module.

Reviewed by: dteske@, markj@, rrs@
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16377

5 years agoMFV r337014:
Alexander Motin [Tue, 31 Jul 2018 22:50:50 +0000 (22:50 +0000)]
MFV r337014:
9421 zdb should detect and print out the number of "leaked" objects
9422 zfs diff and zdb should explicitly mark objects that are on the deleted queue

illumos/illumos-gate@20b5dafb425396adaebd0267d29e1026fc4dc413

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Paul Dagnelie <pcd@delphix.com>

5 years ago9237 "zpool add" fails for very large pools
Alexander Motin [Tue, 31 Jul 2018 21:42:31 +0000 (21:42 +0000)]
9237 "zpool add" fails for very large pools

illumos/illumos-gate@ae5ee1bd5e54409b4589217b160c8cf4b81e2fb8

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Alan Somers <asomers@gmail.com>

5 years agoCOMPAT_LINUX32 has not depended on COMPAT_43 in some time.
Mark Johnston [Tue, 31 Jul 2018 21:40:13 +0000 (21:40 +0000)]
COMPAT_LINUX32 has not depended on COMPAT_43 in some time.

MFC after: 3 days

5 years ago9421 zdb should detect and print out the number of "leaked" objects
Alexander Motin [Tue, 31 Jul 2018 21:31:24 +0000 (21:31 +0000)]
9421 zdb should detect and print out the number of "leaked" objects
9422 zfs diff and zdb should explicitly mark objects that are on the deleted queue

illumos/illumos-gate@20b5dafb425396adaebd0267d29e1026fc4dc413

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Paul Dagnelie <pcd@delphix.com>

5 years ago9194 mechanism to override ashift at pool creation time
Alexander Motin [Tue, 31 Jul 2018 21:26:03 +0000 (21:26 +0000)]
9194 mechanism to override ashift at pool creation time

illumos/illumos-gate@93a1902e519bf492c071b48ffb93e5c1c7b53fb9

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years agobump lld version number after r336972 arm(v7) VFP tag support
Ed Maste [Tue, 31 Jul 2018 21:06:28 +0000 (21:06 +0000)]
bump lld version number after r336972 arm(v7) VFP tag support

Reported by: kevans
Sponsored by: The FreeBSD Foundation

5 years agoMFV r336991, r337001:
Alexander Motin [Tue, 31 Jul 2018 21:06:04 +0000 (21:06 +0000)]
MFV r336991, r337001:
9102 zfs should be able to initialize storage devices

The first access to a disk block can incur a performance penalty on some
platforms (e.g. AWS's EBS, VMware VMDKs). Therefore it is recommended that
volumes be "thick provisioned", where supported by the platform (VMware).
Thick provisioning is time consuming and often is ignored. If the thick
provision step is omitted, customers will see suboptimal performance until
we have written to all parts of the LUN. ZFS should be able to initialize
any unused storage to remove any first-write penalty that exists.

illumos/illumos-gate@094e47e980b0796b94b1b8f51f462a64d246e516

Reviewed by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     George Wilson <george.wilson@delphix.com>

5 years agoofw_cpu: Add support for getting cpu clock via clock property
Emmanuel Vadot [Tue, 31 Jul 2018 20:50:50 +0000 (20:50 +0000)]
ofw_cpu: Add support for getting cpu clock via clock property

Nominal Mhz is either expressed via the clock-frequency property
or can be get via the clock property that holds the cpu clock.
Add support for the later.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D16346

5 years ago9434 Speculative prefetch is blocked by device removal code
Alexander Motin [Tue, 31 Jul 2018 19:30:08 +0000 (19:30 +0000)]
9434 Speculative prefetch is blocked by device removal code

illumos/illumos-gate@47b8d4b884f2dab4e4c6952b40fd740a8fc4ab32

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author:     Alexander Motin <mav@FreeBSD.org>

5 years agoAdd new files missed in r336991.
Alexander Motin [Tue, 31 Jul 2018 19:23:27 +0000 (19:23 +0000)]
Add new files missed in r336991.

5 years agorelease: arm64: Add PINE64-LTS configuration file
Emmanuel Vadot [Tue, 31 Jul 2018 19:14:52 +0000 (19:14 +0000)]
release: arm64: Add PINE64-LTS configuration file

Pine64 isn't produced anymore but Pine64-LTS is.
This image works on the LTS release and the Sopine module.

Reviewed by: gjb
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16487

5 years agorelease: arm: Enable multicons for arm64
Emmanuel Vadot [Tue, 31 Jul 2018 19:13:50 +0000 (19:13 +0000)]
release: arm: Enable multicons for arm64

Since we have now EFI framebuffer enabled for ARM64 if we boot on a board
with an screen, u-boot will set up a EFI GOP framebuffer and we won't boot
using the serial console.
Also on RPI3 the firmware always setup the framebuffer area resulting in u-boot
always setup the EFI GOP and FreeBSD never using the serial console.

Reviewed by: gjb, lwshu (previous version)
Differential Revision: https://reviews.freebsd.org/D16472

5 years agorelease: arm: Always boot armv6/v7 image with EFI
Emmanuel Vadot [Tue, 31 Jul 2018 19:12:31 +0000 (19:12 +0000)]
release: arm: Always boot armv6/v7 image with EFI

boot.scr is a u-boot script that loads and execute ubldr.bin
If not present u-boot will automatically boot loader.efi which
is already installed.

This means that all armv6/armv7 images are now booted via EFI

Tested-On: RPI-B
Tested-On: RPI2
Tested-On: OrangePi One
Tested-On: All lot of other boards
MFC after: Never
Relnotes: yes

5 years agorelease: Restore copy of boot.scr for some board
Emmanuel Vadot [Tue, 31 Jul 2018 19:10:50 +0000 (19:10 +0000)]
release: Restore copy of boot.scr for some board

This is not a problem for 12-CURRENT as EFI boot works but it doesn't
for 11.
While here some board arm_install_uboot also copy ubldr.bin et create
firstboot files but it's already done in arm_install_boot

Reviewed by: gjb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16481

5 years agonvmem: Add nvmem interface and helpers
Emmanuel Vadot [Tue, 31 Jul 2018 19:08:24 +0000 (19:08 +0000)]
nvmem: Add nvmem interface and helpers

The nvmem interface helps provider of nvmem data to expose themselves to consumer.
NVMEM is generally present on some embedded board in a form of eeprom or fuses.
The nvmem api are helpers for consumer to read/write the cell data from a provider.

Differential Revision: https://reviews.freebsd.org/D16419

5 years agorelease: Deinstall u-boot ports before installing
Emmanuel Vadot [Tue, 31 Jul 2018 18:57:11 +0000 (18:57 +0000)]
release: Deinstall u-boot ports before installing

FORCE_PKG_REGISTER is broken so multiple invocation of release.sh for the
same board will fails if /scratch isn't cleaned.
Leave it but deinstall the package first.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16513

5 years agorelease: arm: Use BOARDNAME in the image name
Emmanuel Vadot [Tue, 31 Jul 2018 18:55:44 +0000 (18:55 +0000)]
release: arm: Use BOARDNAME in the image name

Using KERNEL made sense when all boards had different kernel configuration.
Now that all of them are using GENERIC use the board name instead

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16512

5 years agorelease: rpi-b: add BOARDNAME variable
Emmanuel Vadot [Tue, 31 Jul 2018 18:54:06 +0000 (18:54 +0000)]
release: rpi-b: add BOARDNAME variable

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16514

5 years agorelease: arm: Use GENERIC kernel for IMX6 based boards
Emmanuel Vadot [Tue, 31 Jul 2018 18:52:43 +0000 (18:52 +0000)]
release: arm: Use GENERIC kernel for IMX6 based boards

Switch the IMX.6 based board to GENERIC the kernel config.

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D16511

5 years ago9102 zfs should be able to initialize storage devices
Alexander Motin [Tue, 31 Jul 2018 18:49:07 +0000 (18:49 +0000)]
9102 zfs should be able to initialize storage devices

The first access to a disk block can incur a performance penalty on some
platforms (e.g. AWS's EBS, VMware VMDKs). Therefore it is recommended that
volumes be "thick provisioned", where supported by the platform (VMware).
Thick provisioning is time consuming and often is ignored. If the thick
provision step is omitted, customers will see suboptimal performance until
we have written to all parts of the LUN. ZFS should be able to initialize
any unused storage to remove any first-write penalty that exists.

illumos/illumos-gate@094e47e980b0796b94b1b8f51f462a64d246e516

Reviewed by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

5 years agoFor compat32, emulate the same wraparound check as occurs on the real
Konstantin Belousov [Tue, 31 Jul 2018 18:00:47 +0000 (18:00 +0000)]
For compat32, emulate the same wraparound check as occurs on the real
ILP32 system.

Reported by and discussed with: asomers
PR: 230162
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16525

5 years agoAllow vm object coalescing to occur in the midst of a vm object when the
Alan Cox [Tue, 31 Jul 2018 17:41:48 +0000 (17:41 +0000)]
Allow vm object coalescing to occur in the midst of a vm object when the
OBJ_ONEMAPPING flag is set.  In other words, allow recycling of existing
but unused subranges of a vm object when the OBJ_ONEMAPPING flag is set.

Such situations are increasingly common with jemalloc >= 5.0.  This
change has the expected effect of reducing the number of vm map entry and
object allocations and increasing the number of superpage promotions.

Reviewed by: kib, markj
Tested by: pho
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D16501

5 years agosnd_hda: Byteswap the buffer descriptor entries as needed
Justin Hibbits [Tue, 31 Jul 2018 17:18:58 +0000 (17:18 +0000)]
snd_hda: Byteswap the buffer descriptor entries as needed

The buffer descriptor list entries should be in little endian format.  Byte swap
them on BE.  This is the last piece of the puzzle for snd_hda(4) to work on
PowerPC.

5 years agoRegenerate after r336980.
Konstantin Belousov [Tue, 31 Jul 2018 17:16:06 +0000 (17:16 +0000)]
Regenerate after r336980.

5 years agoProvide compat32 shims for sched_rr_get_interval(2).
Konstantin Belousov [Tue, 31 Jul 2018 17:15:31 +0000 (17:15 +0000)]
Provide compat32 shims for sched_rr_get_interval(2).

The interface uses struct timespec, which needs a translation.

Reported and reviewed by: asomers
PR: 230175
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16525

5 years agoMove pkg/FreeBSD.conf to usr.sbin/pkg/
Brad Davis [Tue, 31 Jul 2018 16:42:03 +0000 (16:42 +0000)]
Move pkg/FreeBSD.conf to usr.sbin/pkg/

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16491

5 years agoMove blacklistd.conf to usr.sbin/blacklistd/
Brad Davis [Tue, 31 Jul 2018 16:39:38 +0000 (16:39 +0000)]
Move blacklistd.conf to usr.sbin/blacklistd/

This is prep for pkging base and helps tag and install config files with the
correct packages.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16493

5 years agoRemove variable re-inserted during mis-application of r336973
Kyle Evans [Tue, 31 Jul 2018 16:08:17 +0000 (16:08 +0000)]
Remove variable re-inserted during mis-application of r336973

5 years agoRe-insert variable disappeared during mis-application of r336973
Kyle Evans [Tue, 31 Jul 2018 16:04:49 +0000 (16:04 +0000)]
Re-insert variable disappeared during mis-application of r336973

5 years agoconfig(8): Strip comments from env lines
Kyle Evans [Tue, 31 Jul 2018 16:03:30 +0000 (16:03 +0000)]
config(8): Strip comments from env lines

Consolidates the small bits of logic required for preprocessing a line
before inclusion into a file or nvlist.

5 years agolld: [ELF][ARM] Implement support for Tag_ABI_VFP_args
Ed Maste [Tue, 31 Jul 2018 15:25:03 +0000 (15:25 +0000)]
lld: [ELF][ARM] Implement support for Tag_ABI_VFP_args

The Tag_ABI_VFP_args build attribute controls the procedure call
standard used for floating point parameters on ARM. The values are:

0 - Base AAPCS (FP Parameters passed in Core (Integer) registers
1 - VFP AAPCS (FP Parameters passed in FP registers)
2 - Toolchain specific (Neither Base or VFP)
3 - Compatible with all (No use of floating point parameters)

If the Tag_ABI_VFP_args build attribute is missing it has an implicit
value of 0.

We use the attribute in two ways:

* Detect a clash in calling convention between Base, VFP and Toolchain.

we follow ld.bfd's lead and do not error if there is a clash between an
implicit Base AAPCS caused by a missing attribute. Many projects
including the hard-float (VFP AAPCS) version of glibc contain assembler
files that do not use floating point but do not have Tag_ABI_VFP_args.

* Set the EF_ARM_ABI_FLOAT_SOFT or EF_ARM_ABI_FLOAT_HARD ELF header flag

for Base or VFP AAPCS respectively. This flag is used by some ELF
loaders.

References:
* Addenda to, and Errata in, the ABI for the ARM Architecture for
  Tag_ABI_VFP_args
* Elf for the ARM Architecture for ELF header flags

Fixes LLVM PR36009

PR: 229050
Obtained from: llvm r338377 by Peter Smith

5 years agoUse int for the pcpu_ssbd argument. This is included from userland and may
Andrew Turner [Tue, 31 Jul 2018 15:08:02 +0000 (15:08 +0000)]
Use int for the pcpu_ssbd argument. This is included from userland and may
not include the needed headers to get the bool definition.

Reported by: manu
Pointy hat to: andrew
Sponsored by: DARPA, AFRL

5 years agollvm: [ARM] Complete enumeration values for Tag_ABI_VFP_args
Ed Maste [Tue, 31 Jul 2018 14:14:41 +0000 (14:14 +0000)]
llvm: [ARM] Complete enumeration values for Tag_ABI_VFP_args

The LLD implementation of Tag_ABI_VFP_args needs to check the rarely
seen values of 3 (toolchain specific) and 4 compatible with both Base
and VFP.  Add the missing enumeration values so that LLD can refer to
them without having to use the raw numbers.

Obtained from: llvm r338373 by Peter Smith

5 years agollvm: [ELF][ARM] Add Arm ABI names for float ABI ELF Header flags
Ed Maste [Tue, 31 Jul 2018 14:12:09 +0000 (14:12 +0000)]
llvm: [ELF][ARM] Add Arm ABI names for float ABI ELF Header flags

The ELF for the Arm architecture document defines, for EF_ARM_EABI_VER5
and above, the flags EF_ARM_ABI_FLOAT_HARD and EF_ARM_ABI_FLOAT_SOFT.
These have been defined to be compatible with the existing
EF_ARM_VFP_FLOAT and EF_ARM_SOFT_FLOAT used by gcc for
EF_ARM_EABI_UNKNOWN.

This patch adds the flags in addition to the existing ones so that any
code depending on the old names will still work.

Obtained from: llvm r338370 by Peter Smith

5 years agoImplement the SSBD (CVE-2018-3639) workaround on arm64
Andrew Turner [Tue, 31 Jul 2018 12:53:27 +0000 (12:53 +0000)]
Implement the SSBD (CVE-2018-3639) workaround on arm64

This calls into the Arm Trusted Firmware to enable and disable the
workaround for the Speculative Store Bypass Disable (SSBD) issue, also
known as Spectre Variant 4.

As this may have a large performance overhead, and how exploitable SSBD is
is unknown we follow the Linux lead of allowing the administrator to select
between always on, always off, or only enabled in the kernel, with the
latter being the default.

PR: 228955
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15819

5 years agomsdosfs: trim EOL whitespace
Ed Maste [Tue, 31 Jul 2018 12:44:28 +0000 (12:44 +0000)]
msdosfs: trim EOL whitespace

5 years agocd9660: replace bcopy/bzero with C standard equivalents
Ed Maste [Tue, 31 Jul 2018 12:36:46 +0000 (12:36 +0000)]
cd9660: replace bcopy/bzero with C standard equivalents

To reduce diffs against NetBSD.

5 years agoOnly NULL check the VNET pointer when VIMAGE is enabled in ibcore.
Hans Petter Selasky [Tue, 31 Jul 2018 11:23:44 +0000 (11:23 +0000)]
Only NULL check the VNET pointer when VIMAGE is enabled in ibcore.
Else a NULL VNET pointer should be ignored. This fixes address resolving
when VIMAGE is disabled.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix INET only builds.
Michael Tuexen [Tue, 31 Jul 2018 06:27:05 +0000 (06:27 +0000)]
Fix INET only builds.

r336940 introduced an "unused variable" warning on platforms which
support INET, but not INET6, like MALTA and MALTA64 as reported
by Mark Millard. Improve the #ifdefs to address this issue.

Sponsored by: Netflix, Inc.

5 years agoMFV r336960: 9256 zfs send space estimation off by > 10% on some datasets
Alexander Motin [Tue, 31 Jul 2018 01:02:22 +0000 (01:02 +0000)]
MFV r336960: 9256 zfs send space estimation off by > 10% on some datasets

illumos/illummos-gate@df477c0afa111b5205c872dab36dbfde391656de

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Paul Dagnelie <pcd@delphix.com>

5 years ago9256 zfs send space estimation off by > 10% on some datasets
Alexander Motin [Tue, 31 Jul 2018 01:00:46 +0000 (01:00 +0000)]
9256 zfs send space estimation off by > 10% on some datasets

illumos/illummos-gate@df477c0afa111b5205c872dab36dbfde391656de

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Paul Dagnelie <pcd@delphix.com>

5 years agoMFV r336958: 9337 zfs get all is slow due to uncached metadata
Alexander Motin [Tue, 31 Jul 2018 00:58:21 +0000 (00:58 +0000)]
MFV r336958: 9337 zfs get all is slow due to uncached metadata

This project's goal is to make read-heavy channel programs and zfs(1m)
administrative commands faster by caching all the metadata that they will
need in the dbuf layer. This will prevent the data from being evicted, so
that any future call to i.e. zfs get all won't have to go to disk (very
much).

illumos/illumos-gate@adb52d9262f45a04318fc6e188fe2b7f59d989a5

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years ago9337 zfs get all is slow due to uncached metadata
Alexander Motin [Tue, 31 Jul 2018 00:56:41 +0000 (00:56 +0000)]
9337 zfs get all is slow due to uncached metadata

This project's goal is to make read-heavy channel programs and zfs(1m)
administrative commands faster by caching all the metadata that they will
need in the dbuf layer. This will prevent the data from being evicted, so
that any future call to i.e. zfs get all won't have to go to disk (very
much).

illumos/illumos-gate@adb52d9262f45a04318fc6e188fe2b7f59d989a5

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>

5 years agoAdd a regression test related to PR 131876.
Mark Johnston [Tue, 31 Jul 2018 00:48:08 +0000 (00:48 +0000)]
Add a regression test related to PR 131876.

If an error occurs while copying a SCM_RIGHTS message to userspace,
we free the mbuf containing externalized rights, leaking them.

PR: 131876
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoMFV r336955: 9236 nuke spa_dbgmsg
Alexander Motin [Tue, 31 Jul 2018 00:47:27 +0000 (00:47 +0000)]
MFV r336955: 9236 nuke spa_dbgmsg

We should use zfs_dbgmsg instead of spa_dbgmsg.  Or at least,
metaslab_condense() should call zfs_dbgmsg because it's important and rare
enough to always log. It's possible that the message in zio_dva_allocate()
would be too high-frequency for zfs_dbgmsg.

illumos/illumos-gate@21f7c81cc1156e9202ce3412d3ecaa697c3b2222

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years ago9236 nuke spa_dbgmsg
Alexander Motin [Tue, 31 Jul 2018 00:42:31 +0000 (00:42 +0000)]
9236 nuke spa_dbgmsg

We should use zfs_dbgmsg instead of spa_dbgmsg.  Or at least,
metaslab_condense() should call zfs_dbgmsg because it's important and rare
enough to always log. It's possible that the message in zio_dva_allocate()
would be too high-frequency for zfs_dbgmsg.

illumos/illumos-gate@21f7c81cc1156e9202ce3412d3ecaa697c3b2222

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years agoMFV r336952: 9192 explicitly pass good_writes to vdev_uberblock/label_sync
Alexander Motin [Tue, 31 Jul 2018 00:37:45 +0000 (00:37 +0000)]
MFV r336952: 9192 explicitly pass good_writes to vdev_uberblock/label_sync

Currently vdev_label_sync and vdev_uberblock_sync take a zio_t and assume
that its io_private is a pointer to the good_writes count. They should
instead accept this argument explicitly.

illumos/illumos-gate@a3b5583021b7b45676bf1f0cc68adf7a97900b56

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years ago9192 explicitly pass good_writes to vdev_uberblock/label_sync
Alexander Motin [Tue, 31 Jul 2018 00:34:39 +0000 (00:34 +0000)]
9192 explicitly pass good_writes to vdev_uberblock/label_sync

Currently vdev_label_sync and vdev_uberblock_sync take a zio_t and assume
that its io_private is a pointer to the good_writes count. They should
instead accept this argument explicitly.

illumos/illumos-gate@a3b5583021b7b45676bf1f0cc68adf7a97900b56

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years agoMFV r336950: 9290 device removal reduces redundancy of mirrors
Alexander Motin [Tue, 31 Jul 2018 00:25:39 +0000 (00:25 +0000)]
MFV r336950: 9290 device removal reduces redundancy of mirrors

Mirrors are supposed to provide redundancy in the face of whole-disk failure
and silent damage (e.g. some data on disk is not right, but ZFS hasn't
detected the whole device as being broken). However, the current device
removal implementation bypasses some of the mirror's redundancy.

illumos/illumos-gate@3a4b1be953ee5601bab748afa07c26ed4996cde6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years ago9290 device removal reduces redundancy of mirrors
Alexander Motin [Tue, 31 Jul 2018 00:13:04 +0000 (00:13 +0000)]
9290 device removal reduces redundancy of mirrors

Mirrors are supposed to provide redundancy in the face of whole-disk failure
and silent damage (e.g. some data on disk is not right, but ZFS hasn't
detected the whole device as being broken). However, the current device
removal implementation bypasses some of the mirror's redundancy.

illumos/illumos-gate@3a4b1be953ee5601bab748afa07c26ed4996cde6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

5 years agoMFV r336948: 9112 Improve allocation performance on high-end systems
Alexander Motin [Tue, 31 Jul 2018 00:02:42 +0000 (00:02 +0000)]
MFV r336948: 9112 Improve allocation performance on high-end systems

On high-end systems running async sequential write workloads, especially
NUMA systems with flash or NVMe storage, one significant performance
bottleneck is selecting a metaslab to do allocations from. This process
can be parallelized, providing significant performance increases for
these workloads.

illumos/illumos-gate@f78cdc34af236a6199dd9e21376f4a46348c0d56

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Paul Dagnelie <pcd@delphix.com>

5 years ago9112 Improve allocation performance on high-end systems
Alexander Motin [Mon, 30 Jul 2018 23:53:25 +0000 (23:53 +0000)]
9112 Improve allocation performance on high-end systems

On high-end systems running async sequential write workloads, especially
NUMA systems with flash or NVMe storage, one significant performance
bottleneck is selecting a metaslab to do allocations from. This process
can be parallelized, providing significant performance increases for
these workloads.

illumos/illumos-gate@f78cdc34af236a6199dd9e21376f4a46348c0d56

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Paul Dagnelie <pcd@delphix.com>

5 years agoMFV r336946: 9238 ZFS Spacemap Encoding V2
Alexander Motin [Mon, 30 Jul 2018 23:47:38 +0000 (23:47 +0000)]
MFV r336946: 9238 ZFS Spacemap Encoding V2

The current space map encoding has the following disadvantages:
[1] Assuming 512 sector size each entry can represent at most 16MB for a segment.
This makes the encoding very inefficient for large regions of space.
[2] As vdev-wide space maps have started to be used by new features (i.e.
device removal, zpool checkpoint) we've started imposing limits in the
vdevs that can be used with them based on the maximum addressable offset
(currently 64PB for a top-level vdev).

The new remains backwards compatible with the old one. The introduced
two-word entry format, besides extending the limits imposed by the single-entry
layout, also includes a vdev field and some extra padding after its prefix.

The extra padding after the prefix should is reserved for future usage (e.g.
new prefixes for future encodings or new fields for flags). The new vdev field
not only makes the space maps more self-descriptive, but also opens the doors
for pool-wide space maps.

One final important note is that the number of bits used for vdevs is reduced
to 24 bits for blkptrs. That was decided as we don't know of any setups that
use more than 16M vdevs for the time being and
we wanted to fit the vdev field in the space map. In addition that gives us
some extra bits in dva_t.

illumos/illumos-gate@17f11284b49b98353b5119463254074fd9bc0a28

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>

5 years ago9238 ZFS Spacemap Encoding V2
Alexander Motin [Mon, 30 Jul 2018 22:56:24 +0000 (22:56 +0000)]
9238 ZFS Spacemap Encoding V2

The current space map encoding has the following disadvantages:
[1] Assuming 512 sector size each entry can represent at most 16MB for a segment.
This makes the encoding very inefficient for large regions of space.
[2] As vdev-wide space maps have started to be used by new features (i.e.
device removal, zpool checkpoint) we've started imposing limits in the
vdevs that can be used with them based on the maximum addressable offset
(currently 64PB for a top-level vdev).

The new remains backwards compatible with the old one. The introduced
two-word entry format, besides extending the limits imposed by the single-entry
layout, also includes a vdev field and some extra padding after its prefix.

The extra padding after the prefix should is reserved for future usage (e.g.
new prefixes for future encodings or new fields for flags). The new vdev field
not only makes the space maps more self-descriptive, but also opens the doors
for pool-wide space maps.

One final important note is that the number of bits used for vdevs is reduced
to 24 bits for blkptrs. That was decided as we don't know of any setups that
use more than 16M vdevs for the time being and
we wanted to fit the vdev field in the space map. In addition that gives us
some extra bits in dva_t.

illumos/illumos-gate@17f11284b49b98353b5119463254074fd9bc0a28

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>

5 years agoMFV r336944: 9286 want refreservation=auto
Alexander Motin [Mon, 30 Jul 2018 22:39:30 +0000 (22:39 +0000)]
MFV r336944: 9286 want refreservation=auto

When a ZFS volume is created with zfs create -V (but without -s), the
refreservation property is set to a value that is volsize plus the maximum
size of metadata. If refreservation is ever set to another value, it is
impossible to set it back to the automatically determined value. There are
other cases where refreservation may be wrong. These include receiving a
volume that was sent without properties and zfs clone.

We need:

zfs set refreservation=auto <volume>
zfs clone -o refreservation=auto <volume>

Each one would use the same function used by zfs create -V to determine the
proper value for refreservation.

illumos/illumos-gate@1c10ae76c0cb31326c320e7cef1d3f24a1f47125

Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Mike Gerdts <mike.gerdts@joyent.com>

5 years ago9286 want refreservation=auto
Alexander Motin [Mon, 30 Jul 2018 22:10:15 +0000 (22:10 +0000)]
9286 want refreservation=auto

When a ZFS volume is created with zfs create -V (but without -s), the
refreservation property is set to a value that is volsize plus the maximum
size of metadata. If refreservation is ever set to another value, it is
impossible to set it back to the automatically determined value. There are
other cases where refreservation may be wrong. These include receiving a
volume that was sent without properties and zfs clone.

We need:

zfs set refreservation=auto <volume>
zfs clone -o refreservation=auto <volume>

Each one would use the same function used by zfs create -V to determine the
proper value for refreservation.

illumos/illumos-gate@1c10ae76c0cb31326c320e7cef1d3f24a1f47125

Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Mike Gerdts <mike.gerdts@joyent.com>

5 years agoMFV r336942: 9189 Add debug to vdev_label_read_config when txg check fails
Alexander Motin [Mon, 30 Jul 2018 22:03:29 +0000 (22:03 +0000)]
MFV r336942: 9189 Add debug to vdev_label_read_config when txg check fails

illumos/illumos-gate@b6bf6e1540f30bd97b8d6e2c21d95e17841e0f23

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

5 years ago9189 Add debug to vdev_label_read_config when txg check fails
Alexander Motin [Mon, 30 Jul 2018 21:59:44 +0000 (21:59 +0000)]
9189 Add debug to vdev_label_read_config when txg check fails

illumos/illumos-gate@b6bf6e1540f30bd97b8d6e2c21d95e17841e0f23

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

5 years agoAllow implicit TCP connection setup for TCP/IPv6.
Michael Tuexen [Mon, 30 Jul 2018 21:27:26 +0000 (21:27 +0000)]
Allow implicit TCP connection setup for TCP/IPv6.

TCP/IPv4 allows an implicit connection setup using sendto(), which
is used for TTCP and TCP fast open. This patch adds support for
TCP/IPv6.
While there, improve some tests for detecting multicast addresses,
which are mapped.

Reviewed by: bz@, kbowling@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16458

5 years agoSend consistent SEG.WIN when using timewait codepath for TCP.
Michael Tuexen [Mon, 30 Jul 2018 21:13:42 +0000 (21:13 +0000)]
Send consistent SEG.WIN when using timewait codepath for TCP.

When sending TCP segments from the timewait code path, a stored
value of the last sent window is used. Use the same code for
computing this in the timewait code path as in the main code
path used in tcp_output() to avoiv inconsistencies.

Reviewed by: rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16503

5 years agomsdosfs: use same max filesize #define as NetBSD and move to header
Ed Maste [Mon, 30 Jul 2018 20:36:51 +0000 (20:36 +0000)]
msdosfs: use same max filesize #define as NetBSD and move to header

For use by makefs msdosfs support.

Obtained from: NetBSD denode.h 1.6
Sponsored by: The FreeBSD Foundation

5 years agoFix some TCP fast open issues.
Michael Tuexen [Mon, 30 Jul 2018 20:35:50 +0000 (20:35 +0000)]
Fix some TCP fast open issues.

The following issues are fixed:
* Whenever a TCP server with TCP fast open enabled, calls accept(),
  recv(), send(), and close() before the TCP-ACK segment has been received,
  the TCP connection is just dropped and the reception of the TCP-ACK
  segment triggers the sending of a TCP-RST segment.
* Whenever a TCP server with TCP fast open enabled, calls accept(), recv(),
  send(), send(), and close() before the TCP-ACK segment has been received,
  the first byte provided in the second send call is not transferred.
* Whenever a TCP client with TCP fast open enabled calls sendto() followed
  by close() the TCP connection is just dropped.

Reviewed by: jtl@, kbowling@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16485

5 years agoSilence newer gcc warnings.
Rick Macklem [Mon, 30 Jul 2018 20:25:32 +0000 (20:25 +0000)]
Silence newer gcc warnings.

Newer versions of gcc generate "set, but not used" warnings.
Add __unused macros to silence these warnings.
Although the variables are not being used, they are values parsed from
arguments to callback RPCs that might be needed in the future.

Requested by: mmacy

5 years agoAdd missing send/recv dtrace probes for TCP.
Michael Tuexen [Mon, 30 Jul 2018 20:13:38 +0000 (20:13 +0000)]
Add missing send/recv dtrace probes for TCP.

These missing probe are mostly in the syncache and timewait code.

Reviewed by: markj@, rrs@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16369

5 years agosnd_hda: Make codec control path endian safe
Justin Hibbits [Mon, 30 Jul 2018 20:00:56 +0000 (20:00 +0000)]
snd_hda: Make codec control path endian safe

The CORB and RIRB buffers exist in DMA memory, but the device reads them as
little-endian only.  Read and write as LE into the DMA memory block, to work on
BE platforms.

5 years ago9284 arc_reclaim_thread has 2 jobs
Alexander Motin [Mon, 30 Jul 2018 19:44:14 +0000 (19:44 +0000)]
9284 arc_reclaim_thread has 2 jobs

`arc_reclaim_thread()` calls `arc_adjust()` after calling
`arc_kmem_reap_now()`; `arc_adjust()` signals `arc_get_data_buf()` to
indicate that we may no longer be `arc_is_overflowing()`.

The problem is, `arc_kmem_reap_now()` can take several seconds to
complete, has no impact on `arc_is_overflowing()`, but due to how the
code is structured, can impact how long the ARC will remain in the
`arc_is_overflowing()` state.

The fix is to use seperate threads to:

1. keep `arc_size` under `arc_c`, by calling `arc_adjust()`, which
    improves `arc_is_overflowing()`

2. keep enough free memory in the system, by calling
 `arc_kmem_reap_now()` plus `arc_shrink()`, which improves
 `arc_available_memory()`.

illumos/illumos-gate@de753e34f9c399037936e8bc547d823bba9d4b0d

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Tim Kordas <tim.kordas@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Brad Lewis <brad.lewis@delphix.com>

5 years agosed: compile with the default WARNS level.
Pedro F. Giffuni [Mon, 30 Jul 2018 19:41:54 +0000 (19:41 +0000)]
sed: compile with the default WARNS level.

5 years agosed: unsign some indexes to fix sign-compare warnings.
Pedro F. Giffuni [Mon, 30 Jul 2018 18:29:46 +0000 (18:29 +0000)]
sed: unsign some indexes to fix sign-compare warnings.

Hinted by: OpenBSD (CVS 1.32)

MFC after:  1 week

5 years agoAdd ofw_bus_if.h to the SRCS list for ipmi module on powerpc64
Justin Hibbits [Mon, 30 Jul 2018 18:29:20 +0000 (18:29 +0000)]
Add ofw_bus_if.h to the SRCS list for ipmi module on powerpc64

PR: 230194
Reported by: sbruno

5 years agoFollow up to r336919 and r336921: s/efi.rt_disabled/efi.rt.disabled/
Kyle Evans [Mon, 30 Jul 2018 18:13:20 +0000 (18:13 +0000)]
Follow up to r336919 and r336921: s/efi.rt_disabled/efi.rt.disabled/

The latter matches the rest of the tree better [0]. The UPDATING entry has
been updated to reflect this, and the new tunable is now documented in
loader(8) [1].

Reported by: imp [0], Shawn Webb [1]

5 years agoCorrect typo from r336921; BIOS/legacy boot...
Kyle Evans [Mon, 30 Jul 2018 17:59:18 +0000 (17:59 +0000)]
Correct typo from r336921; BIOS/legacy boot...

5 years agoRemove a redundant check.
Mark Johnston [Mon, 30 Jul 2018 17:58:41 +0000 (17:58 +0000)]
Remove a redundant check.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoamd64/GENERIC: Enable EFIRT by default
Kyle Evans [Mon, 30 Jul 2018 17:54:18 +0000 (17:54 +0000)]
amd64/GENERIC: Enable EFIRT by default

As noted in UDPATING, the new loader tunable efi.rt_disabled may be used to
disable EFIRT at runtime. It should have no effect if you are not booted via
UEFI boot.

MFC after: 6 weeks

5 years agoefirt: Add tunable to allow disabling EFI Runtime Services
Kyle Evans [Mon, 30 Jul 2018 17:40:27 +0000 (17:40 +0000)]
efirt: Add tunable to allow disabling EFI Runtime Services

Leading up to enabling EFIRT in GENERIC, allow runtime services to be
disabled with a new tunable: efi.rt_disabled. This makes it so that EFIRT
can be disabled easily in case we run into some buggy UEFI implementation
and fail to boot.

Discussed with: imp, kib
MFC after: 1 week

5 years agopowerpcspe: Unconditionally save an restore SPEFSCR on task switch
Justin Hibbits [Mon, 30 Jul 2018 17:03:15 +0000 (17:03 +0000)]
powerpcspe: Unconditionally save an restore SPEFSCR on task switch

The SPEFSCR is not guarded by the SPV bit in MSR, it's just another SPR.
Protect processes from other tasks setting the SPEFSCR for their own needs.

5 years agoRemove unneeded CLDs instructions in the SMAP-ed version of several
Konstantin Belousov [Mon, 30 Jul 2018 16:54:51 +0000 (16:54 +0000)]
Remove unneeded CLDs instructions in the SMAP-ed version of several
functions from support.S.

I believe they re-appeared due to me mis-merging my r327820 into the
topic branch.

Sponsored by: The FreeBSD Foundation

5 years agoEnable VIMAGE on arm64 again. A workaround for modules with static VNET
Andrew Turner [Mon, 30 Jul 2018 15:57:58 +0000 (15:57 +0000)]
Enable VIMAGE on arm64 again. A workaround for modules with static VNET
variables has been committed so these should work now.

PR: 223670
Sponsored by: DARPA, AFRL

5 years agoMake timespecadd(3) and friends public
Alan Somers [Mon, 30 Jul 2018 15:46:40 +0000 (15:46 +0000)]
Make timespecadd(3) and friends public

The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.

Our kernel currently defines two-argument versions of timespecadd and
timespecsub.  NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions.  Solaris also defines a three-argument version, but
only in its kernel.  This revision changes our definition to match the
common three-argument version.

Bump _FreeBSD_version due to the breaking KPI change.

Discussed with: cem, jilles, ian, bde
Differential Revision: https://reviews.freebsd.org/D14725

5 years agonewsyslog: fix compression arglist construction
Baptiste Daroussin [Mon, 30 Jul 2018 15:46:24 +0000 (15:46 +0000)]
newsyslog: fix compression arglist construction

Reuse of the index variable in two nested loops resulted in only the first
argument in the list being used (fine for gzip, not fine for zstd). Also
add tests for xz and zstd, and fix the COMPRESS_SUFFIX_MAXLEN macro.

Submitted by: dnelson_1901_yahoo.com
Differential Revision: https://reviews.freebsd.org/D16509

5 years agosnd_hda: Print error codes in decimal, rather than hex
Justin Hibbits [Mon, 30 Jul 2018 15:19:59 +0000 (15:19 +0000)]
snd_hda: Print error codes in decimal, rather than hex

It's easy to confuse the error code as naked it looks decimal (EINVAL is
reported as error 16, instead of error 22, so first reading looks like EBUSY).

5 years agosnd_hda: Only free streams DMA maps if the streams list has been created
Justin Hibbits [Mon, 30 Jul 2018 15:15:33 +0000 (15:15 +0000)]
snd_hda: Only free streams DMA maps if the streams list has been created

If hdac_attach fails prior to allocating sc->streams, cleanup in the
hdac_attach_fail label will dereference a NULL pointer, panicking.

5 years agoRevert accidental change from r336908
Ed Maste [Mon, 30 Jul 2018 15:10:06 +0000 (15:10 +0000)]
Revert accidental change from r336908

By default ld.lld should be the bootstrap linker (only) on i386 right
now.  Once the i386 exp-run with LLD_IS_LD has a good result this will
also be enabled by default.

Reported by: andrew
Pointy hat to: emaste

5 years agoAs with DPCPU_DEFINE_STATIC make VNET_DEFINE_STATIC non-static on arm64 in
Andrew Turner [Mon, 30 Jul 2018 15:05:07 +0000 (15:05 +0000)]
As with DPCPU_DEFINE_STATIC make VNET_DEFINE_STATIC non-static on arm64 in
modules. It also fails in the same way, we are unable to relocate static
variables as the compiler uses PC-relative loads with nothing for the
kernel linker to relocate.

Sponsored by: DARPA, AFRL

5 years agoMakefile.libcompat: correctly append to make variable
Ed Maste [Mon, 30 Jul 2018 14:42:59 +0000 (14:42 +0000)]
Makefile.libcompat: correctly append to make variable

Reported by: hselasky
Pointy hat to: emaste

5 years agoMakefile.libcompat: use one variable assignment per line
Ed Maste [Mon, 30 Jul 2018 14:28:00 +0000 (14:28 +0000)]
Makefile.libcompat: use one variable assignment per line

This makes it easier to carry or merge patches that remove gnu/
components.

5 years agoEnsure the DPCPU and VNET module spaces are aligned to hold a pointer.
Andrew Turner [Mon, 30 Jul 2018 14:25:17 +0000 (14:25 +0000)]
Ensure the DPCPU and VNET module spaces are aligned to hold a pointer.
Previously they may have been aligned to a char, leading to misaligned
DPCPU and VNET variables.

Sponsored by: DARPA, AFRL

5 years agoCorrect possible misleading error message in kqtest.
David Bright [Mon, 30 Jul 2018 14:21:49 +0000 (14:21 +0000)]
Correct possible misleading error message in kqtest.

ian@ pointed out that in the test_abstime() function time(NULL) is
used twice; once in an "if" test and again in the enclosed error
message. If the true branch was taken and the process got preempted
before the second time(NULL) call, by the time the error message was
generated enough time could have elapsed that the message could claim
that the event came "too early" but print an event time that was after
the expected timeout. Correct by making the time(NULL) call only once
and using that returned time in both the "if" test and the error
message.

Reported by: ian@
MFC after: 4 days
X-MFC-with: r336761, r336781, r336802
Sponsored by: Dell EMC

5 years agoRegen src.conf.5 after r336901, WITH_LLD_BOOTSTRAP on i386
Ed Maste [Mon, 30 Jul 2018 12:58:33 +0000 (12:58 +0000)]
Regen src.conf.5 after r336901, WITH_LLD_BOOTSTRAP on i386

Sponsored by: The FreeBSD Foundation

5 years agoAs with DPCPU_DEFINE make it a compile error to use static with VNET_DEFINE.
Andrew Turner [Mon, 30 Jul 2018 12:44:44 +0000 (12:44 +0000)]
As with DPCPU_DEFINE make it a compile error to use static with VNET_DEFINE.
There is the VNET_DEFINE_STATIC macro for that.

5 years agoEnable ld.lld as bootstrap linker by default on i386
Ed Maste [Mon, 30 Jul 2018 12:38:08 +0000 (12:38 +0000)]
Enable ld.lld as bootstrap linker by default on i386

Akin to r327783 for amd64.  lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386.  These were
recently addressed upstream in lld and merged into FreeBSD or addressed
directly in FreeBSD (r326831, r326879, r326897, r326957, r333401,
r334626, r336664).

Similarly to the intial amd64 commit this change enables lld only as the
bootstrap linker (used to link the kernel and userland libraries and
executables), while GNU ld.bfd is still installed as /usr/bin/ld and
used for ports builds.  That will be changed shortly, after an exp-run.

This is a recommit of r327823 after additional lld fixes.

PR: 225128 (exp-run)
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

5 years agoDisable VIMAGE on RISC-V.
Ruslan Bukin [Mon, 30 Jul 2018 12:22:49 +0000 (12:22 +0000)]
Disable VIMAGE on RISC-V.

Similar to r326179 ("Temporarily disable VIMAGE on arm64") creation of
if_lagg or epair on RISC-V results a kernel panic.

Sponsored by: DARPA, AFRL