]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoCorrect size for allocation and bzero of fdsr.
delphij [Mon, 23 Apr 2018 07:15:49 +0000 (07:15 +0000)]
Correct size for allocation and bzero of fdsr.

MFC after: 2 weeks

6 years agobsdgrep: Fix build failure WITHOUT_LZMA (incorrect bracket placement)
kevans [Sun, 22 Apr 2018 23:51:24 +0000 (23:51 +0000)]
bsdgrep: Fix build failure WITHOUT_LZMA (incorrect bracket placement)

Submitted by: sbruno
Reported by: sbruno

6 years agopwd_mkdb: add deprecation notice in manpage too
emaste [Sun, 22 Apr 2018 23:10:37 +0000 (23:10 +0000)]
pwd_mkdb: add deprecation notice in manpage too

Followon to r332789; as reported on the -current and -stable lists and
in review D15144 the -l option will be removed before FreeBSD 12.0.

6 years agoUpdate committers-src.dot to show the mentorship arrangement for myself: eadler has...
bcran [Sun, 22 Apr 2018 21:27:59 +0000 (21:27 +0000)]
Update committers-src.dot to show the mentorship arrangement for myself: eadler has agreed to mentor me.

6 years agoUpdate account and given names in committers-src.dot and calendar.freebsd
bcran [Sun, 22 Apr 2018 20:47:16 +0000 (20:47 +0000)]
Update account and given names in committers-src.dot and calendar.freebsd

I have changed my given name from Bruce to Rebecca, and my FreeBSD account
from brucec to bcran.
Update committers-src.dot and calendar.freebsd to show these changes.

Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D15125

6 years agoMake bufdaemon and bufspacedaemon use kthread_suspend_check instead of
tijl [Sun, 22 Apr 2018 16:05:29 +0000 (16:05 +0000)]
Make bufdaemon and bufspacedaemon use kthread_suspend_check instead of
kproc_suspend_check.  In r329612 bufspacedaemon was turned into a thread
of the bufdaemon process causing both to call kproc_suspend_check with the
same proc argument and that function contains the following while loop:

while (SIGISMEMBER(p->p_siglist, SIGSTOP)) {
wakeup(&p->p_siglist);
msleep(&p->p_siglist, &p->p_mtx, PPAUSE, "kpsusp", 0);
}

So one thread wakes up the other and the other wakes up the first again,
locking up UP machines on shutdown.

Also register the shutdown handlers with SHUTDOWN_PRI_LAST + 100 so they
run after the syncer has shutdown, because the syncer can cause a
situation where bufdaemon help is needed to proceed.

PR: 227404
Reviewed by: kib
Tested by: cy, rmacklem

6 years agolockf: slightly depessimize
mjg [Sun, 22 Apr 2018 09:30:07 +0000 (09:30 +0000)]
lockf: slightly depessimize

1. check if P_ADVLOCK is already set and if so, don't lock to set it
(stolen from DragonFly)
2. when trying for fast path unlock, check that we are doing unlock
first instead of taking the interlock for no reason (e.g. if we want
to *lock*). whilere make it more likely that falling fast path will
not take the interlock either by checking for state

Note the code is severely pessimized both single- and multithreaded.

6 years agoRemove the "load drivers" logic from libibverbs.
hselasky [Sun, 22 Apr 2018 06:11:46 +0000 (06:11 +0000)]
Remove the "load drivers" logic from libibverbs.

The "load drivers" logic in the libibverbs configuration file is relevant
for Linux only.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoFix the build post r332859
jhibbits [Sun, 22 Apr 2018 03:58:04 +0000 (03:58 +0000)]
Fix the build post r332859

sysentvec::sv_hwcap/sv_hwcap2 are pointers to  u_long, so cpu_features* need
to be u_long to use the pointers.  This also requires a temporary cast in
printing the bitfields, which is fine because the feature flag fields are
only 32 bits anyway.

6 years agodwatch(1): Remove the line used to demonstrate `-dev' option
dteske [Sun, 22 Apr 2018 02:40:21 +0000 (02:40 +0000)]
dwatch(1): Remove the line used to demonstrate `-dev' option

In recently added sendrecv profile, there was a line purposefully
added to introduce a compilation error in which `-dev' is used to
debug the entry. Removing the entry.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Add profile for send(2)/recv(2) syscalls
dteske [Sun, 22 Apr 2018 02:36:06 +0000 (02:36 +0000)]
dwatch(1): Add profile for send(2)/recv(2) syscalls

Sponsored by: Smule, Inc.

6 years agodwatch(1): Add `-dev' option to aid debugging of profiles
dteske [Sun, 22 Apr 2018 02:20:17 +0000 (02:20 +0000)]
dwatch(1): Add `-dev' option to aid debugging of profiles

The options `-d' (debug), `-e' (exit after compile), and `-v' (verbose)
when combined in any order (though best remembered as `-dev') will run
the conflated script through dtrace(1), test for error conditions, and
show the line that dtrace(1) failed at (with context).

If no errors are found, the output is the same as `-e[v]'.

When writing a new profile for dwatch(1), you can quickly test to
make sure it compiles by running `dwatch -devX profile_name' where
profiles live in /usr/libexec/dwatch or /usr/local/libexec/dwatch
(the latter being where profiles installed via ports should go).

Sponsored by: Smule, Inc.

6 years agoRemove unused definition bl_dfp; fix build with bktr compiled into kernel
riggs [Sat, 21 Apr 2018 18:43:09 +0000 (18:43 +0000)]
Remove unused definition bl_dfp; fix build with bktr compiled into kernel

PR: 216566
Submitted by: mail@fbsd.e4m.org
Reviewed by: riggs, cognet
Approved by: cognet
MFC after: 3 days

6 years agoWhen running with INVARIANTS, the kernel contains extra checks. However,
jtl [Sat, 21 Apr 2018 17:05:00 +0000 (17:05 +0000)]
When running with INVARIANTS, the kernel contains extra checks.  However,
these assumptions may not hold true once we've panic'd. Therefore, the
checks hold less value after a panic.  Additionally, if one of the checks
fails while we are already panic'd, this creates a double-panic which can
interfere with debugging the original panic.

Therefore, this commit allows an administrator to suppress a response to
KASSERT checks after a panic by setting a tunable/sysctl.  The
tunable/sysctl (debug.kassert.suppress_in_panic) defaults to being
enabled.

Reviewed by: kib
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D12920

6 years agoExport powerpc CPU features for auxvec
jhibbits [Sat, 21 Apr 2018 15:15:47 +0000 (15:15 +0000)]
Export powerpc CPU features for auxvec

FreeBSD exports the AT_HWCAP* auxvec items if provided by the ELF sysentvec
structure.  Add the CPU features to be exported, so user space can more
easily check for them without using the hw.cpu_features and hw.cpu_features2
sysctls.

6 years agobsdgrep: Use grep_strdup instead of grep_malloc+strcpy
kevans [Sat, 21 Apr 2018 14:58:45 +0000 (14:58 +0000)]
bsdgrep: Use grep_strdup instead of grep_malloc+strcpy

6 years agoAdd cfumass rc script, to create a LUN for cfumass(4).
trasz [Sat, 21 Apr 2018 14:56:41 +0000 (14:56 +0000)]
Add cfumass rc script, to create a LUN for cfumass(4).

MFC after: 2 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14844

6 years agobsdgrep: Fix --include/--exclude ordering issues
kevans [Sat, 21 Apr 2018 13:46:07 +0000 (13:46 +0000)]
bsdgrep: Fix --include/--exclude ordering issues

Prior to r332851:
* --exclude always win out over --include
* --exclude-dir always wins out over --include-dir

r332851 broke that behavior, resulting in:
* First of --exclude, --include wins
* First of --exclude-dir, --include-dir wins

As it turns out, both behaviors are wrong by modern grep standards- the
latest rule wins. e.g.:

`grep --exclude foo --include foo 'thing' foo`
foo is included

`grep --include foo --exclude foo 'thing' foo`
foo is excluded

As tested with GNU grep 3.1.

This commit makes bsdgrep follow this behavior.

Reported by: se

6 years agoSync powerpc feature flags with Linux
jhibbits [Sat, 21 Apr 2018 04:18:17 +0000 (04:18 +0000)]
Sync powerpc feature flags with Linux

Not all feature flags are synced.  Those for processors we don't currently
support are ignored currently.  Those that are supported are synced best I
can tell.  One flag was renamed to match the Linux flag name
(PPC_FEATURE2_VCRYPTO -> PPC_FEATURE2_VEC_CRYPTO).

6 years agoblake2: Disable warnings (not just error) for code we will not modify
cem [Sat, 21 Apr 2018 02:08:56 +0000 (02:08 +0000)]
blake2: Disable warnings (not just error) for code we will not modify

Leave libb2 pristine and silence the warnings for mjg.

6 years agobsdgrep: if chain => switch
kevans [Sat, 21 Apr 2018 01:42:02 +0000 (01:42 +0000)]
bsdgrep: if chain => switch

This makes some of this a little easier to follow (in my opinion).

6 years agobsdgrep: More trivial cleanup/style cleanup
kevans [Sat, 21 Apr 2018 01:33:13 +0000 (01:33 +0000)]
bsdgrep: More trivial cleanup/style cleanup

We can avoid branching for these easily reduced patterns

6 years agobsdgrep: Some light cleanup
kevans [Sat, 21 Apr 2018 01:02:35 +0000 (01:02 +0000)]
bsdgrep: Some light cleanup

There's no point checking for a bunch of file modes if we're not a
practicing believer of DIR_SKIP or DEV_SKIP.

This also reduces some style violations that were particularly ugly looking
when browsing through.

6 years agolldb: propagate error to user if memory read fails
emaste [Sat, 21 Apr 2018 00:34:46 +0000 (00:34 +0000)]
lldb: propagate error to user if memory read fails

Previously, an attempt to read an unreadable access reported zeros:

(lldb) memory read -format hex -size 8 0
0x00000000: 0x0000000000000000 0x0000000000000000
0x00000010: 0x0000000000000000 0x0000000000000000
...

Now, if DoReadMemory encounters error then return 0 (bytes read) so we
report the error to the user:

(lldb) memory read -format hex -size 8 0
error: Bad address

LLVM PR: 37190

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agomakefs: tidy up reach-over source
emaste [Fri, 20 Apr 2018 22:23:38 +0000 (22:23 +0000)]
makefs: tidy up reach-over source

- cd9660 relies on an #include "iso.h" but does not build any .c files
  out of source, so remove reach-over .PATH
- ffs does not rely on any sys/ headers, so remove -I from CFLAGS.
- ffs_tables from sys/ is used by ffs; move the SRCS entry from the top-
  level Makefile to ffs' Makefile.inc.

Sponsored by: The FreeBSD Foundation

6 years agoregulator: Check status before disabling
manu [Fri, 20 Apr 2018 20:30:33 +0000 (20:30 +0000)]
regulator: Check status before disabling

When disabling regulator when they are unused, check before is they are
enabled.
While here don't check the enable_cnt on the regulator entry as it is
checked by regnode_stop.
This solve the panic on any board using a fixed regulator that is driven
by a gpio when the regulator is unused.

Tested On: OrangePi One
Pointy Hat to:     myself
Reported by: kevans, Milan Obuch (freebsd-arm@dino.sk)

6 years agognu/dts: Update our copy of arm dts from Linux 4.16
manu [Fri, 20 Apr 2018 19:37:08 +0000 (19:37 +0000)]
gnu/dts: Update our copy of arm dts from Linux 4.16

6 years agodts: Update our copy from files from Linux 4.16
manu [Fri, 20 Apr 2018 18:44:52 +0000 (18:44 +0000)]
dts: Update our copy from files from Linux 4.16

6 years agoRecommit r332501, with an additional upstream fix for "Cannot lower
dim [Fri, 20 Apr 2018 18:20:55 +0000 (18:20 +0000)]
Recommit r332501, with an additional upstream fix for "Cannot lower
EFLAGS copy that lives out of a basic block!" errors on i386.

Pull in r325446 from upstream clang trunk (by me):

  [X86] Add 'sahf' CPU feature to frontend

  Summary:
  Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the
  `+sahf` feature for the backend, for bug 36028 (Incorrect use of
  pushf/popf enables/disables interrupts on amd64 kernels).  This was
  originally submitted in bug 36037 by Jonathan Looney
  <jonlooney@gmail.com>.

  As described there, GCC also uses `-msahf` for this feature, and the
  backend already recognizes the `+sahf` feature. All that is needed is
  to teach clang to pass this on to the backend.

  The mapping of feature support onto CPUs may not be complete; rather,
  it was chosen to match LLVM's idea of which CPUs support this feature
  (see lib/Target/X86/X86.td).

  I also updated the affected test case (CodeGen/attr-target-x86.c) to
  match the emitted output.

  Reviewers: craig.topper, coby, efriedma, rsmith

  Reviewed By: craig.topper

  Subscribers: emaste, cfe-commits

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

Pull in r328944 from upstream llvm trunk (by Chandler Carruth):

  [x86] Expose more of the condition conversion routines in the public
  API for X86's instruction information. I've now got a second patch
  under review that needs these same APIs. This bit is nicely
  orthogonal and obvious, so landing it. NFC.

Pull in r329414 from upstream llvm trunk (by Craig Topper):

  [X86] Merge itineraries for CLC, CMC, and STC.

  These are very simple flag setting instructions that appear to only
  be a single uop. They're unlikely to need this separation.

Pull in r329657 from upstream llvm trunk (by Chandler Carruth):

  [x86] Introduce a pass to begin more systematically fixing PR36028
  and similar issues.

  The key idea is to lower COPY nodes populating EFLAGS by scanning the
  uses of EFLAGS and introducing dedicated code to preserve the
  necessary state in a GPR. In the vast majority of cases, these uses
  are cmovCC and jCC instructions. For such cases, we can very easily
  save and restore the necessary information by simply inserting a
  setCC into a GPR where the original flags are live, and then testing
  that GPR directly to feed the cmov or conditional branch.

  However, things are a bit more tricky if arithmetic is using the
  flags.  This patch handles the vast majority of cases that seem to
  come up in practice: adc, adcx, adox, rcl, and rcr; all without
  taking advantage of partially preserved EFLAGS as LLVM doesn't
  currently model that at all.

  There are a large number of operations that techinaclly observe
  EFLAGS currently but shouldn't in this case -- they typically are
  using DF.  Currently, they will not be handled by this approach.
  However, I have never seen this issue come up in practice. It is
  already pretty rare to have these patterns come up in practical code
  with LLVM. I had to resort to writing MIR tests to cover most of the
  logic in this pass already.  I suspect even with its current amount
  of coverage of arithmetic users of EFLAGS it will be a significant
  improvement over the current use of pushf/popf. It will also produce
  substantially faster code in most of the common patterns.

  This patch also removes all of the old lowering for EFLAGS copies,
  and the hack that forced us to use a frame pointer when EFLAGS copies
  were found anywhere in a function so that the dynamic stack
  adjustment wasn't a problem. None of this is needed as we now lower
  all of these copies directly in MI and without require stack
  adjustments.

  Lots of thanks to Reid who came up with several aspects of this
  approach, and Craig who helped me work out a couple of things
  tripping me up while working on this.

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

Pull in r329673 from upstream llvm trunk (by Chandler Carruth):

  [x86] Model the direction flag (DF) separately from the rest of
  EFLAGS.

  This cleans up a number of operations that only claimed te use EFLAGS
  due to using DF. But no instructions which we think of us setting
  EFLAGS actually modify DF (other than things like popf) and so this
  needlessly creates uses of EFLAGS that aren't really there.

  In fact, DF is so restrictive it is pretty easy to model. Only STD,
  CLD, and the whole-flags writes (WRFLAGS and POPF) need to model
  this.

  I've also somewhat cleaned up some of the flag management instruction
  definitions to be in the correct .td file.

  Adding this extra register also uncovered a failure to use the
  correct datatype to hold X86 registers, and I've corrected that as
  necessary here.

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

Pull in r330264 from upstream llvm trunk (by Chandler Carruth):

  [x86] Fix PR37100 by teaching the EFLAGS copy lowering to rewrite
  uses across basic blocks in the limited cases where it is very
  straight forward to do so.

  This will also be useful for other places where we do some limited
  EFLAGS propagation across CFG edges and need to handle copy rewrites
  afterward. I think this is rapidly approaching the maximum we can and
  should be doing here. Everything else begins to require either heroic
  analysis to prove how to do PHI insertion manually, or somehow
  managing arbitrary PHI-ing of EFLAGS with general PHI insertion.
  Neither of these seem at all promising so if those cases come up,
  we'll almost certainly need to rewrite the parts of LLVM that produce
  those patterns.

  We do now require dominator trees in order to reliably diagnose
  patterns that would require PHI nodes. This is a bit unfortunate but
  it seems better than the completely mysterious crash we would get
  otherwise.

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

Together, these should ensure clang does not use pushf/popf sequences to
save and restore flags, avoiding problems with unrelated flags (such as
the interrupt flag) being restored unexpectedly.

Requested by: jtl
PR: 225330
MFC after: 1 week

6 years agobsdgrep: Break procmatches down a little bit more
kevans [Fri, 20 Apr 2018 18:06:03 +0000 (18:06 +0000)]
bsdgrep: Break procmatches down a little bit more

Split the matching and non-matching cases out into their own functions to
reduce future complexity. As the name implies, procmatches will eventually
process more than one match itself in the future.

6 years agoRename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GET
kib [Fri, 20 Apr 2018 15:19:27 +0000 (15:19 +0000)]
Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GET
-> PROC_PDEATHSIG_STATUS for consistency with other procctl(2)
operations names.

Requested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

6 years agocall racct_proc_ucred_changed() under the proc lock
avg [Fri, 20 Apr 2018 13:08:04 +0000 (13:08 +0000)]
call racct_proc_ucred_changed() under the proc lock

The lock is required to ensure that the switch to the new credentials
and the transfer of the process's accounting data from the old
credentials to the new ones is done atomically.  Otherwise, some updates
may be applied to the new credentials and then additionally transferred
from the old credentials if the updates happen after proc_set_cred() and
before racct_proc_ucred_changed().

The problem is especially pronounced for RACCT_RSS because
- there is a strict accounting for this resource (it's reclaimable)
- it's updated asynchronously by the vm daemon
- it's updated by setting an absolute value instead of applying a delta

I had to remove a call to rctl_proc_ucred_changed() from
racct_proc_ucred_changed() and make all callers of latter call the
former as well.  The reason is that rctl_proc_ucred_changed, as it is
implemented now, cannot be called while holding the proc lock, so the
lock is dropped after calling racct_proc_ucred_changed.  Additionally,
I've added calls to crhold / crfree around the rctl call, because
without the proc lock there is no gurantee that the new credentials,
owned by the process, will stay stable.  That does not eliminate a
possibility that the credentials passed to the rctl will get stale.
Ideally, rctl_proc_ucred_changed should be able to work under the proc
lock.

Many thanks to kib for pointing out the above problems.

PR: 222027
Discussed with: kib
No comment: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15048

6 years agoFix use of pointer after being set NULL.
rmacklem [Fri, 20 Apr 2018 11:38:29 +0000 (11:38 +0000)]
Fix use of pointer after being set NULL.

Using a pointer after setting it NULL is probably not a good plan.
Spotted by inspection during changes for Flexible File Layout Ioerr handling.
This code path obviously isn't normally executed.

MFC after: 1 week

6 years agoAdd dead_bpf_if structure, that should be used as fake bpf_if
ae [Fri, 20 Apr 2018 09:57:31 +0000 (09:57 +0000)]
Add dead_bpf_if structure, that should be used as fake bpf_if
during ifnet detach.

Since destroying interface is not atomic operation and due to the
lack of synhronization during destroy, it is possible, that in the
time between bpfdetach() and if_free() some queued on destroying
interface mbuf will be used by ether_input_internal() and
bpf_peers_present() can dereference NULL bpf_if pointer. To protect
from this, assign pointer to empty bpf_if_ext structure instead of
NULL pointer after bpfdetach().

Reviewed by: melifaro, eugen
Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D15083

6 years agobsdgrep: Add some TODOs for future work on operating on chunks
kevans [Fri, 20 Apr 2018 03:29:06 +0000 (03:29 +0000)]
bsdgrep: Add some TODOs for future work on operating on chunks

6 years agopowerpc64: Set n_slbs = 32 for POWER9
jhibbits [Fri, 20 Apr 2018 03:23:19 +0000 (03:23 +0000)]
powerpc64: Set n_slbs = 32 for POWER9

Summary:
POWER9 also contains 32 slbs entries as explained by the POWER9 User Manual:

 "For HPT translation, the POWER9 core contains a unified (combined for both
   instruction and data), 32-entry, fully-associative SLB per thread"

Submitted by: Breno Leitao
Differential Revision: https://reviews.freebsd.org/D15128

6 years agopowerpc64: Add DSCR support
jhibbits [Fri, 20 Apr 2018 03:19:44 +0000 (03:19 +0000)]
powerpc64: Add DSCR support

Summary:
Powerpc64 has support for a register called Data Stream Control Register
(DSCR), which basically controls how the hardware controls the caching and
prefetch for stream operations.

Since mfdscr and mtdscr are privileged instructions, we need to emulate them,
and
keep the custom DSCR configuration per thread.

The purpose of this feature is to change DSCR depending on the operation, set
to DSCR Default Prefetch Depth to deepest on string operations, as memcpy.

Submitted by: Breno Leitao
Differential Revision: https://reviews.freebsd.org/D15081

6 years agobsdgrep: Clean up procmatches a little bit
kevans [Fri, 20 Apr 2018 03:11:51 +0000 (03:11 +0000)]
bsdgrep: Clean up procmatches a little bit

6 years agobsdgrep: Split match processing out of procfile
kevans [Fri, 20 Apr 2018 03:08:46 +0000 (03:08 +0000)]
bsdgrep: Split match processing out of procfile

procfile is getting kind of hairy, and it's not going to get better as we
correct some more bits that assume we process one line at a time.

6 years agolld: use correct number of digits in __FreeBSD_version-style ID
emaste [Fri, 20 Apr 2018 00:59:53 +0000 (00:59 +0000)]
lld: use correct number of digits in __FreeBSD_version-style ID

__FreeBSD_version-style IDs should have 5 digits following the major.

6 years agoFix incorrect output for a file consisting of a single full-size
mckusick [Thu, 19 Apr 2018 22:43:55 +0000 (22:43 +0000)]
Fix incorrect output for a file consisting of a single full-size
block followed by a discontiguous fragment.

Add checks for unallocated inodes and inodes with unknown mode
types.

Cleanup variable declarations by changing from type `int' to types
like ufs_lbn_t, ufs2_daddr_t, etc.

Reported by: bde

6 years agoAdd sortbench.
brooks [Thu, 19 Apr 2018 21:53:57 +0000 (21:53 +0000)]
Add sortbench.

This is a set of benchmarks of qsort, mergesort, heapsort, and
optionally wikisort and a script to run them.

Submitted by: Miles Fertel <milesfertel@college.harvard.edu>
Sponsored by: Google Summer of Code 2017
Differential Revision: https://reviews.freebsd.org/D12677

6 years agoAdd support for linker-type-specific flags
emaste [Thu, 19 Apr 2018 20:58:09 +0000 (20:58 +0000)]
Add support for linker-type-specific flags

r332090 added a LINKER_TYPE test to add the --no-rosegment flag when
linking the i386 loader components with lld.  Instead, introduce a
general mechanism for setting LDFLAGS for a specific linker type,
and use it for --no-rosegment.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14998

6 years agoReplace SOFTFLOAT with __riscv_float_abi_*.
brooks [Thu, 19 Apr 2018 20:36:15 +0000 (20:36 +0000)]
Replace SOFTFLOAT with __riscv_float_abi_*.

With SOFTFLOAT, libc and libm were built correctly, but any program
including fenv.h itself assumed it was on a hardfloat systen and emitted
inline fpu instructions for fedisableexcept() and friends.

Unlike r315424 which did this for MIPS, I've used riscv_float_abi_soft
and riscv_float_abi_double macros as appropriate rather than using
__riscv_float_abi_soft exclusively.  This ensures that attempts to use an
unsupported hardfloat ABI will fail.

Reviewed by: br
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10039

6 years agoRemove empty dir no longer required.
markm [Thu, 19 Apr 2018 20:31:52 +0000 (20:31 +0000)]
Remove empty dir no longer required.

Reported by: Jung-uk Kim

6 years agoFix OpenDowngrade for NFSv4.1 if a client sets the OPEN_SHARE_ACCESS_WANT* bits.
rmacklem [Thu, 19 Apr 2018 20:30:33 +0000 (20:30 +0000)]
Fix OpenDowngrade for NFSv4.1 if a client sets the OPEN_SHARE_ACCESS_WANT* bits.

The NFSv4.1 RFC specifies that the OPEN_SHARE_ACCESS_WANT bits can be set
in the OpenDowngrade share_access argument and are basically ignored.
I do not know of a extant NFSv4.1 client that does this, but this little
patch fixes it just in case.
It also changes the error from NFSERR_BADXDR to NFSERR_INVAL since the NFSv4.1
RFC specifies this as the error to be returned if bogus bits are set.
(The NFSv4.0 RFC didn't specify any error for this, so the error reply can
 be changed for NFSv4.0 as well.)
Found by inspection while looking at a problem with OpenDowngrade reported
for the ESXi 6.5 NFSv4.1 client.

Reported by: andreas.nagy@frequentis.com
PR: 227214
MFC after: 1 week

6 years agopwd_mkdb: warn that legacy support is deprecated (if specified)
emaste [Thu, 19 Apr 2018 20:25:19 +0000 (20:25 +0000)]
pwd_mkdb: warn that legacy support is deprecated (if specified)

r283981 switched pwd_mkdb to emit only v4 database entries by default,
and introduced a -l (legacy) option emit v3 entries in addition.  The
commit message claims that legacy support will be removed in 12.0, so
emit a warning now if it is used.

6 years agoFix detection of memory overlap with the kernel in the case where a memory
nwhitehorn [Thu, 19 Apr 2018 18:34:38 +0000 (18:34 +0000)]
Fix detection of memory overlap with the kernel in the case where a memory
region marked "available" by firmware is contained entirely in the kernel.

This had a tendency to happen with FDTs passed by loader, though could for
other reasons as well, and would result in the kernel slowly cannibalizing
itself for other purposes, eventually resulting in a crash.

A similar fix is needed for mmu_oea.c and should probably just be rolled
at that point into some generic code in platform.c for taking a mem_region
list and removing chunks.

PR: 226974
Submitted by: leandro.lupori@gmail.com
Reviewed by: jhibbits
Differential Revision: D15121

6 years agocxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag.
np [Thu, 19 Apr 2018 18:10:44 +0000 (18:10 +0000)]
cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag.

Retrieve the tag from the correct ifnet and use the provided tag
(instead of hardcoded 0xffff, implying no tag) in the routines that
process offload policy.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

6 years agoUse symbolic constant, explaining the operation.
kib [Thu, 19 Apr 2018 18:08:46 +0000 (18:08 +0000)]
Use symbolic constant, explaining the operation.

Sponsored by: The FreeBSD Foundation

6 years agoReword comment to remove awkward constructs, including an "it's" that
imp [Thu, 19 Apr 2018 16:05:48 +0000 (16:05 +0000)]
Reword comment to remove awkward constructs, including an "it's" that
shouldn't have been there at all (it wasn't a typo for its, rather a
left-over from an older revision of the comment).

Noticed by: many

6 years agoSimplify the code to allocate stack for auxv, argv[], and environment vectors.
jhb [Thu, 19 Apr 2018 16:00:34 +0000 (16:00 +0000)]
Simplify the code to allocate stack for auxv, argv[], and environment vectors.

Remove auxarg_size as it was only used once right after a confusing
assignment in each of the variants of exec_copyout_strings().

Reviewed by: emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15123

6 years agoIntel drives have an optimal alignment for I/O. While they honor I/Os
imp [Thu, 19 Apr 2018 15:39:20 +0000 (15:39 +0000)]
Intel drives have an optimal alignment for I/O. While they honor I/Os
that cross this boundary, they perform better when this isn't the
case. Intel uses the 3rd byte in the vendor specific area for
this. The DC P3500 was previously listed without any explanation. Add
the DC P3520 and DC P4500 to the list.

There won't be any others drives needing this quirk. Intel has
standardized a field in the namespace data in 1.3 (noiob).  A future
patch will use that if it exists, with fallback to this method.

Submitted by: Keith Busch
Reviewed by: jimharris@

6 years agoRelease memory resource on cuda driver attach failure.
mav [Thu, 19 Apr 2018 15:29:10 +0000 (15:29 +0000)]
Release memory resource on cuda driver attach failure.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

6 years agocryptosoft: Do not exceed crd_len around *crypt_multi
cem [Thu, 19 Apr 2018 15:24:21 +0000 (15:24 +0000)]
cryptosoft: Do not exceed crd_len around *crypt_multi

When a caller passes in a uio or mbuf chain that is longer than crd_len, in
tandem with a transform that supports the multi-block interface,
swcr_encdec() would process the entire mbuf or uio instead of just the
portion indicated by crd_len (+ crd_skip).

De/encryption are performed in-place, so this would trash subsequent uio or
mbuf contents.

This was introduced in r331639 (mea culpa).  It only affects the
{de,en}crypt_multi() family of interfaces.  That interface only has one
consumer transform in-tree (for now): Chacha20.

PR: 227605
Submitted by: Valentin Vergez <valentin.vergez AT stormshield.eu>

6 years agoThese two modules need the tcp_hpts.h file for
rrs [Thu, 19 Apr 2018 15:03:48 +0000 (15:03 +0000)]
These two modules need the tcp_hpts.h file for
when the option is enabled (not sure how LINT/build-universe
missed this) opps.

Sponsored by: Netflix Inc

6 years agoFix ddb rc script
kevans [Thu, 19 Apr 2018 15:02:53 +0000 (15:02 +0000)]
Fix ddb rc script

r288291 added a call to limits(1), which isn't available before partitions
are mounted. This broke the ddb rc script, which does not provide its own
start_cmd.

Alleviate the situation here by providing a start_cmd. We still have other
problems with diskless setups that need to be considered, but this is a
start.

PR: 206291
Submitted by: cy
Discussed with: rgrimes
MFC after: 3 days

6 years agoInitialize marker pages in vm_page_domain_init().
markj [Thu, 19 Apr 2018 14:09:44 +0000 (14:09 +0000)]
Initialize marker pages in vm_page_domain_init().

They were previously initialized by the corresponding page daemon
threads, but for vmd_inacthead this may be too late if
vm_page_deactivate_noreuse() is called during boot.

Reported and tested by: cperciva
Reviewed by: alc, kib
MFC after: 1 week

6 years agoThis commit brings in the TCP high precision timer system (tcp_hpts).
rrs [Thu, 19 Apr 2018 13:37:59 +0000 (13:37 +0000)]
This commit brings in the TCP high precision timer system (tcp_hpts).
It is the forerunner/foundational work of bringing in both Rack and BBR
which use hpts for pacing out packets. The feature is optional and requires
the TCPHPTS option to be enabled before the feature will be active. TCP
modules that use it must assure that the base component is compile in
the kernel in which they are loaded.

MFC after: Never
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D15020

6 years agochpass: reject change/expiry dates beyond y2106
emaste [Thu, 19 Apr 2018 12:50:49 +0000 (12:50 +0000)]
chpass: reject change/expiry dates beyond y2106

The pwd.db and spwd.db files store the change and expire dates as
unsigned 32-bit ints, which overflow in 2106.  Reject larger values for
now, until the introduction of a v5 password database.

i386 has 32-bit time_t and so dates beyond y2038 are already rejected by
mktime.

PR: 227589
Reviewed by: lidl
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoset kdb_why to "trap" when calling kdb_trap from trap_fatal
avg [Thu, 19 Apr 2018 05:06:56 +0000 (05:06 +0000)]
set kdb_why to "trap" when calling kdb_trap from trap_fatal

This will allow to hook a ddb script to "kdb.enter.trap" event.
Previously there was no specific name for this event, so it could only
be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks.
Both are very unspecific.

Having a specific event is useful because the fatal trap condition is
very similar to panic but it has an additional property that the current
stack frame is the frame where the trap occurred.  So, both a register
dump and a stack bottom dump have additional information that can help
analyze the problem.

I have added the event only on architectures that have trap_fatal()
function defined.  I haven't looked at other architectures.  Their
maintainers can add support for the event later.

Sample script:
kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20

Reviewed by: kib, jhb, markj
MFC after: 11 days
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D15093

6 years agoefi loader: Address two nits with recent graphics changes
kevans [Thu, 19 Apr 2018 03:31:41 +0000 (03:31 +0000)]
efi loader: Address two nits with recent graphics changes

- We should be setting a known graphics mode on conout, but we aren't.
- We shouldn't be setting gop mode if we didn't find a good resolution to
  set, but we were. This made efi_max_resolution=1x1 effectively worthless,
  since it would always set gop mode 0 if nothing else.

6 years agoIn addition to the existing argument format:
mckusick [Wed, 18 Apr 2018 23:08:10 +0000 (23:08 +0000)]
In addition to the existing argument format:

prtblknos filesystem_device inode ...

add an additional argument format:

prtblknos file

which is more convenient than figuring out the filesystem
and inode number for "file".

When given a list of multiple inodes, rather than exiting
the program on an error with one of them, skip over it and
continue with the next one.

Submitted by: bde

6 years agoCheck the inode type and only attempt to print block lists for
mckusick [Wed, 18 Apr 2018 22:24:44 +0000 (22:24 +0000)]
Check the inode type and only attempt to print block lists for
regular files, directories, and symbolic links that require
external storage.

Correct the handling of files with holes and files that have
one or more large blocks and end with a fragment.

Reported by: bde

6 years agoAdd PROC_PDEATHSIG_SET to procctl interface.
kib [Wed, 18 Apr 2018 21:31:13 +0000 (21:31 +0000)]
Add PROC_PDEATHSIG_SET to procctl interface.

Allow processes to request the delivery of a signal upon death of
their parent process.  Supposed consumer of the feature is PostgreSQL.

Submitted by: Thomas Munro
Reviewed by: jilles, mjg
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15106

6 years agoFix pmap_trm_alloc(M_ZERO).
kib [Wed, 18 Apr 2018 20:09:26 +0000 (20:09 +0000)]
Fix pmap_trm_alloc(M_ZERO).

Sponsored by: The FreeBSD Foundation

6 years agoFor fatal traps other than pagefaults, print raw fault error codes.
kib [Wed, 18 Apr 2018 20:07:47 +0000 (20:07 +0000)]
For fatal traps other than pagefaults, print raw fault error codes.

For pagefaults, the error is already decoded and printed.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix two off-by-one errors when allocating MSI and MSI-X interrupts.
jhb [Wed, 18 Apr 2018 18:45:34 +0000 (18:45 +0000)]
Fix two off-by-one errors when allocating MSI and MSI-X interrupts.

x86 enforces an (arbitray) limit on the number of available MSI and
MSI-X interrupts to simplify code (in particular, interrupt_source[]
is statically sized).  This means that an attempt to allocate an MSI
vector needs to fail if it would go beyond the limit, but the checks
for exceeding the limit had an off-by-one error.  In the case of MSI-X
which allocates interrupts one at a time this meant that IRQ 768 kept
getting handed out multiple times for msix_alloc() instead of failing
because all MSI IRQs were in use.

Tested by: lidl
MFC after: 1 week

6 years agoWorkaround fixed I/O port resources encoded as I/O port ranges in _CRS.
jhb [Wed, 18 Apr 2018 18:36:26 +0000 (18:36 +0000)]
Workaround fixed I/O port resources encoded as I/O port ranges in _CRS.

ACPI I/O port descriptors use _MIN and _MAX fields to specify the set
of allowable base (start) addresses for an I/O port resource along with
a _LEN field specifying the length.  A fixed resource is supposed to be
encoded with _MIN == _MAX, but some buggy firmwares instead set _MAX to
the end of the fixed range.  Relocating I/O ranges only make sense in
_PRS (possible resource settings), not in _CRS (current resource settings),
so if an I/O port range with _MAX set set to the end of the range is
present in _CRS, treat it as a fixed I/O port resource starting at
_MIN.

PR: 224096
Submitted by: Harald Böhm <harald@boehm.codes>
Pointy hat to: jhb (taking so long to actually commit this)
MFC after: 1 week

6 years agodon't check for kdb reentry in trap_fatal(), it's impossible
avg [Wed, 18 Apr 2018 15:44:54 +0000 (15:44 +0000)]
don't check for kdb reentry in trap_fatal(), it's impossible

trap() checks for it earlier and calls kdb_reentry().

Discussed with: jhb
MFC after: 12 days
Sponsored by: Panzura

6 years agoiflib: Fix queue distribution when there are no threads
shurd [Wed, 18 Apr 2018 15:34:18 +0000 (15:34 +0000)]
iflib: Fix queue distribution when there are no threads

Previously, if there are no threads, all queues which targeted
cores that share an L2 cache were bound to a single core. The intent is
to distribute them across these cores.

Reported by: olivier
Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15120

6 years agoIncrease the msdosfs partition size on arm SoC images where the
gjb [Wed, 18 Apr 2018 14:34:33 +0000 (14:34 +0000)]
Increase the msdosfs partition size on arm SoC images where the
current size may not be sufficiently large for development and/or
testing.

PR: 227548
Submitted by: trasz
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoRemove mention of tools/recoverdisk, now in sbin
emaste [Wed, 18 Apr 2018 14:02:37 +0000 (14:02 +0000)]
Remove mention of tools/recoverdisk, now in sbin

PR: 227570
MFC after: 3 days

6 years agoSet correct float abi (float abi double) for hard-float build, so
br [Wed, 18 Apr 2018 13:58:42 +0000 (13:58 +0000)]
Set correct float abi (float abi double) for hard-float build, so
__riscv_float_abi_double macro will be defined by compiler.

The options are:
o lp64  __riscv_float_abi_soft
o lp64f __riscv_float_abi_single
o lp64d __riscv_float_abi_double

Sponsored by: DARPA, AFRL

6 years agotop: fix warnings from clang/gcc
lidl [Wed, 18 Apr 2018 13:17:14 +0000 (13:17 +0000)]
top: fix warnings from clang/gcc

Add includes for <curses.h> and <termcap.h> where necessary, and
rename a few internal functions to have a "top_" prefix to avoid
clashes with standard names from curses.h/termcap.h headers.

Top now compiles without warnings on both gcc and clang.

Reviewed by: emaste, imp, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15115

6 years agoAdd missing argument in the cnv man page.
oshogbo [Wed, 18 Apr 2018 11:02:19 +0000 (11:02 +0000)]
Add missing argument in the cnv man page.

Reported by: Miłosz Kaniewski <milosz.kaniewski@gmail.com>
MFC after: 1 week
Sponsored by: Wheel Systems

6 years agoMove debug.{trace,debugger}_on_panic and kern.panic_reboot_wait_time in
cperciva [Wed, 18 Apr 2018 05:58:27 +0000 (05:58 +0000)]
Move debug.{trace,debugger}_on_panic and kern.panic_reboot_wait_time in
EC2 instances from sysctl.conf to loader.conf; these can all be set as
loader tunables, and setting them in loader.conf gives us the right
behaviour in the event of a kernel panic taking place prior to when
sysctl.conf is processed.

MFC after: 1 week

6 years agoMake `iostat -xC` print CPU information on its own line
allanjude [Wed, 18 Apr 2018 02:25:03 +0000 (02:25 +0000)]
Make `iostat -xC` print CPU information on its own line

Requested by: mahrens
Reviewed by: kenm (maintainer), mahrens
MFC after: 1 week
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D15076

6 years agoGenerate hybrid ISO images for amd64.
benno [Tue, 17 Apr 2018 22:33:41 +0000 (22:33 +0000)]
Generate hybrid ISO images for amd64.

This keeps the existing El Torito entries for BIOS and UEFI boot code and
adds a GPT in the ISO image's System Area containing boot code for BIOS that
will load /boot/loader from the ISO filesystem and execute it. We then use
etdump to find the EFI System Partition image in the El Torito catalog and
add an entry to the GPT that allows EFI to find it.

Reviewed by: gjb, imp
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D15051

6 years agoRemove references to fs_nofault_intr_begin/end.
brooks [Tue, 17 Apr 2018 22:30:00 +0000 (22:30 +0000)]
Remove references to fs_nofault_intr_begin/end.

These should have removed in r332656.

Reported by: mjg, lidl

6 years agoMake it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
trasz [Tue, 17 Apr 2018 19:39:47 +0000 (19:39 +0000)]
Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
eg "usbconfig ugen1.2 dump_all_desc".

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoEnsure that m and skip_m belong to the same object.
markj [Tue, 17 Apr 2018 18:49:17 +0000 (18:49 +0000)]
Ensure that m and skip_m belong to the same object.

Pages allocated from a given reservation may belong to different
objects. It is therefore possible for vm_page_ps_test() to be called
with the base page's object unlocked. Check for this case before
asserting that the object lock is held.

Reported by: jhb
Reviewed by: kib
MFC after: 1 week

6 years agoProperly do a deep copy of the ioctls capability array for fget_cap().
jhb [Tue, 17 Apr 2018 18:07:40 +0000 (18:07 +0000)]
Properly do a deep copy of the ioctls capability array for fget_cap().

fget_cap() tries to do a cheaper snapshot of a file descriptor without
holding the file descriptor lock.  This snapshot does not do a deep
copy of the ioctls capability array, but instead uses a different
return value to inform the caller to retry the copy with the lock
held.  However, filecaps_copy() was returning 1 to indicate that a
retry was required, and fget_cap() was checking for 0 (actually
'!filecaps_copy()').  As a result, fget_cap() did not do a deep copy
of the ioctls array and just reused the original pointer.  This cause
multiple file descriptor entries to think they owned the same pointer
and eventually resulted in duplicate frees.

The only code path that I'm aware of that triggers this is to create a
listen socket that has a restricted list of ioctls and then call
accept() which calls fget_cap() with a valid filecaps structure from
getsock_cap().

To fix, change the return value of filecaps_copy() to return true if
it succeeds in copying the caps and false if it fails because the lock
is required.  I find this more intuitive than fixing the caller in
this case.  While here, change the return type from 'int' to 'bool'.

Finally, make filecaps_copy() more robust in the failure case by not
copying any of the source filecaps structure over.  This avoids the
possibility of leaking a pointer into a structure if a similar future
caller doesn't properly handle the return value from filecaps_copy()
at the expense of one more branch.

I also added a test case that panics before this change and now passes.

Reviewed by: kib
Discussed with: mjg (not a fan of the extra branch)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15047

6 years agoRemove the unused fuwintr() and suiwintr() functions.
brooks [Tue, 17 Apr 2018 18:04:28 +0000 (18:04 +0000)]
Remove the unused fuwintr() and suiwintr() functions.

Half of implementations always failed (returned (-1)) and they were
previously used in only one place.

Reviewed by: kib, andrew
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15102

6 years agolibmd: Remove trailing whitespace from mdXhl.c
cem [Tue, 17 Apr 2018 17:23:47 +0000 (17:23 +0000)]
libmd: Remove trailing whitespace from mdXhl.c

No functional change.

Reported by: me, in a CR from three years ago today
Sponsored by: Dell EMC Isilon

6 years agoRemove unused implementations of copyoutstr().
brooks [Tue, 17 Apr 2018 17:20:04 +0000 (17:20 +0000)]
Remove unused implementations of copyoutstr().

Also remove the commented out documentation.  The documentation arrived
with the import of the copy.9 manpage.  I suspect the implementations
came from NetBSD while bootstrapping the Arm and MIPS ports.

Reviewed by: andrew, jmallett
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15108

6 years agoRestore SIOCGI2C functionality to ixgbe
gallatin [Tue, 17 Apr 2018 16:51:27 +0000 (16:51 +0000)]
Restore SIOCGI2C functionality to ixgbe

When ixgbe was converted to iflib, it lost the SIOCGI2C support
that allows ifconfig to print SFP state, optical light levels, etc.
Restore this by plugging in to the ifdi_i2c_req iflib method.  Note
that the sanity checking on dev_addr that used to be done in ixgbe is
now done in iflib.

Reviewed by: erj, Matthew Macy <mmacy@mattmacy.io>
Sponsored by: Netflix

6 years agoAdd PNP info to the PCI attahement of the puc driver.
imp [Tue, 17 Apr 2018 16:46:08 +0000 (16:46 +0000)]
Add PNP info to the PCI attahement of the puc driver.

Adjust sys/conf/files and sys/modules/puc/Makefile to omit
pucdata.c now tht it's included by puc_pci.c.

Submitted by: Lakhan Shiva Kamireddy (with build fixes by me)
Pull Request: https://github.com/freebsd/freebsd/pull/136

6 years agoAdd PNP info to the bce driver.
imp [Tue, 17 Apr 2018 16:46:01 +0000 (16:46 +0000)]
Add PNP info to the bce driver.

Submitted by: Lakhan Shiva Kamireddy
Pull Request: https://github.com/freebsd/freebsd/pull/136

6 years agoStop using fuswintr() and suswintr() in the profiler.
brooks [Tue, 17 Apr 2018 16:36:53 +0000 (16:36 +0000)]
Stop using fuswintr() and suswintr() in the profiler.

Always take the AST path rather than calling MD functions which are
often implemented as always failing. The is the case on amd64, arm,
i386, and powerpc. This optimization (inherited from 4.4 Lite) is a
pessimization on those architectures and is the sole use of these
functions. They will be removed in a seperate commit.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15101

6 years agolld: add a __FreeBSD_version-style identifier to version
emaste [Tue, 17 Apr 2018 16:21:23 +0000 (16:21 +0000)]
lld: add a __FreeBSD_version-style identifier to version

This will faciliate a WITH_SYSTEM_LINKER option.

Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15110

6 years agoRestore db_radix on parse error, otherwise we'll silently change it to
imp [Tue, 17 Apr 2018 15:44:05 +0000 (15:44 +0000)]
Restore db_radix on parse error, otherwise we'll silently change it to
10 on a botched trace command.

6 years agoMoved opts-stack.h include before all other includes.
ram [Tue, 17 Apr 2018 15:29:32 +0000 (15:29 +0000)]
Moved opts-stack.h include before all other includes.

PR: 227446
Approved by: ken
MFC after: 3 days

6 years agoMake lagg creation more fault tolerant
gallatin [Tue, 17 Apr 2018 12:54:58 +0000 (12:54 +0000)]
Make lagg creation more fault tolerant

- Warn, don't exit, when SIOCSLAGGPORT returns an error.

When we exit with an error during lagg creation, a single
failed NIC (which no longer attaches) can prevent lagg
creation and other configuration, such as adding an IPv4
address, and thus leave a machine unreachable.

- Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT,
  in case scripts are looking for it. Hopefully this can be
  extended if other parts of ifconfig can allow a "soft" failure.

- Improve the warning message to mention what lagg and what
  member are problematic.

Reviewed by: jtl, glebius
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15046

6 years agoDon't put multiple names on a single .Nm line. This fixes apropos(1)
trasz [Tue, 17 Apr 2018 09:05:46 +0000 (09:05 +0000)]
Don't put multiple names on a single .Nm line.  This fixes apropos(1)
output, from this:

strnlen, strlen, strlen,(3) - find length of string                                                                                                                                                     │·······

... to this:

strlen, strnlen(3) - find length of string

PR: 223525
MFC after: 2 weeks

6 years agoMFV man pages update from r329502: 7614 zfs device evacuation/removal.
mav [Tue, 17 Apr 2018 02:33:54 +0000 (02:33 +0000)]
MFV man pages update from r329502: 7614 zfs device evacuation/removal.

MFC after: 3 days

6 years agoquota(1): Fix calculation overflow and underflow
cem [Mon, 16 Apr 2018 19:33:04 +0000 (19:33 +0000)]
quota(1): Fix calculation overflow and underflow

For very large quotas, do the multiplication as a 64 bit value to avoid
overflow.

For very small block sizes (smaller than DEV_BSIZE), multiple first
before dividing by block size to avoid underflow.

PR: 227496
Submitted by: Per Andersson <pa AT chalmers.se>
Sponsored by: Dell EMC Isilon

6 years agolio_listio: return EAGAIN instead of EIO when out of resources
asomers [Mon, 16 Apr 2018 18:12:15 +0000 (18:12 +0000)]
lio_listio: return EAGAIN instead of EIO when out of resources

This behavior is already documented by the man page, and suggested by POSIX.

Reviewed by: jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15099

6 years agoRemove support for FDDI and token ring media types in userland utilities.
brooks [Mon, 16 Apr 2018 18:07:51 +0000 (18:07 +0000)]
Remove support for FDDI and token ring media types in userland utilities.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15077

6 years agoRemove unused badaddr() function.
brooks [Mon, 16 Apr 2018 17:43:26 +0000 (17:43 +0000)]
Remove unused badaddr() function.

Reviewed by: jmallett
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15078