]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoproccontrol(1): Add kpti control mode.
kib [Sat, 16 Mar 2019 11:46:48 +0000 (11:46 +0000)]
proccontrol(1): Add kpti control mode.

Requested by: jhb
Reviewed by: jhb, markj (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19514

5 years agoamd64 KPTI: add control from procctl(2).
kib [Sat, 16 Mar 2019 11:44:33 +0000 (11:44 +0000)]
amd64 KPTI: add control from procctl(2).

Add the infrastructure to allow MD procctl(2) commands, and use it to
introduce amd64 PTI control and reporting.  PTI mode cannot be
modified for existing pmap, the knob controls PTI of the new vmspace
created on exec.

Requested by: jhb
Reviewed by: jhb, markj (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19514

5 years agoamd64: Add md process flags and first P_MD_PTI flag.
kib [Sat, 16 Mar 2019 11:31:01 +0000 (11:31 +0000)]
amd64: Add md process flags and first P_MD_PTI flag.

PTI mode for the process pmap on exec is activated iff P_MD_PTI is set.

On exec, the existing vmspace can be reused only if pti mode of the
pmap matches the P_MD_PTI flag of the process.  Add MD
cpu_exec_vmspace_reuse() callback for exec_new_vmspace() which can
vetoed reuse of the existing vmspace.

MFC note: md_flags change struct proc KBI.

Reviewed by: jhb, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19514

5 years agoamd64: fix switching to the pmap with pti disabled.
kib [Sat, 16 Mar 2019 11:16:09 +0000 (11:16 +0000)]
amd64: fix switching to the pmap with pti disabled.

When the pmap with pti disabled (i.e. pm_ucr3 == PMAP_NO_CR3) is
activated, tss.rsp0 was not updated.  Any interrupt that happen before
next context switch would use pti trampoline stack for hardware frame
but fault and interrupt handlers are not prepared to this.  Correctly
update tss.rsp0 for both PMAP_NO_CR3 and pti pmaps.

Note that this case, pti = 1 but pmap->pm_ucr3 == PMAP_NO_CR3 is not
used at the moment.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19514

5 years agoamd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch.
kib [Sat, 16 Mar 2019 11:12:02 +0000 (11:12 +0000)]
amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch.

New code avoids jumps.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19514

5 years agopf: Rename pfsync bucket lock
kp [Sat, 16 Mar 2019 10:14:03 +0000 (10:14 +0000)]
pf: Rename pfsync bucket lock

Previously the main pfsync lock and the bucket locks shared the same name.
This lead to spurious warnings from WITNESS like this:

    acquiring duplicate lock of same type: "pfsync"
     1st pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1402
     2nd pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1429

It's perfectly okay to grab both the main pfsync lock and a bucket lock at the
same time.

We don't need different names for each bucket lock, because we should always
only acquire a single one of those at a time.

MFC after: 1 week

5 years agoRemove empty directory left by r342255.
jmallett [Sat, 16 Mar 2019 06:12:28 +0000 (06:12 +0000)]
Remove empty directory left by r342255.

5 years agoRemove obsolete wrappers for 64-bit loads/stores which were only used by the
jmallett [Sat, 16 Mar 2019 06:09:45 +0000 (06:09 +0000)]
Remove obsolete wrappers for 64-bit loads/stores which were only used by the
removed (r342255) SiByte port.

Reviewed by: imp

5 years agoFix build for KLD dyn_sysctl example
gonzo [Sat, 16 Mar 2019 04:24:02 +0000 (04:24 +0000)]
Fix build for KLD dyn_sysctl example

Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE

PR: 236139
Submitted by: Andrew Reiter <arr@watson.org>
MFC after: 1 week

5 years agoRemove duplicate `${PACKAGE}FILES+= cleanup.ksh` line
ngie [Sat, 16 Mar 2019 03:37:47 +0000 (03:37 +0000)]
Remove duplicate `${PACKAGE}FILES+= cleanup.ksh` line

This mutes the duplicate target warning emitted via bsd.files.mk each build.

MFC after: 1 week
Reviewed by: asomers
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D19603

5 years agofuse(4): add tests for the FOPEN_KEEP_CACHE option
asomers [Fri, 15 Mar 2019 22:47:20 +0000 (22:47 +0000)]
fuse(4): add tests for the FOPEN_KEEP_CACHE option

PR: 236560
Sponsored by: The FreeBSD Foundation

5 years agostack(9): Drop unused API mode and comment that referenced it
cem [Fri, 15 Mar 2019 22:39:55 +0000 (22:39 +0000)]
stack(9): Drop unused API mode and comment that referenced it

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D19601

5 years agoIntegrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite
ngie [Fri, 15 Mar 2019 21:49:19 +0000 (21:49 +0000)]
Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite

This change integrates the unit tests for zfsd into the test suite using the
integration method described in r345203.

This change removes the `LOCALBASE` includes added for the port version of
googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS`
defines, which are included in the `GTEST_CXXFLAGS` variable, as part of
r345203.

Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 2 months
MFC with: r345203
Differential Revision: https://reviews.freebsd.org/D19552

5 years agoRegenerate src.conf(5) after r345203 (MK_GOOGLETEST addition)
ngie [Fri, 15 Mar 2019 21:46:54 +0000 (21:46 +0000)]
Regenerate src.conf(5) after r345203 (MK_GOOGLETEST addition)

MFC after: 2 months
MFC with: r345203
Approved by: emaste (mentor; implicit: https://reviews.freebsd.org/D19551)

5 years agoInitial googlemock/googletest integration into the build/FreeBSD test suite
ngie [Fri, 15 Mar 2019 21:43:52 +0000 (21:43 +0000)]
Initial googlemock/googletest integration into the build/FreeBSD test suite

This initial integration takes googlemock/googletest release 1.8.1, integrates
the library, tests, and sample unit tests into the build.

googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`.
`MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when
built with a C++11 capable toolchain.

Google tests can be specified via the `GTESTS` variable, which, in comparison
with the other test drivers, is more simplified/streamlined, as Googletest only
supports C++ tests; not raw C or shell tests (C tests can be written in C++
using the standard embedding methods).

No dependent libraries are assumed for the tests. One must specify `gmock`,
`gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program.

More information about googlemock and googletest can be found on the
Googletest [project page](https://github.com/google/googletest), and the
[GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md)
and
[GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs)
docs.

These tests are originally integrated into the build as plain driver tests, but
will be natively integrated into Kyua in a later version.

Known issues/Errata:
* [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172)

Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D19551

5 years agoVOP_INACTIVE(9): clarify wording
asomers [Fri, 15 Mar 2019 21:11:47 +0000 (21:11 +0000)]
VOP_INACTIVE(9): clarify wording

Reviewed by: kib, 0mp
MFC after:  2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19596

5 years agofuse(4): add tests for the FUSE_ASYNC_READ option
asomers [Fri, 15 Mar 2019 20:16:35 +0000 (20:16 +0000)]
fuse(4): add tests for the FUSE_ASYNC_READ option

Sponsored by: The FreeBSD Foundation

5 years agoMFV r336930: 9284 arc_reclaim_thread has 2 jobs
mav [Fri, 15 Mar 2019 18:59:04 +0000 (18:59 +0000)]
MFV r336930: 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 agoVOP_INACTIVE(9): clarify wording
asomers [Fri, 15 Mar 2019 18:50:36 +0000 (18:50 +0000)]
VOP_INACTIVE(9): clarify wording

Reviewed by: kib, 0mp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19596

5 years agoDeanonymize thread and proc state enums, so that a userland app can
glebius [Fri, 15 Mar 2019 18:18:05 +0000 (18:18 +0000)]
Deanonymize thread and proc state enums, so that a userland app can
use them without redefining the value names. New clang no longer
allows to redefine a enum value name to the same value.

Bump __FreeBSD_version, since ports depend on that.

Discussed with: jhb

5 years agofuse(4): add tests for ENOSYS special cases
asomers [Fri, 15 Mar 2019 18:06:51 +0000 (18:06 +0000)]
fuse(4): add tests for ENOSYS special cases

PR: 236557
Sponsored by: The FreeBSD Foundation

5 years agoif_bridge(4): Drop pointless rtflush
kevans [Fri, 15 Mar 2019 17:19:36 +0000 (17:19 +0000)]
if_bridge(4): Drop pointless rtflush

At this point, all routes should've already been dropped by removing all
members from the bridge. This condition is in-fact KASSERT'd in the line
immediately above where this nop flush was added.

5 years agoRevert r345192: Too many trees in play for bridge(4) bits
kevans [Fri, 15 Mar 2019 17:18:19 +0000 (17:18 +0000)]
Revert r345192: Too many trees in play for bridge(4) bits

An accidental appendage was committed that has not undergone review yet.

5 years agoif_bridge(4): Drop pointless rtflush
kevans [Fri, 15 Mar 2019 17:13:05 +0000 (17:13 +0000)]
if_bridge(4): Drop pointless rtflush

At this point, all routes should've already been dropped by removing all
members from the bridge. This condition is in-fact KASSERT'd in the line
immediately above where this nop flush was added.

5 years agofuse(4): combine common code in the tests
asomers [Fri, 15 Mar 2019 17:04:33 +0000 (17:04 +0000)]
fuse(4): combine common code in the tests

Sponsored by: The FreeBSD Foundation

5 years agoProvide deterministic (and somewhat useful) value for RDPID result,
kib [Fri, 15 Mar 2019 16:43:28 +0000 (16:43 +0000)]
Provide deterministic (and somewhat useful) value for RDPID result,
and for %ecx after RDTSCP.

Initialize TSC_AUX MSR with CPUID.  It allows for userspace to cheaply
identify CPU it was executed on some time ago, which is sometimes useful.

Note: The values returned might be changed in future.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoAdd symbolic name for TSC_AUX MSR address.
kib [Fri, 15 Mar 2019 16:39:05 +0000 (16:39 +0000)]
Add symbolic name for TSC_AUX MSR address.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agofuse(4): add some miscellaneous test cases that I had overlooked
asomers [Fri, 15 Mar 2019 16:16:50 +0000 (16:16 +0000)]
fuse(4): add some miscellaneous test cases that I had overlooked

* Test that FUSE_FLUSH and FUSE_RELEASE release POSIX file locks
* Test that FUSE_SETATTR's attr caching feature works
* Fix some minor mistakes in the posix file lock tests

Sponsored by: The FreeBSD Foundation

5 years agobridge: Fix STP-related panic
kp [Fri, 15 Mar 2019 15:52:36 +0000 (15:52 +0000)]
bridge: Fix STP-related panic

After r345180 we need to have the appropriate vnet context set to delete an
rtnode in bridge_rtnode_destroy().
That's usually the case, but not when it's called by the STP code (through
bstp_notify_rtage()).

We have to set the vnet context in bridge_rtable_expire() just as we do in the
other STP callback bridge_state_change().

Reviewed by: kevans

5 years agofuse(4): add tests for FUSE_DESTROY, FUSE_FORGET, and unlinking open files
asomers [Fri, 15 Mar 2019 14:49:27 +0000 (14:49 +0000)]
fuse(4): add tests for FUSE_DESTROY, FUSE_FORGET, and unlinking open files

Sponsored by: The FreeBSD Foundation

5 years agotrim(8): emit more user-friendly error message in verbose mode.
eugen [Fri, 15 Mar 2019 14:42:23 +0000 (14:42 +0000)]
trim(8): emit more user-friendly error message in verbose mode.

If underlying driver provides no TRIM/UNMAP support and operation fails
due to this reason, state it clearly in verbose mode (default)
instead of writing standard message that may be too cryptic for a user:

trim: ioctl(DIOCGDELETE) failed: nda0: Operation not supported

Now it would write:

trim: nda0: TRIM/UNMAP not supported by driver

But still use previous format including errno value for quiet mode.

Small candelete() function borrowed from diskinfo(8) code.
This function was committed by Alan Somers <asomers@FreeBSD.org>,
so give him some credit.

Reported by: chuck

5 years agoif_bridge(4): Fix module teardown
kevans [Fri, 15 Mar 2019 13:19:52 +0000 (13:19 +0000)]
if_bridge(4): Fix module teardown

bridge_rtnode_zone still has outstanding allocations at the time of
destruction in the current model because all of the interface teardown
happens in a VNET_SYSUNINIT, -after- the MOD_UNLOAD has already been
processed.  The SYSUNINIT triggers destruction of the interfaces, which then
attempts to free the memory from the zone that's already been destroyed, and
we hit a panic.

Solve this by virtualizing the uma_zone we allocate the rtnodes from to fix
the ordering. bridge_rtable_fini should also take care to flush any
remaining routes that weren't taken care of when dynamic routes were flushed
in bridge_stop.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D19578

5 years agoRemove unneeded mount point unlock function calls.
fsu [Fri, 15 Mar 2019 11:49:46 +0000 (11:49 +0000)]
Remove unneeded mount point unlock function calls.

The ext2_nodealloccg() function unlocks the mount point
in case of successful node allocation.
The additional unlocks are not required and should be removed.

PR: 236452
Reported by: pho
MFC after: 3 days

5 years agobridge: Fix panic if the STP root is removed
kp [Fri, 15 Mar 2019 11:21:20 +0000 (11:21 +0000)]
bridge: Fix panic if the STP root is removed

If the spanning tree root interface is removed from the bridge we panic
on the next 'ifconfig'.
While the STP code is notified whenever a bridge member interface is
removed from the bridge it does not clear the bs_root_port. This means
bs_root_port can still point at an bridge_iflist which has been free()d.
The next access to it will panic.

Explicitly check if the interface we're removing in bstp_destroy() is
the root, and if so re-assign the roles, which clears bs_root_port.

Reviewed by: philip
MFC after: 2 weeks

5 years agopf :Use counter(9) in pf tables.
kp [Fri, 15 Mar 2019 11:08:44 +0000 (11:08 +0000)]
pf :Use counter(9) in pf tables.

The counters of pf tables are updated outside the rule lock. That means state
updates might overwrite each other. Furthermore allocation and
freeing of counters happens outside the lock as well.

Use counter(9) for the counters, and always allocate the counter table
element, so that the race condition cannot happen any more.

PR: 230619
Submitted by: Kajetan Staszkiewicz <vegeta@tuxpowered.net>
Reviewed by: glebius
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19558

5 years agoFix bhyve PCIe capability emulation
chuck [Fri, 15 Mar 2019 02:11:28 +0000 (02:11 +0000)]
Fix bhyve PCIe capability emulation

PCIe devices starting with version 1.1 must set the Role-Based Error
Reporting bit.

And while we're in the neighborhood, generalize the code assigning the
device type.

Reviewed by: imp, araujo, rgrimes
Approved by: imp (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19580

5 years agoFix bhyve's NVMe Identify Namespace data
chuck [Fri, 15 Mar 2019 02:11:27 +0000 (02:11 +0000)]
Fix bhyve's NVMe Identify Namespace data

The NVMe Identify Namespace data structure's Number of LBA Formats
(NLBAF) field is a 0's based value (i.e. 0x0 means 1). Since the
emulation only supports a single format, set NLBAF to 0x0, not 1.

Reviewed by: imp, araujo, rgrimes
Approved by: imp (mentor)
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D19579

5 years agoAdd myself to committers-doc.dot.
ygy [Fri, 15 Mar 2019 00:20:28 +0000 (00:20 +0000)]
Add myself to committers-doc.dot.

Reminded by: rgrimes

5 years agofuse(4): add tests for extended attributes
asomers [Thu, 14 Mar 2019 23:05:59 +0000 (23:05 +0000)]
fuse(4): add tests for extended attributes

Sponsored by: The FreeBSD Foundation

5 years agoPFIL_MEMPTR for ipfw link level hook
glebius [Thu, 14 Mar 2019 22:52:16 +0000 (22:52 +0000)]
PFIL_MEMPTR for ipfw link level hook

With new pfil(9) KPI it is possible to pass a void pointer with length
instead of mbuf pointer to a packet filter. Until this commit no filters
supported that, so pfil run through a shim function pfil_fake_mbuf().

Now the ipfw(4) hook named "default-link", that is instantiated when
net.link.ether.ipfw sysctl is on, supports processing pointer/length
packets natively.

- ip_fw_args now has union for either mbuf or void *, and if flags have
  non-zero length, then we use the void *.
- through ipfw_chk() we handle mem/mbuf cases differently.
- ether_header goes away from args. It is ipfw_chk() responsibility
  to do parsing of Ethernet header.
- ipfw_log() now uses different bpf APIs to log packets.

Although ipfw_chk() is now capable to process pointer/length packets,
this commit adds support for the link level hook only, see
ipfw_check_frame(). Potentially the IP processing hook ipfw_check_packet()
can be improved too, but that requires more changes since the hook
supports more complex actions: NAT, divert, etc.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D19357

5 years agoRemove 'dir' argument from dummynet_io(). This makes it possible to make
glebius [Thu, 14 Mar 2019 22:32:50 +0000 (22:32 +0000)]
Remove 'dir' argument from dummynet_io(). This makes it possible to make
dn_dir flags private to dummynet. There is still some room for improvement.

5 years agoReduce argument list to ipfw_divert(), as args holds the rule ref and
glebius [Thu, 14 Mar 2019 22:31:12 +0000 (22:31 +0000)]
Reduce argument list to ipfw_divert(), as args holds the rule ref and
the direction. While here make 'tee' a bool.

5 years agoRemove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info.
glebius [Thu, 14 Mar 2019 22:30:05 +0000 (22:30 +0000)]
Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info.
While here make 'tee' boolean.

5 years ago- Add more flags to ip_fw_args. At this changeset only IPFW_ARGS_IN and
glebius [Thu, 14 Mar 2019 22:28:50 +0000 (22:28 +0000)]
- Add more flags to ip_fw_args. At this changeset only IPFW_ARGS_IN and
  IPFW_ARGS_OUT are utilized. They are intented to substitute the "dir"
  parameter that is often passes together with args.
- Rename ip_fw_args.oif to ifp and now it is set to either input or
  output interface, depending on IPFW_ARGS_IN/OUT bit set.

5 years agoMake second argument of ip_divert(), that specifies packet direction a bool.
glebius [Thu, 14 Mar 2019 22:23:09 +0000 (22:23 +0000)]
Make second argument of ip_divert(), that specifies packet direction a bool.
This allows pf(4) to avoid including ipfw(4) private files.

5 years agoSimplify ipfw_bpf_mtap2(). No functional change.
glebius [Thu, 14 Mar 2019 22:20:48 +0000 (22:20 +0000)]
Simplify ipfw_bpf_mtap2(). No functional change.

5 years agopkgbase: Use uname as ABI_FILE
manu [Thu, 14 Mar 2019 22:08:09 +0000 (22:08 +0000)]
pkgbase: Use uname as ABI_FILE

uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when
building pkg for pkgbase.
pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599
https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599

Discussed with: bapt
MFC after: 1 week

5 years agobhyve(8): Fix uart emulation bug
cem [Thu, 14 Mar 2019 21:08:48 +0000 (21:08 +0000)]
bhyve(8): Fix uart emulation bug

THRE is always asserted in LSR reads, so REG_IER writes that raise
IER_ETXRDY must also set thre_int_pending.

Reported by: Illumos, according to emaste@
https://twitter.com/ed_maste/status/1106195949087584258
MFC after: 2 weeks

5 years agoVendor import of LLVM openmp trunk r351319 (just before the release_80
dim [Thu, 14 Mar 2019 20:09:10 +0000 (20:09 +0000)]
Vendor import of LLVM openmp trunk r351319 (just before the release_80
branch point):
https://llvm.org/svn/llvm-project/openmp/trunk@351319

5 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, and lldb
dim [Thu, 14 Mar 2019 19:52:12 +0000 (19:52 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, and lldb
release_80 branch r356034 (effectively, 8.0.0 rc5), resolve conflicts,
and bump version numbers.

PR: 236062
MFC after: 1 month
X-MFC-With: r344779

5 years agoether_fakeaddr: Use 'b' 's' 'd' for the prefix
kevans [Thu, 14 Mar 2019 19:48:43 +0000 (19:48 +0000)]
ether_fakeaddr: Use 'b' 's' 'd' for the prefix

This has the advantage of being obvious to sniff out the designated prefix
by eye and it has all the right bits set. Comment stolen from ffec.

I've removed bryanv@'s pending question of using the FreeBSD OUI range --
no one has followed up on this with a definitive action, and there's no
particular reason to shoot for it and the administrative overhead that comes
with deciding exactly how to use it.

5 years agomips: remove dead comment and definitions.
kib [Thu, 14 Mar 2019 19:07:41 +0000 (19:07 +0000)]
mips: remove dead comment and definitions.

Reviewed by: brooks, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D19584

5 years agofuse(4): add tests for FUSE_INTERRUPT
asomers [Thu, 14 Mar 2019 17:20:24 +0000 (17:20 +0000)]
fuse(4): add tests for FUSE_INTERRUPT

This required changing the way that all operations are mocked.  Previously
MockFS::process had one input argument and one output argument.  Now, it
returns a vector of zero or more responses.  This allows tests to simulate
conditions where the filesystem daemon has a queue depth > 1.

PR: 236530
Sponsored by: The FreeBSD Foundation

5 years agoether: centralize fake hwaddr generation
kevans [Thu, 14 Mar 2019 17:18:00 +0000 (17:18 +0000)]
ether: centralize fake hwaddr generation

We currently have two places with identical fake hwaddr generation --
if_vxlan and if_bridge. Lift it into if_ethersubr for reuse in other
interfaces that may also need a fake addr.

Reviewed by: bryanv, kp, philip
Differential Revision: https://reviews.freebsd.org/D19573

5 years agofirmware(9): remove uuencoded example
emaste [Thu, 14 Mar 2019 17:09:07 +0000 (17:09 +0000)]
firmware(9): remove uuencoded example

We can (should) just commit the binary files to the source tree.

Reviewed by: bz, imp, 0mp
Differential Revision: https://reviews.freebsd.org/D19581

5 years agoRemove radeonkmsfw firmware files
emaste [Thu, 14 Mar 2019 17:05:46 +0000 (17:05 +0000)]
Remove radeonkmsfw firmware files

The drivers were removed in r344299 so there is no need to keep the
firmware files in the src tree.

Reviewed by: imp, jhibbits, johalun
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19583

5 years agoStyle(9): add a missing space between argument declerations.
brooks [Thu, 14 Mar 2019 15:56:34 +0000 (15:56 +0000)]
Style(9): add a missing space between argument declerations.

5 years agoRemove an unused struct proc *p1 in cpu_fork().
brooks [Thu, 14 Mar 2019 15:55:30 +0000 (15:55 +0000)]
Remove an unused struct proc *p1 in cpu_fork().

The only reference to p1 after a dead store was in a comment so update
the comment to refer to td1.

Submitted by: sbruno
Differential Revision: https://reviews.freebsd.org/D16226

5 years agofuse(4) tests: minor tweaks
asomers [Thu, 14 Mar 2019 15:07:46 +0000 (15:07 +0000)]
fuse(4) tests: minor tweaks

* better debugging for FUSE_SETATTR
* Move a big variable from stack to heap

Sponsored by: The FreeBSD Foundation

5 years agofuse(4): skip the Write.append test unless vfs.fuse.sync_resize==0
asomers [Thu, 14 Mar 2019 14:59:59 +0000 (14:59 +0000)]
fuse(4): skip the Write.append test unless vfs.fuse.sync_resize==0

Sponsored by: The FreeBSD Foundation

5 years agochroot.8: Add examples & clean up
0mp [Thu, 14 Mar 2019 14:34:36 +0000 (14:34 +0000)]
chroot.8: Add examples & clean up

- Sort arguments in synopsis.
- Clarify that it is possible to specify arguments to the command (and that
  they could be passed as further arguments to chroot(1)).
- Standardize the description of the flags.
- Improve formatting (e.g., do not use macros in strings specifying width).
- Add examples.

Reviewed by: bcr
Approved by: bcr (doc)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D19582

5 years agoRemove npe microcode
emaste [Thu, 14 Mar 2019 13:28:21 +0000 (13:28 +0000)]
Remove npe microcode

The driver was removed in r336436.

5 years agotrim(8): add another safety net
eugen [Thu, 14 Mar 2019 12:25:16 +0000 (12:25 +0000)]
trim(8): add another safety net

It is quite easy make a mistake and run something like this:

trim -f /dev/da0 -r rfile

This would trim the whole device then emit an error on non-existing file -r.

Add another check to prevent this while allowing this form still
for real object names beginning from dash:

trim -f -- /dev/da0 -r rfile

MFC after: 1 week

5 years agoRevert r345102 until the DRM next port issues are resolved.
hselasky [Thu, 14 Mar 2019 09:18:54 +0000 (09:18 +0000)]
Revert r345102 until the DRM next port issues are resolved.

Requested by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agofuse(4): combine common code in the tests
asomers [Thu, 14 Mar 2019 00:12:59 +0000 (00:12 +0000)]
fuse(4): combine common code in the tests

Combine a bunch of mostly similar expect_* methods into utils.cc, and only
define FH in a single place.

Sponsored by: The FreeBSD Foundation

5 years agofuse(4): add tests for POSIX file locking operations
asomers [Wed, 13 Mar 2019 22:16:00 +0000 (22:16 +0000)]
fuse(4): add tests for POSIX file locking operations

PR: 234581
Sponsored by: The FreeBSD Foundation

5 years agoResolve duplicate symbol name conflict after r345095, when building LINT.
hselasky [Wed, 13 Mar 2019 19:53:20 +0000 (19:53 +0000)]
Resolve duplicate symbol name conflict after r345095, when building LINT.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoImplement sg_virt() function in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:31:33 +0000 (19:31 +0000)]
Implement sg_virt() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoDefine SG_CHAIN and SG_END in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:30:40 +0000 (19:30 +0000)]
Define SG_CHAIN and SG_END in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement pr_info_ratelimited() function macro in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:26:24 +0000 (19:26 +0000)]
Implement pr_info_ratelimited() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoDefine some RCU debug macros in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:24:30 +0000 (19:24 +0000)]
Define some RCU debug macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoHonor SYSCTL function return values when creating sysfs nodes in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:21:19 +0000 (19:21 +0000)]
Honor SYSCTL function return values when creating sysfs nodes in the LinuxKPI.
Return proper error code upon failure.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement more malloc function macros in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:17:52 +0000 (19:17 +0000)]
Implement more malloc function macros in the LinuxKPI.
Fix arguments for currently unused kvmalloc().

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement more PCI speed related functions and macros in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:15:36 +0000 (19:15 +0000)]
Implement more PCI speed related functions and macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement IS_ALIGNED() and DIV_ROUND_DOWN_ULL() function macros in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:04:06 +0000 (19:04 +0000)]
Implement IS_ALIGNED() and DIV_ROUND_DOWN_ULL() function macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement si_meminfo() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 19:01:55 +0000 (19:01 +0000)]
Implement si_meminfo() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement task_euid() and get_task_state() function macros in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:55:41 +0000 (18:55 +0000)]
Implement task_euid() and get_task_state() function macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement get_task_comm() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:53:29 +0000 (18:53 +0000)]
Implement get_task_comm() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement current_exiting() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:51:33 +0000 (18:51 +0000)]
Implement current_exiting() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement list_for_each_entry_from_reverse() and
hselasky [Wed, 13 Mar 2019 18:47:17 +0000 (18:47 +0000)]
Implement list_for_each_entry_from_reverse() and
list_bulk_move_tail() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement dma_map_page_attrs() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:44:06 +0000 (18:44 +0000)]
Implement dma_map_page_attrs() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement ida_free() and ida_alloc_max() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:02:47 +0000 (18:02 +0000)]
Implement ida_free() and ida_alloc_max() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement DEFINE_STATIC_SRCU() function macro in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 18:00:25 +0000 (18:00 +0000)]
Implement DEFINE_STATIC_SRCU() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement BITS_PER_TYPE() function macro in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 17:55:58 +0000 (17:55 +0000)]
Implement BITS_PER_TYPE() function macro in the LinuxKPI.
Fix some style while at it.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoProperly define the DMA attribute values in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 17:51:08 +0000 (17:51 +0000)]
Properly define the DMA attribute values in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement dev_err_once() function macro in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 17:46:05 +0000 (17:46 +0000)]
Implement dev_err_once() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoImplement dma_set_mask_and_coherent() in the LinuxKPI.
hselasky [Wed, 13 Mar 2019 17:42:31 +0000 (17:42 +0000)]
Implement dma_set_mask_and_coherent() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoSome fixes for proccontrol(1) man page.
kib [Wed, 13 Mar 2019 17:30:03 +0000 (17:30 +0000)]
Some fixes for proccontrol(1) man page.

- Fix markup.
- Mention that process can only allow tracing for itself.  This is already
  stated in procctl(2), but requiring knowledge of the syscall description
  is too much for the tool user.
- Clearly state that query mode only works for existing process.

Noted and reviewed by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoEnhance IPv6 autoconf startup.
bz [Wed, 13 Mar 2019 17:00:15 +0000 (17:00 +0000)]
Enhance IPv6 autoconf startup.

Before this change we would only run rtsol on an interface which was
set to accept_rtadv and did not have rtsold enabled.  This change
removes the latter condition and always runs rtsol (rather than the
deferred rtsold) to reduce the delay until we send the first RS.

This change will also handle the accept_rtadv before dhcp hence
starting IPv6 auto-configuration before IPV4 DHCP.

This change is intended for FreeBSD 13 and later only and will not be MFCed.

Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D19488

5 years agoUse consistent struct stat arg name in stat man page
emaste [Wed, 13 Mar 2019 15:18:14 +0000 (15:18 +0000)]
Use consistent struct stat arg name in stat man page

stat, lstat, and fstat use `*sb` as the stat struct pointer arg name,
while fstatat previously used `*buf`.

MFC after: 1 week

5 years agofues(4): add tests for FUSE_RELEASEDIR
asomers [Wed, 13 Mar 2019 13:41:05 +0000 (13:41 +0000)]
fues(4): add tests for FUSE_RELEASEDIR

Sponsored by: The FreeBSD Foundation

5 years agomfi.4, mrsas.4: document how to get ATA TRIM support for SSD
eugen [Wed, 13 Mar 2019 09:48:33 +0000 (09:48 +0000)]
mfi.4, mrsas.4: document how to get ATA TRIM support for SSD
while using LSI RAID adapters as it was completely obscure before:
mfi has no TRIM support at all and mrsas provides TRIM
if underlying adapter does it (for Non-RAID drives generally).

5 years agocxgbe(4): Update T4/5/6 firmwares to 1.23.0.0.
np [Wed, 13 Mar 2019 06:46:15 +0000 (06:46 +0000)]
cxgbe(4): Update T4/5/6 firmwares to 1.23.0.0.

Obtained from: Chelsio Communications
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agofuse(4): add tests for opendir and readdir
asomers [Tue, 12 Mar 2019 22:25:59 +0000 (22:25 +0000)]
fuse(4): add tests for opendir and readdir

Sponsored by: The FreeBSD Foundation

5 years agoRemove the -d and -t flags from the man page
imp [Tue, 12 Mar 2019 21:03:56 +0000 (21:03 +0000)]
Remove the -d and -t flags from the man page

Remove -d and -t flags that were removed in r345050.

Noticed by: rgrimes@

5 years agoExtend descriptions and comments about the need to create /etc/pf.conf.
bcr [Tue, 12 Mar 2019 20:08:37 +0000 (20:08 +0000)]
Extend descriptions and comments about the need to create /etc/pf.conf.

FreeBSD removed the default /etc/pf.conf file in previous releases, but
the documentation kept mentioning it like any other file present in the
system.  Change pf.conf(5) to mention in the description of the default
ruleset location that this file needs to be created manually. Also, the
default rc.conf file had it's comment extended a bit to let people know
that this file does not exist by default.

PR:     231977
Submitted by:     koobs@
Reviewed by:     kp@, 0mp@
Approved by:     kp@
MFC after:     10 days
Differential Revision: https://reviews.freebsd.org/D19530

5 years agoFix still installing ipfilter rc.d files even when WITHOUT_IPFILTER
cy [Tue, 12 Mar 2019 19:34:33 +0000 (19:34 +0000)]
Fix still installing ipfilter rc.d files even when WITHOUT_IPFILTER
is specified.

When WITHOUT_IPFILTER is specified, delete-old-files fails to delete
the optional rc.d files from above. Fix this.

WITHOUT_IPFILTER fails to delete the ipfilter.5 optional file during
delete-old-files. Fix this.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

5 years agohwpmc/core: Adopt to upcoming Skylake TSX errata.
kib [Tue, 12 Mar 2019 19:33:25 +0000 (19:33 +0000)]
hwpmc/core: Adopt to upcoming Skylake TSX errata.

The forthcoming microcode update will fix a TSX bug by clobbering PMC3
when TSX instructions are executed (even speculatively).  There is an
alternate mode where CPU executes all TSX instructions by aborting
them, in which case PMC3 is still available to OS.  Any code that
correctly uses TSX must be ready to handle abort anyway.

Since it is believed that FreeBSD population of hwpmc(4) users is
significantly larger than the population of TSX users, switch the
microcode into TSX abort mode whenever a pmc is allocated, and back to
bug avoidance mode when the last pmc is deallocated.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoThis is an additional fix for bug report 230962. When using
mckusick [Tue, 12 Mar 2019 19:08:41 +0000 (19:08 +0000)]
This is an additional fix for bug report 230962. When using
extended attributes, the kernel can panic with either "ffs_truncate3"
or with "softdep_deallocate_dependencies: dangling deps".

The problem arises because the flushbuflist() function which is
called to clear out buffers is passed either the V_NORMAL flag to
indicate that it should flush buffer associated with the contents
of the file or the V_ALT flag to indicate that it should flush the
buffers associated with the extended attribute data. The buffers
containing the extended attribute data are identified by having
their BX_ALTDATA flag set in the buffer's b_xflags field. The
BX_ALTDATA flag is set on the buffer when the extended attribute
block is first allocated or when its contents are read in from the
disk.

On a busy system, a buffer may be reused for another purpose, but
the contents of the block that it contained continues to be held
in the main page cache. Each physical page is identified as holding
the contents of a logical block within a specified file (identified
by a vnode). When a request is made to read a file, the kernel first
looks for the block in the existing buffers.  If it is not found
there, it checks the page cache to see if it is still there. If
it is found in the page cache, then it is remapped into a new
buffer thus avoiding the need to read it in from the disk.

The bug is that when a buffer request made for an extended attribute
is fulfilled by reconstituting a buffer from the page cache rather
than reading it in from disk, the BX_ALTDATA flag was not being
set. Thus the flushbuflist() function would never clear it out and
the "ffs_truncate3" panic would occur because the vnode being cleared
still had buffers on its clean-buffer list. If the extended attribute
was being updated, it is first read, then updated, and finally
written. If the read is fulfilled by reconstituting the buffer
from the page cache the BX_ALTDATA flag was not set and thus the
dirty buffer would never be flushed by flushbuflist(). Eventually
the buffer would be recycled. Since it was never written it would
have an unfinished dependency which would trigger the
"softdep_deallocate_dependencies: dangling deps" panic.

The fix is to ensure that the BX_ALTDATA flag is set when a buffer
has been reconstituted from the page cache.

PR:           230962
Reported by:  2t8mr7kx9f@protonmail.com
Reviewed by:  kib
Tested by:    Peter Holm
MFC after:    1 week
Sponsored by: Netflix

5 years agoAdd register number, CPUID bits, and print identification for TSX
kib [Tue, 12 Mar 2019 18:59:01 +0000 (18:59 +0000)]
Add register number, CPUID bits, and print identification for TSX
force abort errata.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days