Commit graph

235155 commits

Author SHA1 Message Date
Ed Maste 800ab3e3c7 Use lld as the bootstrap linker on armv7 by default
As of r336972 lld is capable linking the armv7 kernel and userland,
so enable it by default.

PR:		229050
Reviewed by:	kevans
Tested by:	kevans
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16528
2018-08-01 19:17:55 +00:00
Hans Petter Selasky a76c73aadc Don't refer to non-existing atomic functions, even though not compiled,
in the LinuxKPI.

Found by:		rpolka @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2018-08-01 19:10:46 +00:00
Konstantin Belousov 61b285ac57 Avoid assertion in /dev/ufssuspend when the suspend ioctl is
(incorrectly) called while another suspension is already active.

PR:	230220
Reported by:	dexuan
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-08-01 19:06:55 +00:00
Konstantin Belousov 109de20b5a Add -D option to pciconf(8) to mmap and dump content of the device BAR.
Discussed with:	imp, jhb
Sponsored by:	The FreeBSD Foundation, Mellanox Technologies
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D15583
2018-08-01 19:02:05 +00:00
Konstantin Belousov 87842989f8 Add ioctl to conveniently mmap a PCI device BAR into userspace.
Add the ioctl PCIOCBARMMAP on /dev/pci to conveniently create
userspace mapping of a PCI device BAR.  This is enormously superior to
read the BAR value with PCIOCREAD and then try to mmap /dev/mem, and
should allow to automatically activate the mapped BARs when needed in
future.

Current implementation creates new sg pager for each user mmap
request.  If the pointer (and reference) to a managed device pager is
stored in pci_map, we would be able to revoke all mappings on the BAR
deactivation or relocation.  This is related to the unimplemented BAR
activation on mmap, and is postponed for the future.

Discussed with:	imp, jhb
Sponsored by:	The FreeBSD Foundation, Mellanox Technologies
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D15583
2018-08-01 18:58:24 +00:00
Mark Johnston c4c9cd8d68 Remove ARGS_NUM, accidentally left over after r337050. 2018-08-01 18:49:40 +00:00
Konstantin Belousov e45b89d23d Add pmap_is_valid_memattr(9).
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation, Mellanox Technologies
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15583
2018-08-01 18:45:51 +00:00
Mark Johnston 322dacf057 Don't hard-code the number of compression utility arguments.
The zstd invocation constructed by newsyslog contains one more parameter
than invocations for the other supported compression utilities.  However,
the maximum number of arguments was hard-coded, leading to an
out-of-bounds array access when using zstd compression.
2018-08-01 18:45:33 +00:00
Mark Johnston 995cd89924 Adjust the number of tests after r336913. 2018-08-01 18:41:43 +00:00
Konstantin Belousov c9bbc3ef29 Make cache coherency attributes definitions available in machine/vm.h on MIPS.
Move definitions from cpuregs.h into the cca.h, and include cca.h into vm.h.
This is required to make MIPS MD memattr definitions usable in userspace.

Sponsored by:	The FreeBSD Foundation, Mellanox Technologies
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15583
2018-08-01 18:35:17 +00:00
Ed Maste bd6313b66e libelf: reload section headers after update with ELF_C_WRITE
These issues (PR 218860 and PR 218861) are still undergoing additional
discussion in the upstream context and there may be additional changes
to come.

PR:		218860
Submitted by:	Eric McCorkle
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10486
2018-08-01 15:55:14 +00:00
Mark Johnston 8a5efe3601 Make sure that ENTRY() and END() refer to the same symbol.
X-MFC with:	r336876
2018-08-01 15:50:42 +00:00
Justin Hibbits 80a79189ef snd_hda: Synchronize DMA buffers for the control path
Make sure both sides of the DMA buffer memory accesses for the CORB and RIRB
(control buffers) in snd_hda (device and CPU) can see coherent memory.  This
is needed on weakly ordered architectures including PowerPC and ARM.  Patch
originally by mmel, with small changes.

This does not cover the data path of snd_hda.  We don't have sync operations
for in-progress DMA buffers, to sync ranges of a map.

Reviewed By: mmel
Differential Revision: https://reviews.freebsd.org/D16517
2018-08-01 14:50:41 +00:00
Mateusz Piotrowski 26e19acaeb Add a missing "Ar" macro to the description of the -R flag in the manpage.
Approved by:	bjk (doc committer), krion (mentor)
Differential Revision:	https://reviews.freebsd.org/D16520
2018-08-01 12:18:52 +00:00
Toomas Soome 8696ce6e29 libsa: assignment to char * from u_char *
Cast to char * instead of u_char *
2018-08-01 12:14:10 +00:00
Toomas Soome d07ea92f55 libsa: bootp is using pointers with different sign
Just change bp_file to char and same for variable s.
2018-08-01 12:06:39 +00:00
Toomas Soome eba1bc411b libsa: pointer differs in signedness
A small cleanup, fix the argument type and while there, replace (char *)0 with
NULL.
2018-08-01 11:40:52 +00:00
Ravi Pokala b598845049 Remove jedec_ts(4)
The jedec_ts(4) driver has been marked as deprecated in stable/11, and is
now being removed from -HEAD. Add a notice in UPDATING, and update the few
remaining references (regarding jedec_dimm(4)'s compatibility and history)
to reflect the fact that jedec_ts(4) is now deleted.

Reviewed by:	avg
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16537
2018-08-01 08:24:34 +00:00
Mark Johnston b151226550 Remove MT_NTYPES.
Its last reference was removed in r253361.
2018-08-01 03:52:48 +00:00
Mark Johnston 6324de037c Require that MAC label buffers be able to store a non-empty string.
The buffer size may be used to initialize an sbuf in
MAC_POLICY_EXTERNALIZE, and without this constraint it's possible to
trigger an assertion failure in the sbuf code.  With INVARIANTS
disabled, the first attempt to write to the sbuf will fail.

Reported by:	pho
Reviewed by:	delphij
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D16527
2018-08-01 03:46:07 +00:00
Alexander Motin 3c09eaee95 MFV r337029:
9426 metaslab size can exceed offset addressable by spacemap

metaslab size can exceed offset addressable by spacemap. The vdev can
address up to 2^63 * SPA_MAXBLOCKSIZE (512). A metaslab can address up to
2^47 * 2^vdev_ashift. Therefore we may need to increase the number of
metaslabs so that the maximum metaslab size is capped at the amount that
can be addressed by the spacemap. This should happen in
vdev_metaslab_set_size().

illumos/illumos-gate@b4bf0cf045

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Don Brady <don.brady@delphix.com>
2018-08-01 03:21:17 +00:00
Alexander Motin 2a44a23db2 9426 metaslab size can exceed offset addressable by spacemap
metaslab size can exceed offset addressable by spacemap. The vdev can
address up to 2^63 * SPA_MAXBLOCKSIZE (512). A metaslab can address up to
2^47 * 2^vdev_ashift. Therefore we may need to increase the number of
metaslabs so that the maximum metaslab size is capped at the amount that
can be addressed by the spacemap. This should happen in
vdev_metaslab_set_size().

illumos/illumos-gate@b4bf0cf045

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Don Brady <don.brady@delphix.com>
2018-08-01 03:19:30 +00:00
Alexander Motin e74aee0b25 MFV r337027:
9328 zap code can take advantage of c99
9329 panic in zap_leaf_lookup() due to concurrent zapification

illumos/illumos-gate@bf26014c55

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>
2018-08-01 03:07:33 +00:00
Alexander Motin 03a8ca5bd7 9328 zap code can take advantage of c99
9329 panic in zap_leaf_lookup() due to concurrent zapification

illumos/illumos-gate@bf26014c55

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>
2018-08-01 03:03:15 +00:00
Cy Schubert 4732295d5c As non-sparc64 undconditionally returns 1, simplify #ifdefs.
MFC after:	1 week
2018-08-01 02:59:56 +00:00
Alexander Motin f12261798c 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@fa98e487a9

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>
2018-08-01 02:39:44 +00:00
Marcelo Araujo be963beee6 - 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
2018-08-01 00:39:21 +00:00
Alexander Motin 82104b77fb 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@fa98e487a9

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>
2018-07-31 23:44:13 +00:00
Alexander Motin a5c4d9335b MFV r337020:9443 panic when scrub a v10 pool
illumos/illumos-gate@bb1f424574

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>
2018-07-31 23:00:58 +00:00
Alexander Motin b7b330afa0 9443 panic when scrub a v10 pool
illumos/illumos-gate@bb1f424574

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>
2018-07-31 22:59:48 +00:00
Michael Tuexen 7bda966394 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
2018-07-31 22:56:03 +00:00
Alexander Motin 200c27a75d 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@20b5dafb42

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>
2018-07-31 22:50:50 +00:00
Alexander Motin 5c1f905282 9237 "zpool add" fails for very large pools
illumos/illumos-gate@ae5ee1bd5e

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>
2018-07-31 21:42:31 +00:00
Mark Johnston 40fd44953c COMPAT_LINUX32 has not depended on COMPAT_43 in some time.
MFC after:	3 days
2018-07-31 21:40:13 +00:00
Alexander Motin b3e8109985 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@20b5dafb42

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>
2018-07-31 21:31:24 +00:00
Alexander Motin 2dcf06914e 9194 mechanism to override ashift at pool creation time
illumos/illumos-gate@93a1902e51

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>
2018-07-31 21:26:03 +00:00
Ed Maste 837f338599 bump lld version number after r336972 arm(v7) VFP tag support
Reported by:	kevans
Sponsored by:	The FreeBSD Foundation
2018-07-31 21:06:28 +00:00
Alexander Motin 0021e1c10c 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@094e47e980

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>
2018-07-31 21:06:04 +00:00
Emmanuel Vadot bc9ba24ffc 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
2018-07-31 20:50:50 +00:00
Alexander Motin 4f73289938 9434 Speculative prefetch is blocked by device removal code
illumos/illumos-gate@47b8d4b884

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>
2018-07-31 19:30:08 +00:00
Alexander Motin 5343ce649b Add new files missed in r336991. 2018-07-31 19:23:27 +00:00
Emmanuel Vadot 5a88ea3214 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
2018-07-31 19:14:52 +00:00
Emmanuel Vadot a8d0ee755c 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
2018-07-31 19:13:50 +00:00
Emmanuel Vadot 33bec6889a 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
2018-07-31 19:12:31 +00:00
Emmanuel Vadot 89f81528b3 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
2018-07-31 19:10:50 +00:00
Emmanuel Vadot cfe196fbed 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
2018-07-31 19:08:24 +00:00
Emmanuel Vadot 8608db1eb6 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
2018-07-31 18:57:11 +00:00
Emmanuel Vadot 3d62046d67 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
2018-07-31 18:55:44 +00:00
Emmanuel Vadot 2e81004069 release: rpi-b: add BOARDNAME variable
Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D16514
2018-07-31 18:54:06 +00:00
Emmanuel Vadot 8b66e85493 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
2018-07-31 18:52:43 +00:00