]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRevert r327005 - SPDX tags for license similar to BSD-2-Clause.
pfg [Wed, 20 Dec 2017 20:25:28 +0000 (20:25 +0000)]
Revert r327005 - SPDX tags for license similar to BSD-2-Clause.

After consultation with SPDX experts and their matching guidelines[1],
the licensing doesn't exactly match the BSD-2-Clause. It yet remains to be
determined if they are equivalent or if there is a recognized license that
matches but it is safer to just revert the tags.

Let this also be a reminder that on FreeBSD, SPDX tags are only advisory
and have no legal value (but IANAL).

Pointyhat to: pfg
Thanks to: Rodney Grimes, Gary O'Neall

[1] https://spdx.org/spdx-license-list/matching-guidelines

6 years agoAdd nvme wiring example
imp [Wed, 20 Dec 2017 19:14:20 +0000 (19:14 +0000)]
Add nvme wiring example
Add NVMe and MMC/SD card support info.

Sponsored by: Netflix

6 years agoSimplify the code a bit.
imp [Wed, 20 Dec 2017 19:14:16 +0000 (19:14 +0000)]
Simplify the code a bit.

Replace clumsy for(;;) { if (foo) break; ...} with simpler
while (!foo) { ... }.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546

6 years agoDocument new pci device hints wiring.
imp [Wed, 20 Dec 2017 19:14:11 +0000 (19:14 +0000)]
Document new pci device hints wiring.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546

6 years agoAdd device location wiring to the pci bus.
imp [Wed, 20 Dec 2017 19:14:05 +0000 (19:14 +0000)]
Add device location wiring to the pci bus.

This allows one to specify, for example, that if there's an igb card
in bus 12, slot 0, function 0, it should be assigned igb5. If there
isn't, or there's one in a different slot, normal numbering rules
apply (hinted units are skipped). Adding 'hint.igb.5.at="pci12:0:0"'
or 'hint.igb.5.at="pci0:12:0:0"' to /boot/device.hints will accomplish
this. The double quotes are important.

The kernel only accepts the strings (in shell notation):
pci$d:$b:$s:$f
and pci$b:$s:$f
where $d is the pci domain, $b is the pci bus number, $s is the slot
number and $f is the function number. A string compare is done with
the current device to avoid another string parser in the kernel. All
numbers are unsigned decimal without leading zeros.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546

6 years agoReturn domain, bus, slot, and function for the transport settings in
imp [Wed, 20 Dec 2017 19:13:55 +0000 (19:13 +0000)]
Return domain, bus, slot, and function for the transport settings in
PATH_INQ requests for nvme.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13546

6 years agoAdd a new kernel config option, MD_ROOT_READONLY, which forces on the
ian [Wed, 20 Dec 2017 18:23:22 +0000 (18:23 +0000)]
Add a new kernel config option, MD_ROOT_READONLY, which forces on the
MD_READONLY flag for the md device automatically instantiated during
kernel init for an mdroot filesystem.

Note that there is specifically and by design no tunable or sysctl
control over this feature.  Without this option, you already have control
over whether the mdroot fs is writeable using vfs.root.mountfrom.options
from loader(8), the root_rw_mount rcvar, and by using "mount -u[rw] /"
or equivelent on the fly.  This option is being added to provide a way
to make the mdroot fs truly immutable before userland code begins running.

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

6 years agoixgbe(4): Convert driver to use iflib
erj [Wed, 20 Dec 2017 18:15:06 +0000 (18:15 +0000)]
ixgbe(4): Convert driver to use iflib

Initial update to the ixgbe PF and VF drivers to support the iflib interface.

The PF driver version is bumped to 4.0.0, and the VF driver version is bumped to 2.0.0.

Special thanks to sbruno@ for the support in helping make this conversion happen.

Submitted by: Jeb Cramer <cramerj@intel.com>, Krzysztof Galazka (Chris) <krzysztof.galazka@intel.com>, Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reviewed by: sbruno@, shurd@, #IntelNetworking
Tested by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>, Sergey Kozlov <kozlov.sergey.404@gmail.com>
Sponsored by: Limelight Networks, Intel Corporation
Differential Revision: https://reviews.freebsd.org/D11727

6 years agoDon't ignore trailing spaces after numerical IP addresses.
ume [Wed, 20 Dec 2017 17:44:31 +0000 (17:44 +0000)]
Don't ignore trailing spaces after numerical IP addresses.

PR: 224403
Reported by: Michael Kaufmann
Reviewed by: Michael Kaufmann
MFC after: 1 week

6 years agoIncrease default MAXDSIZ to 32G on powerpc64
jhibbits [Wed, 20 Dec 2017 16:49:45 +0000 (16:49 +0000)]
Increase default MAXDSIZ to 32G on powerpc64

Linking LLVM now seems to require more than 1GB data size, so increase the
default to 32G, which matches amd64.

Reviewed by: nwhitehorn

6 years agoFlesh out the reason for the need for tmpfs a little.
imp [Wed, 20 Dec 2017 16:02:11 +0000 (16:02 +0000)]
Flesh out the reason for the need for tmpfs a little.

Sponsored by: Netflix

6 years agoSave others some forehead damange by noting that -r require tmpfs.
brd [Wed, 20 Dec 2017 15:21:29 +0000 (15:21 +0000)]
Save others some forehead damange by noting that -r require tmpfs.

Reviewed by: bapt

6 years agoMake truss(8) work for 32-bit CloudABI executables on ARM64.
ed [Wed, 20 Dec 2017 13:13:10 +0000 (13:13 +0000)]
Make truss(8) work for 32-bit CloudABI executables on ARM64.

This change effectively merges the existing 64-bit support for ARM64
with the 32-on-64-bit support for AMD64.

6 years agoAdd missing `;`
lwhsu [Wed, 20 Dec 2017 06:08:16 +0000 (06:08 +0000)]
Add missing `;`

Approved by: kevlo

6 years agoSupport attaching tx queues to cpus
shurd [Wed, 20 Dec 2017 01:03:34 +0000 (01:03 +0000)]
Support attaching tx queues to cpus

This will attempt to use a different thread/core on the same L2
cache when possible, or use the same cpu as the rx thread when not.
If SMP isn't enabled, don't go looking for cores to use. This is mostly
useful when using shared TX/RX queues.

Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12446

6 years agoDon't return early for non-failure for one of the EMLINK checks.
jhb [Tue, 19 Dec 2017 23:54:44 +0000 (23:54 +0000)]
Don't return early for non-failure for one of the EMLINK checks.

r326987 enabled two #if 0'd-out EMLINK checks in zfs_link_create() for
link overflow.  However, one of the checks (when the vnode adding a link
is a directory such as for mkdir) always returned even if the link did not
overflow.  Change this to only return early if it needs to report an
EMLINK error.

Reported by: db, shurd
Sponsored by: Chelsio Communications

6 years agoReplace one more LINK_MAX with NFS_LINK_MAX missed in r326991.
jhb [Tue, 19 Dec 2017 22:43:39 +0000 (22:43 +0000)]
Replace one more LINK_MAX with NFS_LINK_MAX missed in r326991.

Sponsored by: Chelsio Communications

6 years agoUpdate link count handling in fuse for post-ino64.
jhb [Tue, 19 Dec 2017 22:40:54 +0000 (22:40 +0000)]
Update link count handling in fuse for post-ino64.

Set FUSE_LINK_MAX to UINT32_MAX instead of LINK_MAX to match the maximum
link count possible in the 'nlink' field of 'struct fuse_attr'.

Sponsored by: Chelsio Communications

6 years agoSPDX: These are fundamentally BSD-2-Clause.
pfg [Tue, 19 Dec 2017 22:40:16 +0000 (22:40 +0000)]
SPDX: These are fundamentally BSD-2-Clause.

They just omit the introductory line and numbering.

6 years agoRework pathconf handling for FIFOs.
jhb [Tue, 19 Dec 2017 22:39:05 +0000 (22:39 +0000)]
Rework pathconf handling for FIFOs.

On the one hand, FIFOs should respect other variables not supported by
the fifofs vnode operation (such as _PC_NAME_MAX, _PC_LINK_MAX, etc.).
These values are fs-specific and must come from a fs-specific method.
On the other hand, filesystems that support FIFOs are required to
support _PC_PIPE_BUF on directory vnodes that can contain FIFOs.
Given this latter requirement, once the fs-specific VOP_PATHCONF
method supports _PC_PIPE_BUF for directories, it is also suitable for
FIFOs permitting a single VOP_PATHCONF method to be used for both
FIFOs and non-FIFOs.

To that end, retire all of the FIFO-specific pathconf methods from
filesystems and change FIFO-specific vnode operation switches to use
the existing fs-specific VOP_PATHCONF method.  For fifofs, set it's
VOP_PATHCONF to VOP_PANIC since it should no longer be used.

While here, move _PC_PIPE_BUF handling out of vop_stdpathconf() so that
only filesystems supporting FIFOs will report a value.  In addition,
only report a valid _PC_PIPE_BUF for directories and FIFOs.

Discussed with: bde
Reviewed by: kib (part of a larger patch)
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D12572

6 years agoAdd log messages for unknown and unhandled phy types
shurd [Tue, 19 Dec 2017 22:15:46 +0000 (22:15 +0000)]
Add log messages for unknown and unhandled phy types

Previously, it silently only supported auto, instead, log a message
indicating why only auto is supported.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D13358

6 years agoOn Link up & down, update media types
shurd [Tue, 19 Dec 2017 22:06:25 +0000 (22:06 +0000)]
On Link up & down, update media types

It's possible to change the SFP module when link is down, which would
change the available media types.  This is part of D13358.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Broadcom Limited

6 years agoSupport short HWRM commands
shurd [Tue, 19 Dec 2017 21:07:30 +0000 (21:07 +0000)]
Support short HWRM commands

New Stratus bnxt devices require support for short HWRM commands for VFs
to function.  Enable their use, but only use them if it's both supported
and required... prefer the long HWRM commands when possible.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D13269?id=36180

6 years agoDon't populate NVRAM sysctls for VFs
shurd [Tue, 19 Dec 2017 20:32:45 +0000 (20:32 +0000)]
Don't populate NVRAM sysctls for VFs

Only the PF allows NVRAM interaction on bnxt devices.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Broadcom Limited

6 years agoUpdate tmpfs link count handling for ino64.
jhb [Tue, 19 Dec 2017 20:19:07 +0000 (20:19 +0000)]
Update tmpfs link count handling for ino64.

Add a new TMPFS_LINK_MAX to use in place of LINK_MAX for link overflow
checks and pathconf() reporting.  Rather than storing a full 64-bit
link count, just use a plain int and use INT_MAX as TMPFS_LINK_MAX.

Discussed with: bde
Reviewed by: kib (part of a larger patch)
Sponsored by: Chelsio Communications

6 years agoHonor NANDFS_LINK_MAX for post-ino64.
jhb [Tue, 19 Dec 2017 20:17:07 +0000 (20:17 +0000)]
Honor NANDFS_LINK_MAX for post-ino64.

This uses NANDFS_LINK_MAX instead of LINK_MAX for link overflow checks
and the value reported by pathconf() / fpathconf().

Sponsored by: Chelsio Communications

6 years agoReport INT_MAX for LINK_MAX for devfs' VOP_PATHCONF().
jhb [Tue, 19 Dec 2017 20:07:57 +0000 (20:07 +0000)]
Report INT_MAX for LINK_MAX for devfs' VOP_PATHCONF().

devfs uses int's for link counts internally and already reports the the
full link count via stat() post ino64.

Sponsored by: Chelsio Communications

6 years agoUse FUSE_LINK_MAX for LINK_MAX in fuse' VOP_PATHCONF().
jhb [Tue, 19 Dec 2017 19:57:55 +0000 (19:57 +0000)]
Use FUSE_LINK_MAX for LINK_MAX in fuse' VOP_PATHCONF().

Should have included this in r326993.

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoHandle _PC_FILESIZEBITS and _PC_SYMLINK_MAX for devfs' VOP_PATHCONF().
jhb [Tue, 19 Dec 2017 19:53:34 +0000 (19:53 +0000)]
Handle _PC_FILESIZEBITS and _PC_SYMLINK_MAX for devfs' VOP_PATHCONF().

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoMove NAME_MAX, LINK_MAX, and CHOWN_RESTRICTED out of vop_stdpathconf().
jhb [Tue, 19 Dec 2017 19:51:36 +0000 (19:51 +0000)]
Move NAME_MAX, LINK_MAX, and CHOWN_RESTRICTED out of vop_stdpathconf().

Having all filesystems fall through to default values isn't always correct
and these values can vary for different filesystem implementations.  Most
of these changes just use the existing default values with a few exceptions:
- Don't report CHOWN_RESTRICTED for ZFS since it doesn't do the exact
  permissions check this claims for chown().
- Use NANDFS_NAME_LEN for NAME_MAX for nandfs.
- Don't report a LINK_MAX of 0 on smbfs.  Now fail with EINVAL to
  indicate hard links aren't supported.

Requested by: bde (though perhaps not this exact implementation)
Reviewed by: kib (earlier version)
MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoembed_mfs: support embedding mfs into loader
emaste [Tue, 19 Dec 2017 19:44:06 +0000 (19:44 +0000)]
embed_mfs: support embedding mfs into loader

The script originally supported embedding an mfs into ELF files or any
other type of file, because it searched for magic strings to mark the
beginning and end of the embeddable section. It was later modified to
read the section offset and length via readelf, which made it work for
ELF only. Restore the ability to update arbitrary file types by using
the readelf technique for ELF, and the magic string technique for all
others (including PE/COFF files like loader.efi).

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12746

6 years agoUpdate NFS to handle larger link counts post ino64.
jhb [Tue, 19 Dec 2017 19:18:48 +0000 (19:18 +0000)]
Update NFS to handle larger link counts post ino64.

- Define a NFS_LINK_MAX as UINT32_MAX to match the wire protocol.
- Use NFS_LINK_MAX instead of LINK_MAX as the fallback value reported
  for a PATHCONF RPC by the NFS server.
- Use NFS_LINK_MAX instead of LINK_MAX as the default value reported
  by the NFS client pathconf() if not overridden by the NFS server.
- When reading the link count out of an RPC reply, read the full 32
  bits instead of the lower 16 bits.

Reviewed by: rmacklem (earlier version)
Sponsored by: Chelsio Communications

6 years agoHandle _PC_FILESIZEBITS and _PC_NO_TRUNC for smbfs' VOP_PATHCONF().
jhb [Tue, 19 Dec 2017 19:14:01 +0000 (19:14 +0000)]
Handle _PC_FILESIZEBITS and _PC_NO_TRUNC for smbfs' VOP_PATHCONF().

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoSupport _PC_FILESIZEBITS in msdosfs' VOP_PATHCONF().
jhb [Tue, 19 Dec 2017 19:10:00 +0000 (19:10 +0000)]
Support _PC_FILESIZEBITS in msdosfs' VOP_PATHCONF().

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoAdd a custom VOP_PATHCONF method for fuse.
jhb [Tue, 19 Dec 2017 19:09:06 +0000 (19:09 +0000)]
Add a custom VOP_PATHCONF method for fuse.

This method handles _PC_FILESIZEBITS, _PC_SYMLINK_MAX, and _PC_NO_TRUNC.
For other values it defers to vop_stdpathconf().

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoAdjust ZFS' link count handling for ino64.
jhb [Tue, 19 Dec 2017 19:07:24 +0000 (19:07 +0000)]
Adjust ZFS' link count handling for ino64.

- Define a ZFS_LINK_MAX as the ZFS version of LINK_MAX which is set to
  UINT64_MAX to match the on-disk format.
- Enable the currently #if 0'd code to check for link overflows and
  return EMLINK.
- Don't clamp the link count reported in stat() to LINK_MAX as that is
  still the 16-bit limit, but report the full link counts.  Also,
  avoid possibly overflowing the reported link count to 0 when adjusting
  the link count to account for ".snapshot".
- Update the LINK_MAX reported by pathconf() to report ZFS_LINK_MAX
  rather than LINK_MAX (but clamped to LONG_MAX for 32-bit systems).

Reviewed by: avg (earlier version)
Sponsored by: Chelsio Communications

6 years agoAdd a custom VOP_PATHCONF method for fdescfs.
jhb [Tue, 19 Dec 2017 18:20:38 +0000 (18:20 +0000)]
Add a custom VOP_PATHCONF method for fdescfs.

The method handles NAME_MAX and LINK_MAX explicitly.  For all other
pathconf variables, the method passes the request down to the underlying
file descriptor.  This requires splitting a kern_fpathconf() syscallsubr
routine out of sys_fpathconf().  Also, to avoid lock order reversals with
vnode locks, the fdescfs vnode is unlocked around the call to
kern_fpathconf(), but with the usecount of the vnode bumped.

MFC after: 1 month
Sponsored by: Chelsio Communications

6 years agoAdd byte swapping in bnxt_cfg_async_cr() request
shurd [Tue, 19 Dec 2017 18:12:18 +0000 (18:12 +0000)]
Add byte swapping in bnxt_cfg_async_cr() request

The firmware is always in little endian, use htole*() for all request fields
larger than one byte.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Broadcom Limited

6 years agoUpdate Matthew Macy contact info
shurd [Tue, 19 Dec 2017 17:59:00 +0000 (17:59 +0000)]
Update Matthew Macy contact info

Email address has changed, uses consistent name (Matthew, not Matt)

Reported by: Matthew Macy <mmacy@mattmacy.io>
Differential Revision: https://reviews.freebsd.org/D13537

6 years agoAvoid using bioq_* in gmirror.
markj [Tue, 19 Dec 2017 17:13:04 +0000 (17:13 +0000)]
Avoid using bioq_* in gmirror.

gmirror does not perform any sorting of I/O requests, so the bioq API
doesn't provide any advantages over plain TAILQs. The API also does not
provide operations needed by an upcoming change.

No functional change intended. The diff shrinks the geom_mirror.ko
text and the gmirror softc slightly.

Tested by: pho (part of a larger patch)
MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoDocument the semantics of atomic_thread_fence operations.
alc [Tue, 19 Dec 2017 17:07:50 +0000 (17:07 +0000)]
Document the semantics of atomic_thread_fence operations.

Add atomic_load_<type> and atomic_store_<type>, and explain why they
exist.

Define the synchronizes-with relationship and its effects.

Reorder and revise some of the existing text.  For example, more
precisely describe when ordinary accesses are atomic.

Reviewed by: jhb, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13522

6 years agoThe highest-order bit of the bootloader cookie is 1, with the result that
nwhitehorn [Tue, 19 Dec 2017 16:45:40 +0000 (16:45 +0000)]
The highest-order bit of the bootloader cookie is 1, with the result that
the 32-bit cookie can be sign-extended on its way out of the loader and
through Open Firmware. If sign-extended, the in-kernel check of its value
would fail on 64-bit systems, resulting in a mountroot prompt. Solve this
by telling the kernel to ignore the high-order bits.

PR: kern/224437
Submitted by: Gustavo Romero

6 years agoMake __startkernel line up with KERNBASE, so that the math to compute the
nwhitehorn [Tue, 19 Dec 2017 15:50:46 +0000 (15:50 +0000)]
Make __startkernel line up with KERNBASE, so that the math to compute the
applied relocation offset in link_elf.c works as intended. We may want to
revisit how that works in future, for example by having elf_reloc_self()
actually store the numbers it is using rather than computing them later,
but this fixes symbol lookup after r326203.

Reported by: andreast@
Pointy hat to: me

6 years agomlx5en: Avoid SFENCe on x86
kib [Tue, 19 Dec 2017 14:11:41 +0000 (14:11 +0000)]
mlx5en: Avoid SFENCe on x86

The IA32 memory model guarantees that all writes are seen in the program
order.  Also, any access to the uncacheable memory flushes the store
buffers.  As the consequence, SFENCE instruction is (almost) never needed,
in particular, it is not needed to ensure the correct order of updates as
seen by a PCIe device.

Use atomic_thread_fence_rel() instead of wb() to only emit compiler barriers
on x86 there.  Other architectures get the right barrier instruction as
well.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoPerform all accesses to uma_reclaim_needed using atomic(9) KPI.
kib [Tue, 19 Dec 2017 10:06:55 +0000 (10:06 +0000)]
Perform all accesses to uma_reclaim_needed using atomic(9) KPI.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13534

6 years agoUse atomic_load(9) to read ppsinfo sequence numbers.
kib [Tue, 19 Dec 2017 10:05:45 +0000 (10:05 +0000)]
Use atomic_load(9) to read ppsinfo sequence numbers.

In this case volatile qualifiers enusre that a compiler does not
optimize the accesses out.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13534

6 years agoAdd atomic_load(9) and atomic_store(9) operations.
kib [Tue, 19 Dec 2017 09:59:20 +0000 (09:59 +0000)]
Add atomic_load(9) and atomic_store(9) operations.

They provide relaxed-ordered atomic access semantic.  Due to the
FreeBSD memory model, the operations are syntaxical wrappers around
the volatile accesses.  The volatile qualifier is used to ensure that
the access not optimized out and in turn depends on the volatile
semantic as implemented by supported compilers.

The motivation for adding the operation is to help people coming from
other systems or knowing the C11/C++ standards where atomics have
special type and require use of the special access operations.  It is
still the case that FreeBSD requires plain load and stores of aligned
integer types to be atomic.

Suggested by: jhb
Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13534

6 years agoWhen doing a dump, the scheduler is normally not running, so this
imp [Tue, 19 Dec 2017 04:13:22 +0000 (04:13 +0000)]
When doing a dump, the scheduler is normally not running, so this
changed worked to capture dumps for me. However, the test for
SCHEDULER_STOPPED() isn't right. We can also call the dump routine
from ddb, in which case the scheduler is still running. This leads to
an assertion panic that we're sleeping when we shouldn't. Instead, use
the proper test for dumping or not. This brings us in line with other
places that do special things while we're doing polled I/O like this.

Noticed by: pho@
Differential Revision: https://reviews.freebsd.org/D13531

6 years agoNo need to use relative paths like this here.
imp [Tue, 19 Dec 2017 04:06:07 +0000 (04:06 +0000)]
No need to use relative paths like this here.

Sponsored by: Netflix

6 years agoHoist btx include stuff to i386/Makefile.inc
imp [Tue, 19 Dec 2017 04:06:02 +0000 (04:06 +0000)]
Hoist btx include stuff to i386/Makefile.inc

Sponsored by: Netflix

6 years agoInteract is always called with NULL. Simplify code a little by
imp [Tue, 19 Dec 2017 04:05:55 +0000 (04:05 +0000)]
Interact is always called with NULL. Simplify code a little by
removing this argument, and expanding when rc is NULL. This
effectively completes the back out of custom scripts for tftp booted
loaders from r269153 that was started in r292344 with the new path
tricks that obsoleted it.

Submitted by: Netflix

6 years agoSimplify things a little. The RETURN macro isn't required. It's only
imp [Tue, 19 Dec 2017 04:05:43 +0000 (04:05 +0000)]
Simplify things a little. The RETURN macro isn't required. It's only
used once, inside an #ifdef where it would be defined to be return.

Sponsored by: Netflix

6 years agoarc lint: ignore /tests/ in chmod
eadler [Tue, 19 Dec 2017 03:38:06 +0000 (03:38 +0000)]
arc lint: ignore /tests/ in chmod

shell scripts in scripts don't need
to be chmod +x to work. In fact most are not.
Of the tests I found from a simple search:
65 are chmod +x
84 are chmod -x

simply disable the check for test shell scripts.

Recommit requested by: cem, rgrimes

6 years agoarclint: revert in prep for recommitting
eadler [Tue, 19 Dec 2017 03:35:39 +0000 (03:35 +0000)]
arclint: revert in prep for recommitting

6 years agolld: Don't write preemptible symbol values to the .got.
emaste [Tue, 19 Dec 2017 03:15:20 +0000 (03:15 +0000)]
lld: Don't write preemptible symbol values to the .got.

It is not necessary and matches what bfd and gold do.

This was a regression from [LLVM] r315658.

Obtained from: LLVM r321023 by Rafael Espíndola

6 years agoImplement ACPI CPU support when Processor object is not present
cem [Tue, 19 Dec 2017 02:49:11 +0000 (02:49 +0000)]
Implement ACPI CPU support when Processor object is not present

By the ACPI standard (ACPI 5 chapter 8.4 Declaring Processors) Processors
can be implemented in 2 distinct ways:

* Through a Processor object type (which provides P_BLK)
* Through a Device object type

Prior to this change, the FreeBSD driver only supported the former.  AMD
Epyc / Poweredge systems we are testing both implement the latter only.  Add
the missing support.

Because P_BLK is not defined in the device object case, C-states entering
must be completely controlled via _CST methods rather than P_LVL2/3.

John Baldwin points out that ACPI 6.0 formally deprecates the Processor
keyword, so eventually processors will only be enumerated as Device objects.

Submitted by: attilio
Reviewed by: jhb, markj, Anton Rang <rang AT acm.org>
Relnotes: maybe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13457

6 years agoSupport more images (but still no geli)
imp [Tue, 19 Dec 2017 00:18:17 +0000 (00:18 +0000)]
Support more images (but still no geli)
Print a qemu line to a shell script to ease testing each image
Start to support multiple architectures (still very green)
Create /etc/rc that echos success and halts the system for better
automation (also include halt)
Create /etc/fstab on a per-boot type to test loader's passing root
to kernel.

This lets me run a test, connect to it with telnet and get either a
timeout, or a report of success.

Sponsored by: Netflix

6 years agoCatch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies.
jhb [Mon, 18 Dec 2017 23:35:14 +0000 (23:35 +0000)]
Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies.

Some of the ptrace tests need to wait for a child process to become a
zombie before preceding.  The parent process polls the child process
via the kern.proc.pid sysctl to wait for it to become a zombie.
Previously the code polled until the sysctl failed with ESRCH.  Now it
will poll until either the sysctl fails with ESRCH (for compatiblity
with older kernels) or returns a kinfo_proc structure with the ki_stat
field set to SZOMB.

Reported by: Jenkins
Tested by: markj
Discussed with: mjg
MFC after: 1 week

6 years agoAlthough we only have one quirk at the moment, guard against the day
imp [Mon, 18 Dec 2017 20:11:21 +0000 (20:11 +0000)]
Although we only have one quirk at the moment, guard against the day
we have more than one by checking the actual quirk bit before delaying
the reset.

Noticed by: rpokala@

6 years agoWhen we're disabling the nvme device, some drives have a controller
imp [Mon, 18 Dec 2017 18:38:00 +0000 (18:38 +0000)]
When we're disabling the nvme device, some drives have a controller
bug that requires 'hands off' for a period of time (2.3s) before we
check the RDY bit. Sicne this is a very odd quirk for a very limited
selection of drives, do this as a quirk. This prevented a successful
reset of the card when the card wedged.

Also, make sure that we comply with the advice from section 3.1.5 of
the 1.3 spec says that transitioning CC.EN from 0 to 1 when CSTS.RDY
is 1 or transitioning CC.EN from 1 to 0 when CSTS.RDY is 0 "has
undefined results". Short circuit when EN == RDY == desired state.

Finally, fail the reset if the disable fails. This will lead to a
failed device, which is what we want. (note: nda device needs
work for coping with a failed device).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13389

6 years agoAvoid CPU migration in dtrace_gethrtime() on x86.
markj [Mon, 18 Dec 2017 17:26:24 +0000 (17:26 +0000)]
Avoid CPU migration in dtrace_gethrtime() on x86.

dtrace_gethrtime() may be called outside of probe context, and in
particular, from the DTRACEIOC_BUFSNAP handler.

Disable interrupts rather than using sched_pin() to help ensure that
we don't call any external functions when in probe context.

PR: 218452
MFC after: 1 week

6 years agoAlso forgotten in the previous that removed the permanent double mapping
bde [Mon, 18 Dec 2017 14:29:48 +0000 (14:29 +0000)]
Also forgotten in the previous that removed the permanent double mapping
of low physical memory:

Update the comment about leaving the permanent mapping in place.  This
also improves the wording of the comment.  PTD 0 is still left alone
because it is fairly important that it was unmapped earlier, and the
comment now describes the unmapping of the other low PTDs that the code
actually does.

Reviewed by: kib

6 years agoRemove the permanent double mapping of low physical memory and replace
bde [Mon, 18 Dec 2017 13:53:22 +0000 (13:53 +0000)]
Remove the permanent double mapping of low physical memory and replace
it by a transient double mapping for the one instruction in ACPI wakeup
where it is needed (and for many surrounding instructions in ACPI resume).
Invalidate the TLB as soon as convenient after undoing the transient
mapping.  ACPI resume already has the strict ordering needed for this.

This fixes the non-trapping of null pointers and other garbage pointers
below NBPDR (except transiently).  NBPDR is quite large (4MB, or 2MB for
PAE).

This fixes spurious traps at the first instruction in VM86 bioscalls.
The traps are for transiently missing read permission in the first
VM86 page (physical page 0) which was just written to at KERNBASE in
the kernel.  The mechanism is unknown (it is not simply PG_G).

locore uses a similar but larger transient double mapping and needs
it for 2 instructions instead of 1.  Unmap the first PDE in it after
the 2 instructions to detect most garbage pointers while bootstrapping.
pmap_bootstrap() finishes the unmapping.

Remove the avoidance of the double mapping for a recently fixed special
case.  ACPI resume could use this avoidance (made non-special) to avoid
any problems with the transient double mapping, but no such problems
are known.

Update comments in locore.  Many were for old versions of FreeBSD which
tried to map low memory r/o except for special cases, or might have
allowed access to low memory via physical offsets.  Now all kernel
maps are r/w, and removal of of the double map disallows use of physical
offsets again.

6 years agoFix the undersupported option KERNLOAD, part 2: fix crashes in locore
bde [Mon, 18 Dec 2017 11:57:05 +0000 (11:57 +0000)]
Fix the undersupported option KERNLOAD, part 2: fix crashes in locore
when KERNLOAD is smaller than NBPDR (not the default) and PG_G is
enabled (the default if the CPU supports it).  This case has relatively
minor problems with coherency of the permanent double mapping, but the
fix in r167869 to improve coherency creates page tables with 3 different
errors so never worked.

The permanent double mapping is fundamentally broken and will be removed
soon.  It fundamentally breaks trapping for null pointers and requires
complications to avoid cache coherency bugs.  It is currently used for
only a single instruction in ACPI resume,

Many fixes VM86 and/or ACPI and/or the double map were attempted near
r1200000.  r167869 attempted to fix cache coherency bugs in an unusual
case, but the bugs were unreachable because older errors in page tables
caused a crash first.

This commit just makes r167869 work as intended.  Part 1 of these fixes
fixed the other errors, but also stopped mapping the PDE for KERNBASE
as a large page, so double mapping of this PDE only causes the same
problems as when KERNLOAD is the default.  Except for the problem of
trapping null pointers, r167869 could be used to fix these problems,
but it is inactive in usual cases.  The only known other problem is
that incoherent permissions for page 0 cause spurious traps in VM86
BIOS calls.

Reviewed by: kib

6 years agonewsyslog: Fix issues after r326616
bapt [Mon, 18 Dec 2017 09:35:04 +0000 (09:35 +0000)]
newsyslog: Fix issues after r326616

When building the command to execute for compression, newsyslog was modifying
the generic arguments array instead of its own copy.
Meaning on the second file to compress with the same arguments, the command line
was not the one expected.
Fix it by creating one copy of the arguments per execution and modifying that
copy.

While here, print the command line executed in verbose mode.

Reported by: many

6 years agoFix the undersupported option KERNLOAD, part 1: fix crashes in locore
bde [Mon, 18 Dec 2017 09:32:56 +0000 (09:32 +0000)]
Fix the undersupported option KERNLOAD, part 1: fix crashes in locore
when KERNLOAD is not a multiple of NBPDR (not the default) and PSE is
enabled (the default if the CPU supports it).  Addresses in PDEs must
be a multiple of NBPDR in the PSE case, but were not so in the crashing
case.

KERNLOAD defaults to NBPDR.  NBPDR is 4 MB for !PAE and 2 MB for PAE.
The default can be changed by editing i386/include/vmparam.h or using
makeoptions.  It can be changed to less than NBPDR to save real and
virtual memory at a small cost in time, or to more than NBPDR to waste
real and virtual memory.  It must be larger than 1 MB and a multiple of
PAGE_SIZE.  When it is less than NBPDR, it is necessarily not a multiple
of NBPDR.  This case has much larger bugs which will be fixed in part 2.

The fix is to only use PSE for physical addresses above <KERNLOAD
rounded _up_ to an NBPDR boundary>.  When the rounding is non-null,
this leaves part of the kernel not using large pages.  Rounding down
would avoid this pessimization, but would break setting of PAT bits
on i/o pages if it goes below 1MB.  Since rounding down always goes
below 1MB when KERNLOAD < NBPDR and the KERNLOAD > NBPDR case is not
useful, never round down.

Fix related style bugs (e.g., wrong literal values for NBPDR in comments).

Reviewed by: kib

6 years agolibficl is only ever used in a loader (never a boot) program. Move it
imp [Mon, 18 Dec 2017 04:51:45 +0000 (04:51 +0000)]
libficl is only ever used in a loader (never a boot) program. Move it
to loader.mk.

Sponsored by: Netflix

6 years agoMove loader help file definitions to being 100% inside of loader.mk.
imp [Mon, 18 Dec 2017 04:51:34 +0000 (04:51 +0000)]
Move loader help file definitions to being 100% inside of loader.mk.

HELP_FILES is a loader only thing, so move it to loader.mk. Only
generate the help file if HELP_FILES is defined. Adjust Makefiles to
new convention. Fix a few cases where ${.CURDIR}/ was missing
resulting in missing bits from the help files.

Sponsored by: Netflix

6 years agoDo not attempt to refill the TX fifo if there is no data left to transfer.
ian [Mon, 18 Dec 2017 02:34:37 +0000 (02:34 +0000)]
Do not attempt to refill the TX fifo if there is no data left to transfer.

A comment in bcm_bsc_fill_tx_fifo() even lists sc_totlen > 0 as a
precondition for calling the routine.   I apparently forgot to make the
code do what my comment said.

6 years agoFix debugging output, fallout from something like s/read/readctl/g
ian [Mon, 18 Dec 2017 00:15:53 +0000 (00:15 +0000)]
Fix debugging output, fallout from something like s/read/readctl/g
while renaming variables in a previous change.

6 years agoUnregister the ARC lowmem event handler earlier in arc_fini().
markj [Sun, 17 Dec 2017 18:21:40 +0000 (18:21 +0000)]
Unregister the ARC lowmem event handler earlier in arc_fini().

Otherwise a poorly timed lowmem event may attempt to acquire a destroyed
lock. Unregister the handler before destroying the ARC reclaim thread.

Reported by: gjb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13480

6 years agoMove loader-only defines to loader.mk from defs.mk
imp [Sat, 16 Dec 2017 21:33:21 +0000 (21:33 +0000)]
Move loader-only defines to loader.mk from defs.mk

Produces the same .o's, verified with md5.

Sponsored by: Netflix

6 years agoSync with NetBSD's /usr/share/dict/words, with the exception of quim
imp [Sat, 16 Dec 2017 20:25:50 +0000 (20:25 +0000)]
Sync with NetBSD's /usr/share/dict/words, with the exception of quim
due to its vulgar nature.

Submitted by: sevan@
Differential Revision: https://reviews.freebsd.org/D13510

6 years agoFix a logic bug in makefs lazy inode initialization.
markj [Sat, 16 Dec 2017 20:19:00 +0000 (20:19 +0000)]
Fix a logic bug in makefs lazy inode initialization.

We may need to initialize multiple inode blocks before writing a given
inode. makefs(8) was only initializing a single block at a time, so
certain inode allocation patterns could lead to a situation where it
wrote an inode to an uninitialized block. That inode might be clobbered
by a later initialization, resulting in a filesystem image containing
directory entries that point to a seemingly unused inode.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13505

6 years agoMake truss(8) work for i686-unknown-cloudabi binaries on FreeBSD/amd64.
ed [Sat, 16 Dec 2017 19:40:28 +0000 (19:40 +0000)]
Make truss(8) work for i686-unknown-cloudabi binaries on FreeBSD/amd64.

This change copies the existing amd64_cloudabi64.c to amd64_cloudabi32.c
and reimplements the functions for fetching system call arguments and
return values to use the same scheme as used by the vDSO that is used
when running cloudabi32 executables.

As arguments are automatically padded to 64-bit words by the vDSO in
userspace, we can copy the arguments directly into the array used by
truss(8) internally.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D13516

6 years agolibsysdecode: Add a new ABI type, SYSDECODE_ABI_CLOUDABI32.
ed [Sat, 16 Dec 2017 19:37:55 +0000 (19:37 +0000)]
libsysdecode: Add a new ABI type, SYSDECODE_ABI_CLOUDABI32.

In order to let truss(8) support tracing of 32-bit CloudABI
applications, we need to add a new ABI type to libsysdecode. We can
reuse the existing errno mapping table. Also link in the cloudabi32
system call table to translate system call names.

While there, remove all of the architecture ifdefs. There are not
needed, as the CloudABI data types and system call tables build fine on
any architecture. Building this unconditionally will make it easier to
do tracing for different compat modes, emulation, etc.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D13516

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sat, 16 Dec 2017 18:06:30 +0000 (18:06 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.1 release (upstream r320880).

Relnotes: yes
MFC after: 2 weeks

6 years agorevert r322589: force use of ld.bfd for linking i386 libc
emaste [Sat, 16 Dec 2017 15:17:54 +0000 (15:17 +0000)]
revert r322589: force use of ld.bfd for linking i386 libc

As of r326897 ld.lld can link a working i386 libc.so, so we no longer
need to force use of ld.bfd.

Sponsored by: The FreeBSD Foundation

6 years agoFix possible memory leak.
ae [Sat, 16 Dec 2017 14:36:21 +0000 (14:36 +0000)]
Fix possible memory leak.

vxlan_ftable entries are sorted in ascending order, due to wrong arguments
order it is possible to stop search before existing element will be found.
Then new element will be allocated in vxlan_ftable_update_locked() and can
be inserted in the list second time or trigger MPASS() assertion with
enabled INVARIANTS.

PR: 224371
MFC after: 1 week

6 years agolld: Slightly simplify code and add comment.
emaste [Sat, 16 Dec 2017 14:26:11 +0000 (14:26 +0000)]
lld: Slightly simplify code and add comment.

Cherry-pick lld r315658 by Rui Ueyama:
    This is not a mechanical transformation. Even though I believe this
    patch is correct, I'm not 100% sure if lld with this patch behaves
    exactly the same way as before on all edge cases. At least all tests
    still pass.

    I'm submitting this patch because it took almost a day to understand
    this function, and I don't want to lose it.

This fixes jemalloc assertion failures observed at startup with i386
binaries and an lld-linked libc.so.

Reviewed by: dim
Obtained from: LLVM r315658
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13503

6 years agoRemove white space at EOL.
schweikh [Sat, 16 Dec 2017 12:23:59 +0000 (12:23 +0000)]
Remove white space at EOL.

6 years agoCorrect a typo; remove white space at EOL.
schweikh [Sat, 16 Dec 2017 11:49:30 +0000 (11:49 +0000)]
Correct a typo; remove white space at EOL.

6 years agobhnd(4): Fix the pa0itssit/pa1itssit NVRAM variable type definitions
landonf [Sat, 16 Dec 2017 05:22:16 +0000 (05:22 +0000)]
bhnd(4): Fix the pa0itssit/pa1itssit NVRAM variable type definitions
required by bwn(4); idle TSSI target values are expressed as signed
integers.

Sponsored by: The FreeBSD Foundation

6 years agobhndb(4): Enable addrext support on DMA64 devices, and fix an incorrect DMA
landonf [Sat, 16 Dec 2017 04:35:37 +0000 (04:35 +0000)]
bhndb(4): Enable addrext support on DMA64 devices, and fix an incorrect DMA
DMA boundary constraint applied in bhndb_dma_tag_create().

Sponsored by: The FreeBSD Foundation

6 years agoNote GELI-enabled zfsboot issues have been solved. Flip the switch
imp [Fri, 15 Dec 2017 23:19:49 +0000 (23:19 +0000)]
Note GELI-enabled zfsboot issues have been solved. Flip the switch
back to enabling GELI in boot and loader builds.

Sponsored by: Netflix

6 years agoRemove the 'mini libstand in libstand' that util.[ch] provided. These
imp [Fri, 15 Dec 2017 23:16:53 +0000 (23:16 +0000)]
Remove the 'mini libstand in libstand' that util.[ch] provided. These
weren't needed, and their existance interfered with things in subtle
ways. One of these subtle ways was that malloc could be different
based on what files were included when (even within the same .c file,
it turns out). Move to a single malloc implementation as well by
adding the calls to setheap() to gptboot.c and zfsboot.c. Once upon a
time, these boot loaders strove to not use libstand. However, with the
proliferation of features, that striving is too hard for too little
gain and lead to stupid mistakes.

This fixes the GELI-enabled (but not even using) boot environment. The
geli routines were calling libstand malloc but zfsboot.c and gptboot.c
were using the mini libstand malloc, so this failed when we tried to
probe for GELI partitions. Subtle changes in build order when moving
to self-contained stand build in r326593 toggled what it used from one
type to another due to odd nesting of the zfs implementation code that
differed subtly between zfsloader and zfsboot.

Sponsored by: Netflix

6 years agoPanic in sbrk if setheap hasn't been called yet. This is preferable to
imp [Fri, 15 Dec 2017 23:16:47 +0000 (23:16 +0000)]
Panic in sbrk if setheap hasn't been called yet. This is preferable to
a mysterious crash.

Sponsored by: Netflix

6 years agoUse -h -D in preference to -D so that the serial port gets the
imp [Fri, 15 Dec 2017 23:16:42 +0000 (23:16 +0000)]
Use -h -D in preference to -D so that the serial port gets the
interactive console rather than the video port. qemu has issues with X
on my mac at the moment and this is the easiest path forward.

Sponsored by: Netflix

6 years agoBe a little verbose and list the loader files we're putting on the
imp [Fri, 15 Dec 2017 23:16:37 +0000 (23:16 +0000)]
Be a little verbose and list the loader files we're putting on the
drive when making zfs roots as a sanity check for what's on there.

6 years agoFor now, make the gpart commands verbose so we know exactly what's
imp [Fri, 15 Dec 2017 23:16:27 +0000 (23:16 +0000)]
For now, make the gpart commands verbose so we know exactly what's
being installed.

Fix problem with gpt + zfs installing the wrong loader...

Sponsored by: Netflix

6 years agoGive a couple of predication functions a bool return type.
markj [Fri, 15 Dec 2017 19:14:21 +0000 (19:14 +0000)]
Give a couple of predication functions a bool return type.

No functional change intended.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoTypo.
markj [Fri, 15 Dec 2017 19:03:03 +0000 (19:03 +0000)]
Typo.

MFC after: 1 week

6 years agoPull in r320755 from upstream clang trunk (by me):
dim [Fri, 15 Dec 2017 18:58:21 +0000 (18:58 +0000)]
Pull in r320755 from upstream clang trunk (by me):

  Don't trigger -Wuser-defined-literals for system headers

  Summary:
  In D41064, I proposed adding `#pragma clang diagnostic ignored
  "-Wuser-defined-literals"` to some of libc++'s headers, since these
  warnings are now triggered by clang's new `-std=gnu++14` default:

  $ cat test.cpp
  #include <string>

  $ clang -std=c++14 -Wsystem-headers -Wall -Wextra -c test.cpp
  In file included from test.cpp:1:
  In file included from /usr/include/c++/v1/string:470:
  /usr/include/c++/v1/string_view:763:29: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char> operator "" sv(const char *__str, size_t __len)
                              ^
  /usr/include/c++/v1/string_view:769:32: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
                                 ^
  /usr/include/c++/v1/string_view:775:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
                                  ^
  /usr/include/c++/v1/string_view:781:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
                                  ^
  In file included from test.cpp:1:
  /usr/include/c++/v1/string:4012:24: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char> operator "" s( const char *__str, size_t __len )
                         ^
  /usr/include/c++/v1/string:4018:27: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
                            ^
  /usr/include/c++/v1/string:4024:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len )
                             ^
  /usr/include/c++/v1/string:4030:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
      basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
                             ^
  8 warnings generated.

  Both @aaron.ballman and @mclow.lists felt that adding this workaround
  to the libc++ headers was the wrong way, and it should be fixed in
  clang instead.

  Here is a proposal to do just that.  I verified that this suppresses
  the warning, even when -Wsystem-headers is used, and that the warning
  is still emitted for a declaration outside of system headers.

  Reviewers: aaron.ballman, mclow.lists, rsmith

  Reviewed By: aaron.ballman

  Subscribers: mclow.lists, aaron.ballman, andrew, emaste, cfe-commits

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

This will allow to compile some of the libc++ headers in C++14 mode
(which is the default for gcc 6 and higher, and will be the default for
clang 6.0.0 and higher), with -Wsystem-headers and -Werror enabled.

Reported by: andrew
MFC after: 3 days

6 years agolld: Simplify a boolean expression by De Morgan's laws.
emaste [Fri, 15 Dec 2017 18:56:12 +0000 (18:56 +0000)]
lld: Simplify a boolean expression by De Morgan's laws.

Cherry-pick lld r315653 by Rui Ueyama:
    I don't really understand what exactly this expression means,
    but at least I can mechanically transform it.

Obtained from: LLVM r315653
MFC after: 1 week

6 years agoMark uctf/err.user64mode.ksh as EXFAIL for now.
markj [Fri, 15 Dec 2017 18:09:23 +0000 (18:09 +0000)]
Mark uctf/err.user64mode.ksh as EXFAIL for now.

MFC after: 1 week

6 years agoSkip gnop tests if the corresponding kernel module isn't available.
markj [Fri, 15 Dec 2017 17:10:51 +0000 (17:10 +0000)]
Skip gnop tests if the corresponding kernel module isn't available.

Reviewed by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13500

6 years agoFollow the RFC6980 and silently ignore following IPv6 NDP messages
ae [Fri, 15 Dec 2017 12:37:32 +0000 (12:37 +0000)]
Follow the RFC6980 and silently ignore following IPv6 NDP messages
that had the IPv6 fragmentation header:
 o  Neighbor Solicitation
 o  Neighbor Advertisement
 o  Router Solicitation
 o  Router Advertisement
 o  Redirect

Introduce M_FRAGMENTED mbuf flag, and set it after IPv6 fragment reassembly
is completed. Then check the presence of this flag in correspondig ND6
handling routines.

PR: 224247
MFC after: 2 weeks

6 years agoAdd missing of=/dev/${dev}s${s} when installing zfsboot.
imp [Fri, 15 Dec 2017 06:44:11 +0000 (06:44 +0000)]
Add missing of=/dev/${dev}s${s} when installing zfsboot.

6 years agoScript to generate minimal boot images for each of the 24 supported
imp [Fri, 15 Dec 2017 06:34:27 +0000 (06:34 +0000)]
Script to generate minimal boot images for each of the 24 supported
boot images for x86. This will be enhanced to generate all the other
images (u-boot, powerpc CHRP, etc).

At the moment, it's only generating three of them. zfs+gpt+legacy
works with qemu:
qemu-system-x86_64 --drive file=${file},format=raw -serial telnet::4444,server
but the ufs ones still have issues I'm tracking down.

These images are the boot blocks, /boot/loader, a kernel, maybe a
couple of modules, /sbin/init, /bin/sh, /libexec/ld-elf.so, libc.so,
libedit and libncursesw. This is just enough to get to single user. At
the moment, these come from the host system, but should come from
OBJTOP.

At the moment, this requires root to build since the zfs tools require
it (and GELI will too when we add support for that).

Sponsored by: Netflix

6 years agoScript that knows how to put boot blocks onto a device. Eventually,
imp [Fri, 15 Dec 2017 06:34:11 +0000 (06:34 +0000)]
Script that knows how to put boot blocks onto a device.  Eventually,
this will be installed into /usr/sbin, but for now it's just used for
the boot loader regression script. It's still a bit green, and likely
will get edge cases wrong still. It's also x86 centric at the moment,
but will be enhanced shortly for u-boot, CHRP PowerPC and other
methods.

Sponsored by: Netflix