]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r319948: 5428 provide fts(), reallocarray(), and strtonum()
Andriy Gapon [Wed, 14 Jun 2017 16:42:38 +0000 (16:42 +0000)]
MFV r319948: 5428 provide fts(), reallocarray(), and strtonum()

illumos/illumos-gate@4585130b259133a26efae68275dbe56b08366deb
https://github.com/illumos/illumos-gate/commit/4585130b259133a26efae68275dbe56b08366deb

https://www.illumos.org/issues/5428

Most of the upstream change is not applicable to FreeBSD.
Only the renaming of strtonum to zfs_strtonum is relevant to us.
And we already had it partially done.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
MFC after: 1 week

7 years ago5428 provide fts(), reallocarray(), and strtonum()
Andriy Gapon [Wed, 14 Jun 2017 16:36:01 +0000 (16:36 +0000)]
5428 provide fts(), reallocarray(), and strtonum()

illumos/illumos-gate@4585130b259133a26efae68275dbe56b08366deb
https://github.com/illumos/illumos-gate/commit/4585130b259133a26efae68275dbe56b08366deb

https://www.illumos.org/issues/5428

Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

7 years agoMFV r319945,r319946: 8264 want support for promoting datasets in libzfs_core
Andriy Gapon [Wed, 14 Jun 2017 16:31:36 +0000 (16:31 +0000)]
MFV r319945,r319946: 8264 want support for promoting datasets in libzfs_core

illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37
https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37

https://www.illumos.org/issues/8264
  Oddly there is a lzc_clone function, but no lzc_promote function.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@kebe.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Andrew Stormont <astormont@racktopsystems.com>
MFC after: 1 week

7 years ago8264 want support for promoting datasets in libzfs_core
Andriy Gapon [Wed, 14 Jun 2017 16:27:54 +0000 (16:27 +0000)]
8264 want support for promoting datasets in libzfs_core

illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37
https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37

https://www.illumos.org/issues/8264
  Oddly there is a lzc_clone function, but no lzc_promote function.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@kebe.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Andrew Stormont <astormont@racktopsystems.com>

7 years ago8264 want support for promoting datasets in libzfs_core
Andriy Gapon [Wed, 14 Jun 2017 16:23:15 +0000 (16:23 +0000)]
8264 want support for promoting datasets in libzfs_core

illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37
https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37

https://www.illumos.org/issues/8264
  Oddly there is a lzc_clone function, but no lzc_promote function.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@kebe.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Andrew Stormont <astormont@racktopsystems.com>

7 years agoCheck return value from soaccept().
Gleb Smirnoff [Wed, 14 Jun 2017 16:13:20 +0000 (16:13 +0000)]
Check return value from soaccept().

Coverity: 1376209

7 years agoDon't try to assign interrupts to a CPU on single-CPU systems.
John Baldwin [Wed, 14 Jun 2017 13:34:09 +0000 (13:34 +0000)]
Don't try to assign interrupts to a CPU on single-CPU systems.

All interrupts are routed to the sole CPU in that case implicitly.
This is a regression in EARLY_AP_STARTUP.  Previously the 'assign_cpu'
variable was only set when a multi-CPU system finished booting, so
it's value both meant that interrupts could be assigned and that
there was more than one CPU.

PR: 219882
Reported by: ota@j.email.ne.jp
MFC after: 3 days

7 years agoddb show files: fix up file types and whitespace
Ryan Libby [Wed, 14 Jun 2017 07:46:52 +0000 (07:46 +0000)]
ddb show files: fix up file types and whitespace

This makes ddb show files more descriptive and also adjusts the
whitespace to align the columns for non-32-bit architectures.

Reviewed by: cem (previous version), jhb
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D11061

7 years agoActually add the mpc85xx_get_platform_clock() function.
Justin Hibbits [Wed, 14 Jun 2017 04:26:37 +0000 (04:26 +0000)]
Actually add the mpc85xx_get_platform_clock() function.

Follow up r319935 by actually committing the mpc85xx_get_platform_clock()
function.  This function was created to facilitate other development, and I
thought I had committed it earlier.

Some blocks depend on the platform clock rather than the system clock.
The System clock is derived from the platform clock as one-half the
platform clock.  Rewrite mpc85xx_get_system_clock() to use the new
function.

Pointy-hat to: jhibbits

7 years agoUse mpc85xx_get_platform_clock() instead of rolling our own.
Justin Hibbits [Wed, 14 Jun 2017 04:16:37 +0000 (04:16 +0000)]
Use mpc85xx_get_platform_clock() instead of rolling our own.

Now that we have a single source for the platform clock, we don't need to
roll our own in every user.

7 years agoDon't call vm_pager_page_unswapped() when writing or deleting a dirty page.
Mark Johnston [Wed, 14 Jun 2017 03:55:11 +0000 (03:55 +0000)]
Don't call vm_pager_page_unswapped() when writing or deleting a dirty page.

The swap space backing a clean page is released when it is first dirtied,
so there's no need to attempt to release swap space when the page is
already dirty.

Reviewed by: alc
MFC after: 1 week

7 years agoFree the request page if an I/O error occurs while reading from swap.
Mark Johnston [Wed, 14 Jun 2017 03:50:02 +0000 (03:50 +0000)]
Free the request page if an I/O error occurs while reading from swap.

After such a failure, the page is invalid, so there's point in keeping it
around. Moreover, such pages were not being inserted into the active queue,
making them unreclaimable until a subsequent write or delete made them
valid.

Reported by: alc
Reviewed by: alc (previous revision)
MFC after: 1 week

7 years agoFix handling of subpage BIO_WRITE and BIO_DELETE requests on swap MDs.
Mark Johnston [Wed, 14 Jun 2017 03:45:26 +0000 (03:45 +0000)]
Fix handling of subpage BIO_WRITE and BIO_DELETE requests on swap MDs.

Such requests would previously mark the entire page as valid, which was
incorrect since nothing guaranteed that the page's contents had been
initialized. This change also modifies subpage BIO_DELETEs so that the
entire page is marked dirty, rather than only a subrange. There is no
benefit to creating partially dirty swap pages.

Reviewed by: alc, kib (previous version)
MFC after: 3 days

7 years agoChase r319848: remove -v option from getopt() call.
Cy Schubert [Wed, 14 Jun 2017 02:42:38 +0000 (02:42 +0000)]
Chase r319848: remove -v option from getopt() call.

7 years ago-n (do nothing) is not a commmand option.
Cy Schubert [Wed, 14 Jun 2017 02:41:22 +0000 (02:41 +0000)]
-n (do nothing) is not a commmand option.

7 years agoUse nitems(..) when computing `max` instead of the longhand version of
Enji Cooper [Wed, 14 Jun 2017 02:28:10 +0000 (02:28 +0000)]
Use nitems(..) when computing `max` instead of the longhand version of
the same logic

MFC after: 1 month

7 years agoAdd myself (rlibby) as a src committer and markj as my mentor.
Ryan Libby [Tue, 13 Jun 2017 23:50:55 +0000 (23:50 +0000)]
Add myself (rlibby) as a src committer and markj as my mentor.

Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D11189

7 years agobnxt: In case of multi queues, have unique name for different IRQs.
Sean Bruno [Tue, 13 Jun 2017 23:49:49 +0000 (23:49 +0000)]
bnxt: In case of multi queues, have unique name for different IRQs.

Submitted by: bhargava.marreddy@broadcom.com
Differential Revision: https://reviews.freebsd.org/D11149

7 years agoAdd new sysctl to allow changing of timing of the txq timers.
Sean Bruno [Tue, 13 Jun 2017 23:16:38 +0000 (23:16 +0000)]
Add new sysctl to allow changing of timing of the txq timers.

Add new sysctl to override use of busdma in the driver.

Submitted by: Drew Gallitin <gallatin@netflix.com>

7 years agoRevert r319796 for now, it can cause undefined references when linking
Dimitry Andric [Tue, 13 Jun 2017 21:01:06 +0000 (21:01 +0000)]
Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

7 years agoPlug mbuf leak in the busdma path of iflib.
Sean Bruno [Tue, 13 Jun 2017 19:32:23 +0000 (19:32 +0000)]
Plug mbuf leak in the busdma path of iflib.

Submitted by: Michael Tuexen <tuexen@freebsd.org>
Reported by: Drew Gallitin <gallatin@netflix.com>

7 years agoRemove stray return.
Konstantin Belousov [Tue, 13 Jun 2017 19:02:12 +0000 (19:02 +0000)]
Remove stray return.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoEnable HWPMC overflow IRQ on both CPUs in MPIC
Zbigniew Bodek [Tue, 13 Jun 2017 18:55:21 +0000 (18:55 +0000)]
Enable HWPMC overflow IRQ on both CPUs in MPIC

This commit enables usage of HWPMC interrupts for the
Marvell SoCs, which use MPIC (Armada38x and ArmadaXP).
Those interrupts require extra unmasking, comparing to
others. Also, in order to process counters per-CPU,
they are masked/unmasked using separate registers' sets
for each core.

Submitted by: Michal Mazur <mkm@semihalf.com>
           Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10913

7 years agoFix INVARIANTS debug code in HWPMC
Zbigniew Bodek [Tue, 13 Jun 2017 18:53:56 +0000 (18:53 +0000)]
Fix INVARIANTS debug code in HWPMC

When HWPMC stops sampling, ps_pmc may be freed before samples
are processed. In such situation treat PMC as stopped.
Add "ifdef" to fix build without INVARIANTS code.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10912

7 years agoFix event table for Cortex A9.
Zbigniew Bodek [Tue, 13 Jun 2017 18:52:39 +0000 (18:52 +0000)]
Fix event table for Cortex A9.

Removed events 0x8 (INSTR_EXECUTED), 0xE (PC_PROC_RETURN) and
0x13-0x1d not supported on Cortex A9.
Add events 0x68 and 0x6E which replaced 0x8 and 0xE.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10911

7 years agoFix HWPMC interrupt handling in Counting Mode
Zbigniew Bodek [Tue, 13 Jun 2017 18:51:23 +0000 (18:51 +0000)]
Fix HWPMC interrupt handling in Counting Mode

Additionally:
 - Fix support for Cycle Counter (evsel == 0xFF)
 - Stop and mask interrupts from all counters on init and finish

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10910

7 years agoAdd detection of CPU class for ARMv6/v7
Zbigniew Bodek [Tue, 13 Jun 2017 18:50:08 +0000 (18:50 +0000)]
Add detection of CPU class for ARMv6/v7

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: andrew
Differential revision: https://reviews.freebsd.org/D10909

7 years agoEnable in-band link management on A388-Clearfog board
Zbigniew Bodek [Tue, 13 Jun 2017 18:48:51 +0000 (18:48 +0000)]
Enable in-band link management on A388-Clearfog board

This patch adds in-band link management over SGMII of the
SFP transceiver on Armada-388-Clearfog board.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Netgate
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10708

7 years agoEnable neta controller support in ARMADA38X
Zbigniew Bodek [Tue, 13 Jun 2017 18:47:42 +0000 (18:47 +0000)]
Enable neta controller support in ARMADA38X

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10707

7 years agoIntroduce Armada 38x/XP network controller support
Zbigniew Bodek [Tue, 13 Jun 2017 18:46:29 +0000 (18:46 +0000)]
Introduce Armada 38x/XP network controller support

This patch contains a new driver for the network unit of Marvell
Armada 38x/XP SoCs, called NETA. This support was thoroughly tested
and optimised in terms of stability and performance. Additional
hardware features, like Buffer Management (BM) or Parser and Classifier
(PnC) will be progressively supported as needed.

Submitted by: Fabien Thomas <fabien.thomas@stormshield.eu>
      Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
      Zbigniew Bodek <zbb@semihalf.com>
      Michal Mazur <mkm@semihalf.com>
      Bartosz Szczepanek <bsz@semihalf.com>
      Marcin Wojtas <mw@semihalf.com>

Obtained from: Semihalf
Sponsored by: Stormshield (main development)
Netgate (cleanup and upstreaming)
Differential revision: https://reviews.freebsd.org/D10706

7 years agoPrevent multiple lock initialization in e6000sw probe
Zbigniew Bodek [Tue, 13 Jun 2017 18:35:14 +0000 (18:35 +0000)]
Prevent multiple lock initialization in e6000sw probe

r319886 ("Add the initial support for the Marvell 88E6141
and 88E6341 switches.") unveiled a problem with possible
multiple lock creation. Move its initialization
to the driver attach and for obtaining the switch ID
create a temprorary one, which is immediately destroyed
after the check.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
      Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf

7 years agoReduce the frequency of hint updates on allocation without incurring
Alan Cox [Tue, 13 Jun 2017 17:49:49 +0000 (17:49 +0000)]
Reduce the frequency of hint updates on allocation without incurring
additional allocation overhead.  Previously, blst_meta_alloc() updated the
hint after every successful allocation.  However, these "eager" hint
updates are of no actual benefit if, instead, the "lazy" hint update at
the start of blst_meta_alloc() is generalized to handle all cases where
the number of available blocks is less than the requested allocation.
Previously, the lazy hint update at the start of blst_meta_alloc() only
handled the ALL-FULL case.  (I would also note that this change provides
consistency between blist_alloc() and blist_fill() in that their hint
maintenance is now entirely lazy.)

Eliminate unnecessary checks for terminators in blst_meta_alloc() and
blst_meta_fill() when handling ALL-FREE meta nodes.

Eliminate the field "bl_free" from struct blist.  It is redundant.  Unless
the entire radix tree is a single leaf, the count of free blocks is stored
in the root node.  Instead, provide a function blist_avail() for obtaining
the number of free blocks.

In blst_meta_alloc(), perform a sanity check on the allocation once rather
than repeating it in a loop over the meta node's children.

In blst_leaf_fill(), use the optimized bitcount*() function instead of a
loop to count the blocks being allocated.

Add or improve several comments.

Address some nearby style errors.

Reviewed by: kib
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D11146

7 years agostyle(9) fixes.
Olivier Houchard [Tue, 13 Jun 2017 16:19:32 +0000 (16:19 +0000)]
style(9) fixes.

Reported by: cem

7 years agoThe variable nargv is allocated but never freed, so free it when the it
Stephen J. Kiernan [Tue, 13 Jun 2017 15:50:16 +0000 (15:50 +0000)]
The variable nargv is allocated but never freed, so free it when the it
is no longer used.

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: ed
Approved by: sjg (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9652

7 years agoHint at the intended usage for the "ll" field of struct uuid_private.
Mark Johnston [Tue, 13 Jun 2017 15:37:04 +0000 (15:37 +0000)]
Hint at the intended usage for the "ll" field of struct uuid_private.

Discussed with: kib
MFC after: 1 week

7 years agosbin/ipfw: strcpy, strncpy => strlcpy
Alan Somers [Tue, 13 Jun 2017 14:57:48 +0000 (14:57 +0000)]
sbin/ipfw: strcpy, strncpy => strlcpy

Reported by: Coverity
CID: 13561621356166
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10662

7 years agoAdd missing header dependencies (based on looking in the .depend file).
Ian Lepore [Tue, 13 Jun 2017 14:07:13 +0000 (14:07 +0000)]
Add missing header dependencies (based on looking in the .depend file).

Reported by: gjb

7 years agoHandle partial writes
Pietro Cerutti [Tue, 13 Jun 2017 13:26:50 +0000 (13:26 +0000)]
Handle partial writes

Reported by: ed
Reviewed by: cognet
Approved by: cognet

7 years agoImprove yes' throughput
Pietro Cerutti [Tue, 13 Jun 2017 12:35:01 +0000 (12:35 +0000)]
Improve yes' throughput

On my system, this brings up the throughput from ~20 to ~600 MiB/s.

Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/

Reviewed by: cognet
Approved by: cognet

7 years agoImplement tunable CPU quirks.
Michal Meloun [Tue, 13 Jun 2017 12:07:18 +0000 (12:07 +0000)]
Implement tunable CPU quirks.
These quirks are intended for optimizing CPU performance, not for
applying errata workarounds. Nobody can expect that CPU with unfixed
errata is stable enough to execute the kernel until quirks are applied.

MFC after: 3 weeks

7 years agoResurrect RTF_RNH_LOCKED flag and restore ability to call rtalloc1_fib()
Andrey V. Elsukov [Tue, 13 Jun 2017 10:52:31 +0000 (10:52 +0000)]
Resurrect RTF_RNH_LOCKED flag and restore ability to call rtalloc1_fib()
with acquired RIB lock.

This fixes a possible panic due to trying to acquire RIB rlock when it is
already exclusive locked.

PR: 215963, 215122
MFC after: 1 week
Sponsored by: Yandex LLC

7 years agoUse {T:Capacity} for header so html output looks tidy
Phil Shafer [Tue, 13 Jun 2017 05:38:40 +0000 (05:38 +0000)]
Use {T:Capacity} for header so html output looks tidy

Submitted by: phil
Approved by: sjg

7 years agolld: revert accidentally committed change from r319887
Ed Maste [Tue, 13 Jun 2017 01:25:19 +0000 (01:25 +0000)]
lld: revert accidentally committed change from r319887

This change is a portion of LLD rev 305212 which accidentally ended
up in my svn tree. We do want to backport the change to LLD 4.0, but
it needs additional work and was not supposed to be included in
r319887.

7 years agoCorrect bitwise test in mac_bsdextended ugidfw_rule_valid()
Ed Maste [Tue, 13 Jun 2017 01:17:58 +0000 (01:17 +0000)]
Correct bitwise test in mac_bsdextended ugidfw_rule_valid()

PR: 218039
CID: 1008934
Reported by: Coverity, PVS-Studio
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10300

7 years agoBy popular demand: change MAKE_GENERIC_KERNELS to MAKE_LINT_KERNELS.
Ian Lepore [Tue, 13 Jun 2017 01:12:37 +0000 (01:12 +0000)]
By popular demand: change MAKE_GENERIC_KERNELS to MAKE_LINT_KERNELS.

It appears that the same arches that lack GENERIC kernel configs also lack
LINT.  But enough different arches get built to ensure a kernel change
should build everywhere (32 and 64 bit, clang and old gcc, little and big
endian).

7 years agohexdump: actually enter capability mode on last file
Ed Maste [Tue, 13 Jun 2017 01:05:55 +0000 (01:05 +0000)]
hexdump: actually enter capability mode on last file

Reviewed by: cem, Kyle Evans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10897

7 years agoAdd the initial support for the Marvell 88E6141 and 88E6341 switches.
Luiz Otavio O Souza [Tue, 13 Jun 2017 00:42:23 +0000 (00:42 +0000)]
Add the initial support for the Marvell 88E6141 and 88E6341 switches.

Right now the driver only supports port VLANs, so make sure
etherswitch_getinfo() return the proper switch capabilities.

Handle the cases where not all ports are in use (that will also require
etherswitch cooperation).

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agolld: ELF: Fix ICF crash on absolute symbol relocations.
Ed Maste [Tue, 13 Jun 2017 00:31:16 +0000 (00:31 +0000)]
lld: ELF: Fix ICF crash on absolute symbol relocations.

If two sections contained relocations to absolute symbols with the same
value we would crash when trying to access their sections. Add a check that
both symbols point to sections before accessing their sections, and treat
absolute symbols as equal if their values are equal.

Obtained from: LLD commit r292578
MFC after: 3 days

7 years agoDefine NFS_MAXXDR as the upper bound on XDR overhead in an NFS RPC.
Rick Macklem [Mon, 12 Jun 2017 23:41:20 +0000 (23:41 +0000)]
Define NFS_MAXXDR as the upper bound on XDR overhead in an NFS RPC.

This definition is a part of the maxiotune2 patch that will be
committed soon. It is being committed separately to ease merging
with the pNFS projects subversion trees.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D10991

7 years agoUpdate the current version of netmap to bring it in sync with the github
Luiz Otavio O Souza [Mon, 12 Jun 2017 22:53:18 +0000 (22:53 +0000)]
Update the current version of netmap to bring it in sync with the github
version.

This commit contains mostly refactoring, a few fixes and minor added
functionality.

Submitted by: Vincenzo Maffione <v.maffione at gmail.com>
Requested by: many
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoUpdate scescx test to print syscall number and arguments.
Konstantin Belousov [Mon, 12 Jun 2017 21:16:37 +0000 (21:16 +0000)]
Update scescx test to print syscall number and arguments.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

7 years agoAdd ptrace(PT_GET_SC_ARGS) command to return debuggee' current syscall
Konstantin Belousov [Mon, 12 Jun 2017 21:15:43 +0000 (21:15 +0000)]
Add ptrace(PT_GET_SC_ARGS) command to return debuggee' current syscall
arguments.

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D11080

7 years agoPrint unimplemented syscall number to the ctty on SIGSYS, if enabled
Konstantin Belousov [Mon, 12 Jun 2017 21:11:11 +0000 (21:11 +0000)]
Print unimplemented syscall number to the ctty on SIGSYS, if enabled
by the knob kern.lognosys.

Discussed with: imp
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
X-Differential revision: https://reviews.freebsd.org/D11080

7 years agoMove struct syscall_args syscall arguments parameters container into
Konstantin Belousov [Mon, 12 Jun 2017 21:03:23 +0000 (21:03 +0000)]
Move struct syscall_args syscall arguments parameters container into
struct thread.

For all architectures, the syscall trap handlers have to allocate the
structure on the stack.  The structure takes 88 bytes on 64bit arches
which is not negligible.  Also, it cannot be easily found by other
code, which e.g. caused duplication of some members of the structure
to struct thread already.  The change removes td_dbg_sc_code and
td_dbg_sc_nargs which were directly copied from syscall_args.

The structure is put into the copied on fork part of the struct thread
to make the syscall arguments information correct in the child after
fork.

This move will also allow several more uses shortly.

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
X-Differential revision: https://reviews.freebsd.org/D11080

7 years agocxgbe(4): Do not request an FEC setting that the port does not support.
Navdeep Parhar [Mon, 12 Jun 2017 20:55:20 +0000 (20:55 +0000)]
cxgbe(4):  Do not request an FEC setting that the port does not support.

MFC after: 3 days.
Sponsored by: Chelsio Communications

7 years agoMake struct syscall_args visible to userspace compilation environment
Konstantin Belousov [Mon, 12 Jun 2017 20:53:44 +0000 (20:53 +0000)]
Make struct syscall_args visible to userspace compilation environment
from machine/proc.h, consistently on all architectures.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
X-Differential revision: https://reviews.freebsd.org/D11080

7 years agomsdosfs: adjust #ifdefs to be similar to NetBSD
Ed Maste [Mon, 12 Jun 2017 20:42:37 +0000 (20:42 +0000)]
msdosfs: adjust #ifdefs to be similar to NetBSD

- Add header guards where missing
- Make parts available for use in makefs

Sponsored by: The FreeBSD Foundation

7 years agoDecode recently added flags.
Konstantin Belousov [Mon, 12 Jun 2017 20:42:16 +0000 (20:42 +0000)]
Decode recently added flags.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoAdd a helper function for comparing struct uuids.
Mark Johnston [Mon, 12 Jun 2017 20:14:44 +0000 (20:14 +0000)]
Add a helper function for comparing struct uuids.

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11138

7 years agotop: Missing man page update for r319866
Allan Jude [Mon, 12 Jun 2017 19:54:42 +0000 (19:54 +0000)]
top: Missing man page update for r319866

MFC after: 3 days

7 years agotop: Change the way the ZFS ARC compression ratio is calculated
Allan Jude [Mon, 12 Jun 2017 19:51:57 +0000 (19:51 +0000)]
top: Change the way the ZFS ARC compression ratio is calculated

Based on feedback from OpenZFS developers Matt Ahrens and George Wilson,
the calculation of the ratio no longer takes in to account overhead.

The old formula could result in reporting a negative compression ratio

This could confuse the user or give a false impression that there would be
an advantage to disabling the compressed ARC feature.

The new formula will more closely match an average of the on-disk
compression ratio, as reported by the ZFS property 'compressratio'

MFC after: 3 days
Sponsored by: ScaleEngine Inc.

7 years agoremove stale dependencies for utimens* wrappers removed in r319663
Ed Maste [Mon, 12 Jun 2017 19:45:05 +0000 (19:45 +0000)]
remove stale dependencies for utimens* wrappers removed in r319663

Use a similar approach to r318957 (which was for ptrace dependencies):
grep the .depend file for the old source file and delete the stale
dependency if found.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11091

7 years agobsdinstall: support Auto ZFS mode for ARM64
Allan Jude [Mon, 12 Jun 2017 19:31:26 +0000 (19:31 +0000)]
bsdinstall: support Auto ZFS mode for ARM64

Reported by: Shawn Webb
MFC after: 3 days

7 years agobsdinstall: Make ZFS min_auto_ashift adjustment persistent
Allan Jude [Mon, 12 Jun 2017 19:29:31 +0000 (19:29 +0000)]
bsdinstall: Make ZFS min_auto_ashift adjustment persistent

Reported by: feld
Reviewed by: dteske, tsoome
MFC after: 3 days
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D10895

7 years agoMETA_MODE: Show .ERROR_CMD in error.
Bryan Drewery [Mon, 12 Jun 2017 19:13:29 +0000 (19:13 +0000)]
META_MODE: Show .ERROR_CMD in error.

This uses a hack to get the CMD from the meta file rather than
.ERROR_CMD since bmake currently blanks the value for non-jobs
mode.

Reviewed by: sjg (indirectly)
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoMETA_MODE: NO_FILEMON should imply nofilemon.
Bryan Drewery [Mon, 12 Jun 2017 18:44:14 +0000 (18:44 +0000)]
META_MODE: NO_FILEMON should imply nofilemon.

This fixes NO_FILEMON to properly still use .depend.OBJ files
for dependency tracking.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build
Ian Lepore [Mon, 12 Jun 2017 17:22:23 +0000 (17:22 +0000)]
Add support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build
just the GENERIC kernels for each arch (including variations such as
GENERIC-NODEBUG, GENERIC64, etc).

This helps with quickly doing a test build for all[*] arches without
building dozens of variant kernels for the arches that have lots of
hardware/board/system variations.

[*] Not all arches have a generic kernel (but they probably should for
test-building purposes, even if it can't boot on any real hardware).

7 years agoStyle fixes: clean up leading whitespace (8 single column spaces -> \t)
Enji Cooper [Mon, 12 Jun 2017 16:53:42 +0000 (16:53 +0000)]
Style fixes: clean up leading whitespace (8 single column spaces -> \t)

MFC after: 1 month
MFC with: r319714, r319854, r319855, r319856

7 years agoln(1): wordsmith -F option description
Enji Cooper [Mon, 12 Jun 2017 16:43:29 +0000 (16:43 +0000)]
ln(1): wordsmith -F option description

MFC after: 1 month

7 years agoAdd a testcase for `ln -sF`
Enji Cooper [Mon, 12 Jun 2017 16:38:37 +0000 (16:38 +0000)]
Add a testcase for `ln -sF`

The testcase fails today, so mark it with atf_expect_fail: in
particular, the target (B) isn't being unlinked and the documentation
doesn't suggest special handling for directories. Thus, there's either
a doc or an implementation bug in ln(1) that needs to be resolved.

MFC after: 1 month
MFC with: r319714, r319854, r319855
PR: 219943
Reviewed by: ngie
Submitted by: shivansh
Differential Revision: D11159 (part of a larger diff)
Sponsored by: Google, Inc (GSoC 2017)

7 years agoUse readlink(1)/stat(1) to query symlinks instead of file(1)
Enji Cooper [Mon, 12 Jun 2017 16:31:32 +0000 (16:31 +0000)]
Use readlink(1)/stat(1) to query symlinks instead of file(1)

file(1) can be compiled out of the system via MK_FILE == no, and the
output isn't guaranteed to be stable. It's better to use stat(1)/readlink(1)
instead to query symlink/file paths.

MFC after: 1 month
MFC with: r319714, r319854
Reported by: ngie
Submitted by: shivansh
Differential Revision: D11159 (part of a larger diff)
Sponsored by: Google, Inc (GSoC 2017)

7 years agobin/ln: Set umask appropriately before creating files for testing
Alan Somers [Mon, 12 Jun 2017 14:54:59 +0000 (14:54 +0000)]
bin/ln: Set umask appropriately before creating files for testing

These changes were missed in D11084

Submitted by: shivansh
Reviewed by: asomers
MFC after: 1 month
X-MFC-With: 319714
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11158

7 years agomakefs: use C standard memcpy/memset in userland
Ed Maste [Mon, 12 Jun 2017 13:49:57 +0000 (13:49 +0000)]
makefs: use C standard memcpy/memset in userland

This file does not exist in NetBSD's makefs, but make the chance for
consistency with memcpy/memset used in the rest of makefs.

Sponsored by: The FreeBSD Foundation

7 years agoFix buffer lengths.
Xin LI [Mon, 12 Jun 2017 09:11:31 +0000 (09:11 +0000)]
Fix buffer lengths.

After r319369, the RPC code validates caller supplied buffer length in
taddr2uaddr.  When no -h is specified, the sizeof(ai_addr) is used,
which is always smaller than the required size and therefore uaddr
would be NULL, causing the kernel to copyin() from userland NULL
and fail with EFAULT.

Reviewed by: kevlo (via Telegram)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11151

7 years agoRemove the outdated definition.
Dmitry Chagin [Mon, 12 Jun 2017 07:48:51 +0000 (07:48 +0000)]
Remove the outdated definition.

MFC after: 1 week

7 years agoAdd some initial basic tests for du(1)
Enji Cooper [Mon, 12 Jun 2017 07:43:58 +0000 (07:43 +0000)]
Add some initial basic tests for du(1)

Tests that exercise the following flags are added in this commit:
- -A
- -H
- -I
- -g
- -h
- -k
- -m

Additional tests will be added soon.

MFC after: 1 month

7 years agoSince r318735 (ino64 project) the size of the native struct dirent is
Dmitry Chagin [Mon, 12 Jun 2017 07:35:59 +0000 (07:35 +0000)]
Since r318735 (ino64 project) the size of the native struct dirent is
equal or greater than the size of Linux struct dirent or struct dirent64.
So, remove LINUX_RECLEN_RATIO magic as useless.

7 years ago-v (verbose) is not a command option. (See ippool.1 for a definition
Cy Schubert [Mon, 12 Jun 2017 06:08:57 +0000 (06:08 +0000)]
-v (verbose) is not a command option. (See ippool.1 for a definition
of command options).

7 years agoAdd some testcases for `diff --side-by-side` support
Enji Cooper [Mon, 12 Jun 2017 05:11:43 +0000 (05:11 +0000)]
Add some testcases for `diff --side-by-side` support

These are were created proactively, in anticipation of the support being
fully implemented sometime in the future.

The tests currently fail on ^/head@r319845, however. Expect them to fail.

PR: 219933
Tested with: gdiff

7 years agodu(1): trivial whitespace cleanup
Enji Cooper [Mon, 12 Jun 2017 02:42:39 +0000 (02:42 +0000)]
du(1): trivial whitespace cleanup

MFC after: 1 month

7 years agoRemove stdlib.h #include added in r319844
Enji Cooper [Mon, 12 Jun 2017 02:38:37 +0000 (02:38 +0000)]
Remove stdlib.h #include added in r319844

A previous iteration of the tests I added in r319844 involved free(3), but
that attempt didn't pan out, so I switched to stack allocated buffers instead
of heap allocated ones, making the #include unnecessary.

MFC after: 1 month
MFC with: r319844

7 years agoAdd positive and negative testcases for cam_get_device(3)
Enji Cooper [Mon, 12 Jun 2017 02:12:22 +0000 (02:12 +0000)]
Add positive and negative testcases for cam_get_device(3)

MFC after: 1 month
Submitted by: Evan Cramer <evan.cramer@isilon.com>

7 years agoFix 'restart' action: rc.subr only expects to restart one service, not two.
Gregory Neil Shapiro [Mon, 12 Jun 2017 01:26:36 +0000 (01:26 +0000)]
Fix 'restart' action: rc.subr only expects to restart one service, not two.

PR: 217393
Reported by: Martin Simmons
MFC after: 1 week

7 years agogetbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE
Enji Cooper [Mon, 12 Jun 2017 00:43:14 +0000 (00:43 +0000)]
getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE
gets output via warnx(3)

This helps set expectations for how one might deal with those messages, i.e.,
mute output from /dev/stderr today, since that's where vwarn(3) outputs messages
to today.

MFC after: 1 month

7 years agoAdd initial tests for stat(1)
Enji Cooper [Mon, 12 Jun 2017 00:21:55 +0000 (00:21 +0000)]
Add initial tests for stat(1)

Testcases for -H, -L, and -f haven't been implemented yet, in part due
to additional complexity needed to validate the features:
* -H and -f will require an external "helper" program to display/modify
  the state/permissions for a given path.
* -L is being covered partially via the -n testcase today.

MFC after: 1 month

7 years agostat(1): sort flags in the DESCRIPTION section
Enji Cooper [Sun, 11 Jun 2017 21:23:54 +0000 (21:23 +0000)]
stat(1): sort flags in the DESCRIPTION section

-x's description should come after -t's description.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoWrite up some basic tests for readlink(1)
Enji Cooper [Sun, 11 Jun 2017 21:13:12 +0000 (21:13 +0000)]
Write up some basic tests for readlink(1)

The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoAdd more simple positive tests for chown(1)
Enji Cooper [Sun, 11 Jun 2017 19:31:42 +0000 (19:31 +0000)]
Add more simple positive tests for chown(1)

The tests are largely symmetric with the tests for chmod(1)--added in r319642.

Remove chown-f_test (added in r268030) since the test coverage is now being
provided by `chown_test`.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoRemove unnecessary, and mismatched, comment.
Pedro F. Giffuni [Sun, 11 Jun 2017 19:09:10 +0000 (19:09 +0000)]
Remove unnecessary, and mismatched, comment.

Submitted by: Fedor Uporov

7 years agorc.subr: Optimize repeated sourcing.
Jilles Tjoelker [Sun, 11 Jun 2017 19:06:07 +0000 (19:06 +0000)]
rc.subr: Optimize repeated sourcing.

When /etc/rc runs all /etc/rc.d scripts, it has already loaded /etc/rc.subr
but each /etc/rc.d script sources it again (since /etc/rc.d scripts must
also work when started stand-alone).

Therefore, if rc.subr is already loaded, return so sh need not parse the
rest of the file.

A second effect is that there is no longer a compound command around most of
rc.subr. This reduces memory usage while sh is loading rc.subr for the first
time (but this memory is free()d once rc.subr is loaded).

For purposes of porting this to other systems, I do not recommend porting
this to systems with shells that do not have the change to the return
special builtin like in r255215 (before FreeBSD 10.0-RELEASE). This change
ensures that return in the top level of a dot script returns from the dot
script, even if the dot script was sourced from a function.

A comparison of CPU time on an amd64 bhyve virtual machine from a times
command added near the end of /etc/rc, all four values summed:

x orig1
+ quickreturn
+--------------------------------------------------------------------------+
|  +    +              +                             x    x               x|
||______M__A_________|                             |______M___A__________| |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   3         1.704         1.802         1.726         1.744   0.051419841
+   3         1.467         1.559         1.487     1.5043333   0.048387326
Difference at 95.0% confidence
-0.239667 +/- 0.113163
-13.7424% +/- 6.48873%
(Student's t, pooled s = 0.0499266)

7 years agoextfs: fix the build with no UFS_ACL.
Pedro F. Giffuni [Sun, 11 Jun 2017 19:05:45 +0000 (19:05 +0000)]
extfs: fix the build with no UFS_ACL.

Some people may want to drop UFS-style ACLs for slimmer kernels.
Let's just not assume everyone needs ACLs.

Reported by: bde
Submitted by: Fedor Uporov
Differential Revision: https://reviews.freebsd.org/D11145

7 years agosh: Enable interrupts before executing EXIT trap and doing final flush.
Jilles Tjoelker [Sun, 11 Jun 2017 16:54:04 +0000 (16:54 +0000)]
sh: Enable interrupts before executing EXIT trap and doing final flush.

7 years agoMore accurately handle early EFER restoration on resume.
Konstantin Belousov [Sun, 11 Jun 2017 14:39:08 +0000 (14:39 +0000)]
More accurately handle early EFER restoration on resume.

Do not try to set LMA bit while CPU is still in legacy mode.
Apparently Intel CPUs ignore non-id writes to LMA, while AMD's
(over-)react with #GP.

Reported and tested by: danfe
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoTidy up minor nits raised by mandoc lint:
Sevan Janiyan [Sun, 11 Jun 2017 14:33:16 +0000 (14:33 +0000)]
Tidy up minor nits raised by mandoc lint:
Zap trailing white and double spaces
Remove extra coma which is not required.
Bump date.

Reviewed by: gnn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11142

7 years agoFlag loadpoolfile() (ippool -f) command line syntax errors.
Cy Schubert [Sun, 11 Jun 2017 04:03:09 +0000 (04:03 +0000)]
Flag loadpoolfile() (ippool -f) command line syntax errors.

7 years agoIdentify poolstats() (ippool -s) command line syntax errors.
Cy Schubert [Sun, 11 Jun 2017 04:00:26 +0000 (04:00 +0000)]
Identify poolstats() (ippool -s) command line syntax errors.

7 years agoIdentify command line syntax errors in poolflush() (ippool -F).
Cy Schubert [Sun, 11 Jun 2017 03:56:13 +0000 (03:56 +0000)]
Identify command line syntax errors in poolflush() (ippool -F).

7 years agoConvert from local code and constants for mac<->phy connection type to new
Ian Lepore [Sun, 11 Jun 2017 00:44:19 +0000 (00:44 +0000)]
Convert from local code and constants for mac<->phy connection type to new
common fdt helper code.

7 years agoAdd a driver for the Vitesse/Microsemi VSC8501 PHY.
Ian Lepore [Sun, 11 Jun 2017 00:38:16 +0000 (00:38 +0000)]
Add a driver for the Vitesse/Microsemi VSC8501 PHY.

7 years agoAdd some utility functions to help a PHY driver on an FDT-configured
Ian Lepore [Sun, 11 Jun 2017 00:16:21 +0000 (00:16 +0000)]
Add some utility functions to help a PHY driver on an FDT-configured
system retrieve its config data from the fdt data.

The properties that are common to all phys are decoded and returned in a
structure.  The fdt node handles for the mac and phy devices are also
returned in the config data struct, so a driver can easily obtain additional
hardware-specific config values from the fdt data.