]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRestore original (pre r315760) naming for Tegra SDHCI device.
mmel [Thu, 23 Mar 2017 08:16:53 +0000 (08:16 +0000)]
Restore original (pre r315760) naming for Tegra SDHCI device.

Newbus handles multiple equally named device classes without problems,
so there is no reason to use slightly cryptic "<foo>_shdci" for them.
In contrast, the driver module name must be unique, so "<foo>_shdci"
is the right name for it.

7 years agoRevert r315800, it was committed with invalid (unsaved) commit log.
mmel [Thu, 23 Mar 2017 08:15:11 +0000 (08:15 +0000)]
Revert r315800, it was committed with invalid (unsaved) commit log.

7 years agoTry polishing up iflib manpages a bit (basically all the low hanging fruit)
ngie [Thu, 23 Mar 2017 07:36:38 +0000 (07:36 +0000)]
Try polishing up iflib manpages a bit (basically all the low hanging fruit)

igor:
- Fix typos.
- Delete trailing whitespace.

manlint:
- Use .Fo/.Fc/.Fa when describing functions.
- Use .Xr.
- Fill in SEE ALSO section.
- Fix .Dt use: the section was specified incorrectly and the name
  had a lowercase character.
- Continue new sentences on new lines.

Miscellaneous:
- Remove unnecessary quotes around "SEE ALSO" section headers.
- Sprinkle .Dv use in spots with constants.

Reported by: igor, make manlint
Sponsored by: Dell EMC Isilon

7 years agoPCI_IOV_*INIT(9): fix make manlint warnings
ngie [Thu, 23 Mar 2017 06:11:31 +0000 (06:11 +0000)]
PCI_IOV_*INIT(9): fix make manlint warnings

Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr
from the other corresponding manpage.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agomemguard(9): fix igor/manlint warnings
ngie [Thu, 23 Mar 2017 06:08:01 +0000 (06:08 +0000)]
memguard(9): fix igor/manlint warnings

- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agoifnet(9): fix some igor/manlint warnings
ngie [Thu, 23 Mar 2017 06:02:23 +0000 (06:02 +0000)]
ifnet(9): fix some igor/manlint warnings

- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agodnv(9): fix use of commas with .Nm in NAME section
ngie [Thu, 23 Mar 2017 05:54:07 +0000 (05:54 +0000)]
dnv(9): fix use of commas with .Nm in NAME section

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoRelease all previously allocated resources.
mmel [Thu, 23 Mar 2017 05:54:03 +0000 (05:54 +0000)]
Release all previously allocated resources.

7 years agocounter(9): fix igor/manlint warnings
ngie [Thu, 23 Mar 2017 05:51:54 +0000 (05:51 +0000)]
counter(9): fix igor/manlint warnings

- Reword description of `counter_enter` slightly to fix
  wordiness [1].
- Expand "isn't" as "is not" [1].
- Add missing section number with .Xr sysctl calls [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agoDB_COMMAND(9): fix mandoc markup
ngie [Thu, 23 Mar 2017 05:44:18 +0000 (05:44 +0000)]
DB_COMMAND(9): fix mandoc markup

Start new sentences on new lines.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobuf_ring(9): fix mandoc markup
ngie [Thu, 23 Mar 2017 05:41:56 +0000 (05:41 +0000)]
buf_ring(9): fix mandoc markup

Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agobus_alloc_resource(9): fix mandoc markup
ngie [Thu, 23 Mar 2017 05:38:57 +0000 (05:38 +0000)]
bus_alloc_resource(9): fix mandoc markup

Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoalq(9): fix mandoc markup
ngie [Thu, 23 Mar 2017 05:37:04 +0000 (05:37 +0000)]
alq(9): fix mandoc markup

Start new sentence on a new line.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agointro(3): fix markup
ngie [Thu, 23 Mar 2017 05:26:44 +0000 (05:26 +0000)]
intro(3): fix markup

- Use `Em` with `.It` macro when referring to other libraries, instead of
  `Xr`.
- Use `.Em` instead of `.Xr` when referring to libraries.
- Remove commented out lines.

MFC after: 1 month
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agotuning(7): fix SEE ALSO section sorting
ngie [Thu, 23 Mar 2017 05:15:35 +0000 (05:15 +0000)]
tuning(7): fix SEE ALSO section sorting

dummynet(4) should come before eventtimers(4)

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agotests(7): fix mdoc warning
ngie [Thu, 23 Mar 2017 05:12:07 +0000 (05:12 +0000)]
tests(7): fix mdoc warning

Continue sentence in "Configuring the tests" on a new line.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobuild(7): sort SEE ALSO section
ngie [Thu, 23 Mar 2017 05:06:40 +0000 (05:06 +0000)]
build(7): sort SEE ALSO section

tests(7) should be grouped in the man section 7 group, not the section 8 group.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Make ucode capabilities and api flags handling more like iwlwifi.
adrian [Thu, 23 Mar 2017 04:50:38 +0000 (04:50 +0000)]
[iwm] Make ucode capabilities and api flags handling more like iwlwifi.

Obtained from: dragonflybsd.git 757eecf0e6c92745aa2eee95811e573c8300850e

7 years ago[iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.
adrian [Thu, 23 Mar 2017 04:43:04 +0000 (04:43 +0000)]
[iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.

* All the supported firmwares have these flags set.

* This removes the following flags:
  IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT,
  IWM_UCODE_TLV_FLAGS_NEWBT_COEX,
  IWM_UCODE_TLV_FLAGS_BF_UPDATED,
  IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API,
  IWM_UCODE_TLV_FLAGS_STA_KEY_CMD,
  IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD,
  IWM_UCODE_TLV_FLAGS_SCHED_SCAN,
  IWM_UCODE_TLV_FLAGS_RX_ENERGY_API,
  IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2

* Also remove definitions and code for dealing with the v1 time-event api.

* Remove unneeded calc_rssi() function.

Obtained from: dragonflybsd.git d078c812418d0e2c3392e99fa25fc776d07bdfad

7 years agodiff(1): document remaining long options
ngie [Thu, 23 Mar 2017 04:35:52 +0000 (04:35 +0000)]
diff(1): document remaining long options

While here, try and tie together some of the short options with
their long option equivalents, where possible.

Sponsored by: Dell EMC Isilon

7 years ago[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().
adrian [Thu, 23 Mar 2017 04:34:25 +0000 (04:34 +0000)]
[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().

* This avoids leaving the mbuf in a weird state, when dropping a packet.

Obtained from: dragonflybsd.git 96eaecf93d9f731459a0df8efc72cfad034320bd

7 years ago[iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.
adrian [Thu, 23 Mar 2017 04:33:15 +0000 (04:33 +0000)]
[iwm]  Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.

Obtained from: dragonflybsd.git b5cdd8067951dc90271ab104ef555b3b5a4d5d5a

7 years agoRename tests from <foo> to <foo>_test to match the FreeBSD test suite
ngie [Thu, 23 Mar 2017 03:28:24 +0000 (03:28 +0000)]
Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd a post-humous manpage for cd9660(5), the ISO-9660 file system
ngie [Thu, 23 Mar 2017 02:57:08 +0000 (02:57 +0000)]
Add a post-humous manpage for cd9660(5), the ISO-9660 file system

Describe (briefly) how to compile the filesystem into the kernel and
load as a module.

Reference cd9660(5) in mount(8) and mount_cd9660(8).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agomount.conf(8): fix a .Xr call
ngie [Thu, 23 Mar 2017 02:50:35 +0000 (02:50 +0000)]
mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoImplement quote escaping. String values may now contain " if you
imp [Thu, 23 Mar 2017 02:36:51 +0000 (02:36 +0000)]
Implement quote escaping. String values may now contain " if you
it is preceded by \.

foo="I \"like\" C++"

gives the value 'I "like" C++' to the variable 'foo'. If a character
other than " follows the \, both the \ and that character are passed
through.

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

7 years agotmpfs(5): fix mdoc warnings
ngie [Thu, 23 Mar 2017 02:33:27 +0000 (02:33 +0000)]
tmpfs(5): fix mdoc warnings

- Delete trailing whitespace
- Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoFix a coverity-discovered NULL pointer dereference.
imp [Thu, 23 Mar 2017 02:30:57 +0000 (02:30 +0000)]
Fix a coverity-discovered NULL pointer dereference.

*** CID 1372598:  Null pointer dereferences  (FORWARD_NULL)
/lib/libefivar/efivar-dp-parse.c: 3612 in UefiDevicePathLibConvertTextToDeviceNode()
   Dereferencing null pointer "FromText".

When ported from Tiano core, I commented this out with an ifdef. That
was in error because we're supposed to fallback to a filepath when
nothing else patches. Instead, restore the original code, but fix
DevPathFromTextFilePath to cope with the conversion to narrow
strings. Also, fix the off-by-one error in the size of the memory it
allocates.

The off by one error is documented in Tiano core bug
https://bugzilla.tianocore.org/show_bug.cgi?id=441

CID: 1372598
Sponsored by: Netflix

7 years agoDefine StrCmp in a funky was to be bug-compatible with EDK2 code.
imp [Thu, 23 Mar 2017 02:30:52 +0000 (02:30 +0000)]
Define StrCmp in a funky was to be bug-compatible with EDK2 code.

Paper over a coverity issue:

*** CID 1372592:  API usage errors  (BAD_COMPARE)
/lib/libefivar/efivar-dp-parse.c: 2723 in DevPathFromTextiSCSI()
   Truncating the result of "strcmp" to "unsigned short" may cause it
   to be misinterpreted as 0. Note that "strcmp" may return an integer
   besides -1, 0, or 1.

We do this by making StrCmp return either 0 or 1 for equal or
not-equal.  There's a bug in the DevPathFromTextiSCSI cast of the
return value and this workaround will fix it without breaking other
users of StrCmp (all of which test for == 0).

https://bugzilla.tianocore.org/show_bug.cgi?id=440 has been filed
upstream to log this issue.

CID: 1372592
Sponsored by: Netflix

7 years agoRegenerate src.conf(5) (again)
ngie [Thu, 23 Mar 2017 02:29:59 +0000 (02:29 +0000)]
Regenerate src.conf(5) (again)

Sponsored by: Dell EMC Isilon

7 years agoRemove the .Pa portion I added to the .An macro in AUTHORS section
ngie [Thu, 23 Mar 2017 02:26:15 +0000 (02:26 +0000)]
Remove the .Pa portion I added to the .An macro in AUTHORS section

That doesn't work (mandoc complains about the macro being empty).

That's what I get for being clever and not verifying before committing
things again *sigh*.

MFC after: 1 month
X-MFC with: r315766
Partyhat to: ngie
Sponsored by: Dell EMC Isilon

7 years agoRegenerate src.conf(5)
ngie [Thu, 23 Mar 2017 02:21:59 +0000 (02:21 +0000)]
Regenerate src.conf(5)

Sponsored by: Dell EMC Isilon

7 years agoNote that tools/build/options/makeman automatically generated src.conf(5)
ngie [Thu, 23 Mar 2017 02:16:56 +0000 (02:16 +0000)]
Note that tools/build/options/makeman automatically generated src.conf(5)

This (as a bonus) fixes mdoc warnings with src.conf(5) :)..

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoFix mdoc(7) warning: new sentences should start on new lines
ngie [Thu, 23 Mar 2017 02:13:59 +0000 (02:13 +0000)]
Fix mdoc(7) warning: new sentences should start on new lines

MFC after: 1 week
X-MFC with: r315764
Sponsored by: Dell EMC Isilon

7 years agoAdd a WITHOUT_IPSEC_SUPPORT option description for src.conf(5)
ngie [Thu, 23 Mar 2017 02:01:25 +0000 (02:01 +0000)]
Add a WITHOUT_IPSEC_SUPPORT option description for src.conf(5)

This is a follow up commit to r313330.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd a WITHOUT_RATELIMIT option description for src.conf(5)
ngie [Thu, 23 Mar 2017 01:44:17 +0000 (01:44 +0000)]
Add a WITHOUT_RATELIMIT option description for src.conf(5)

This is a follow up commit for r312379

MFC after: 1 month
X-MFC with: r312379
Sponsored by: Dell EMC Isilon

7 years agorc.conf(5): fix a .Xr call for chroot(8)
ngie [Thu, 23 Mar 2017 01:16:26 +0000 (01:16 +0000)]
rc.conf(5): fix a .Xr call for chroot(8)

Add the missing section number to the .Xr call.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes
ngie [Thu, 23 Mar 2017 00:56:52 +0000 (00:56 +0000)]
Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes

MFC after: 1 week
Reviewed by: gjb
Sponsored by: Dell EMC Isilon

7 years agoCorrect the dependency of mmc(4) on sdhci_tegra(4) after r314887.
marius [Thu, 23 Mar 2017 00:41:33 +0000 (00:41 +0000)]
Correct the dependency of mmc(4) on sdhci_tegra(4) after r314887.

7 years agoAdd mlx5en(4) to the hardware page. [1]
gjb [Wed, 22 Mar 2017 23:47:15 +0000 (23:47 +0000)]
Add mlx5en(4) to the hardware page. [1]
Belatedly bump copyright years after several changes.

Reported by: rgrimes [1]
Sponsored by: The FreeBSD Foundation

7 years agoFix hardware list build after r315742.
gjb [Wed, 22 Mar 2017 22:29:14 +0000 (22:29 +0000)]
Fix hardware list build after r315742.

Sponsored by: The FreeBSD Foundation

7 years agoUpdate r315753 with the proper flag name.
kib [Wed, 22 Mar 2017 22:28:13 +0000 (22:28 +0000)]
Update r315753 with the proper flag name.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd a flag BI_BRAND_ONLY_STATIC to specify that the brand only
kib [Wed, 22 Mar 2017 22:23:01 +0000 (22:23 +0000)]
Add a flag BI_BRAND_ONLY_STATIC to specify that the brand only
matches static binaries.

Interpretation of the 'static' there is that the binary must not
specify an interpreter.  In particular, shared objects are matched by
the brand if BI_CAN_EXEC_DYN is also set.

This improves precision of the brand matching, which should eliminate
surprises due to brand ordering.

Revert r315701.

Discussed with and tested by: ed (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdjust r314851 to not require every brand to specify interpreter path.
kib [Wed, 22 Mar 2017 22:06:48 +0000 (22:06 +0000)]
Adjust r314851 to not require every brand to specify interpreter path.

Reported and tested by: ed
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse MIN macros from sys/param.h
bapt [Wed, 22 Mar 2017 21:59:04 +0000 (21:59 +0000)]
Use MIN macros from sys/param.h

7 years agoUse strndup(3) instead of malloc + memcpy
bapt [Wed, 22 Mar 2017 21:52:22 +0000 (21:52 +0000)]
Use strndup(3) instead of malloc + memcpy

7 years agoCherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:
dim [Wed, 22 Mar 2017 21:45:42 +0000 (21:45 +0000)]
Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:

Author: David Chisnall <theraven@FreeBSD.org>
Date:   Wed Mar 22 12:27:08 2017 +0000

    Simplify some code.

    realloc() with a null pointer is equivalent to malloc, so we don't need
    to handle the two cases independently.

    Fixes #46

This should help with lang/beignet and other programs, which expect
__cxa_demangle(name, NULL, NULL, &status) to return zero in status.

PR: 213732
MFC after: 3 days

7 years agoCommit Makefiles changes not build manpage for igb(4), accidentally
ngie [Wed, 22 Mar 2017 21:39:00 +0000 (21:39 +0000)]
Commit Makefiles changes not build manpage for igb(4), accidentally
forgotten in r315742.

X-MFC with: r311849, r315742
Pointyhat to: ngie
Sponsored by: Dell EMC Isilon

7 years agoUse MAX and MIN macros from sys/param.h
bapt [Wed, 22 Mar 2017 21:35:01 +0000 (21:35 +0000)]
Use MAX and MIN macros from sys/param.h

7 years agoMerge documentation for em(4) and igb(4)
ngie [Wed, 22 Mar 2017 21:32:44 +0000 (21:32 +0000)]
Merge documentation for em(4) and igb(4)

Document work done by mmacy/sbruno to merge the two drivers together
and convert em(4) to the iflib framework.

X-MFC with: r311849
Sponsored by: Dell EMC Isilon

7 years agopf: Fix possible shutdown race
kp [Wed, 22 Mar 2017 21:18:18 +0000 (21:18 +0000)]
pf: Fix possible shutdown race

Prevent possible races in the pf_unload() / pf_purge_thread() shutdown
code. Lock the pf_purge_thread() with the new pf_end_lock to prevent
these races.

Use a shared/exclusive lock, as we need to also acquire another sx lock
(VNET_LIST_RLOCK). It's fine for both pf_purge_thread() and pf_unload()
to sleep,

Pointed out by: eri, glebius, jhb
Differential Revision: https://reviews.freebsd.org/D10026

7 years agoSimplify the code a little.
imp [Wed, 22 Mar 2017 20:51:52 +0000 (20:51 +0000)]
Simplify the code a little.

Submitted by: rppokala
Sponsored by: Netflix

7 years agoGarbage collect if_igb reference in loader.conf
ngie [Wed, 22 Mar 2017 20:06:29 +0000 (20:06 +0000)]
Garbage collect if_igb reference in loader.conf

if_igb was merged with if_em in r311849

X-MFC with: r311849
Sponsored by: Dell EMC Isilon

7 years agoDocument some more 10GbE+ network drivers in loader.conf
ngie [Wed, 22 Mar 2017 19:48:09 +0000 (19:48 +0000)]
Document some more 10GbE+ network drivers in loader.conf

- if_cxgbe
- if_ixl
- if_ixlv
- sfxge

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUnbreak world by adding sys/stat.h for stat(2)
ngie [Wed, 22 Mar 2017 19:23:13 +0000 (19:23 +0000)]
Unbreak world by adding sys/stat.h for stat(2)

X-MFC with: r315733
Reported by: O. Hartmann <ohartmann@walstatt.org>
Sponsored by: Dell EMC Isilon

7 years agoMake file descriptor passing for CloudABI's recvmsg() work.
ed [Wed, 22 Mar 2017 19:20:39 +0000 (19:20 +0000)]
Make file descriptor passing for CloudABI's recvmsg() work.

Similar to the change for sendmsg(), create a pointer size independent
implementation of recvmsg() and let cloudabi32 and cloudabi64 call into
it. In case userspace requests one or more file descriptors, call
kern_recvit() in such a way that we get the control message headers in
an mbuf. Iterate over all of the headers and copy the file descriptors
to userspace.

7 years agoImplement moving SD.
imp [Wed, 22 Mar 2017 19:18:47 +0000 (19:18 +0000)]
Implement moving SD.

From the paper "Incremental calculation of weighted mean and variance"
by Tony Finch Februrary 2009, retrieved from
http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf
converted to use shifting.

7 years agostyle(9): sort #includes
ngie [Wed, 22 Mar 2017 19:17:13 +0000 (19:17 +0000)]
style(9): sort #includes

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoImpelemnt ttys onifexists in init.
imp [Wed, 22 Mar 2017 19:00:41 +0000 (19:00 +0000)]
Impelemnt ttys onifexists in init.

Implement a new init(8) option in /etc/ttys. If this option is present
on the entry in /etc/ttys, the entry will be active if and only if it
exists.  If the name starts with a '/', it will be considered an
absolute path. If not, it will be a path relative to /dev.

This allows one to turn off video console getty that aren't present
(while running a getty on them even when they aren't the system
console). Likewise with serial ports.

It differs from onifconsole in only requiring the device exist rather
than it be listed as one of the system consoles.

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

7 years agoAdd forward declaration for struct vnode.
ed [Wed, 22 Mar 2017 18:45:13 +0000 (18:45 +0000)]
Add forward declaration for struct vnode.

The coredump() function provided by this header file has struct vnode *
as an argument.

MFC after: 1 week

7 years agoAdd initializations missed in r315728.
markj [Wed, 22 Mar 2017 18:33:29 +0000 (18:33 +0000)]
Add initializations missed in r315728.

X-MFC With: r315728

7 years agoAvoid accessing an uninitialized variable when vfork() fails.
markj [Wed, 22 Mar 2017 18:31:44 +0000 (18:31 +0000)]
Avoid accessing an uninitialized variable when vfork() fails.

Reported by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAvoid double-closing an fd if elf_begin() fails.
markj [Wed, 22 Mar 2017 18:14:55 +0000 (18:14 +0000)]
Avoid double-closing an fd if elf_begin() fails.

Reported by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agodiff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-case
ngie [Wed, 22 Mar 2017 18:13:14 +0000 (18:13 +0000)]
diff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-case

`--no-ignore-case` should be `--no-ignore-file-name-case` per code for
compatibility with [g]diff(1).

Sponsored by: Dell EMC Isilon

7 years agoscandir: Fix NULL dereference, uninitialized value use in error case
cem [Wed, 22 Mar 2017 17:37:47 +0000 (17:37 +0000)]
scandir: Fix NULL dereference, uninitialized value use in error case

If opendir succeeds but malloc fails, numitems was used uninitialized in
error handling under the 'fail' label.  If it happened to have a non-zero
value, the NULL 'names' was dereferenced.

Reported by: Coverity
CIDs: 13295661372625
Sponsored by: Dell EMC Isilon

7 years agoExtend cmpxchg() to support 8- and 16-bit values, and add xchg().
markj [Wed, 22 Mar 2017 17:33:57 +0000 (17:33 +0000)]
Extend cmpxchg() to support 8- and 16-bit values, and add xchg().

These are needed to support updated revisions of the DRM code.

Reviewed by: hselasky (previous version)
MFC after: 2 weeks

7 years agoAdd support for 8- and 16-bit atomic_(f)cmpset to x86.
markj [Wed, 22 Mar 2017 17:29:04 +0000 (17:29 +0000)]
Add support for 8- and 16-bit atomic_(f)cmpset to x86.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10068

7 years agoctm: fix memory leaks in Pass1(..)
ngie [Wed, 22 Mar 2017 17:28:53 +0000 (17:28 +0000)]
ctm: fix memory leaks in Pass1(..)

Call `Delete(..)` (a free(3) wrapper) on `name` when bailing from the
function.

Submitted by: Tom Rix <trix@juniper.net>
Reviewed by: ngie
Differential Revision: D10097
Sponsored by: Dell EMC Isilon, Juniper

7 years agoBring the handling of the y axis in the ums driver in-line with the other
grehan [Wed, 22 Mar 2017 17:06:57 +0000 (17:06 +0000)]
Bring the handling of the y axis in the ums driver in-line with the other
axes.

No functional change.

Submitted by: Vicki Pfau (vi AT endrift.com)
Approved by: hps
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9595

7 years agoThis fixes a typo in bhyve's USB mouse emulation.
grehan [Wed, 22 Mar 2017 16:53:03 +0000 (16:53 +0000)]
This fixes a typo in bhyve's USB mouse emulation.
There is no behavioral difference, as it's just swapping
out the name of two identically-valued constants.

Submitted by: Vicki Pfau (vi AT endrift.com)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9597

7 years agoAdd full VNET support to the inet_get_local_port_range() function in
hselasky [Wed, 22 Mar 2017 15:46:31 +0000 (15:46 +0000)]
Add full VNET support to the inet_get_local_port_range() function in
the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd support for more IPv4 and IPv6 related macros in the LinuxKPI.
hselasky [Wed, 22 Mar 2017 15:44:00 +0000 (15:44 +0000)]
Add support for more IPv4 and IPv6 related macros in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd the early hypervisor code needed on 32-bit ARMv7. This will be used
andrew [Wed, 22 Mar 2017 14:30:02 +0000 (14:30 +0000)]
Add the early hypervisor code needed on 32-bit ARMv7. This will be used
when we bring in bhyve support.

Submitted by: Mihai Carabas <mihai.carabas AT gmail.com>
Differential Revision: https://reviews.freebsd.org/D10045

7 years agoFix printing bits above first eight.
mav [Wed, 22 Mar 2017 13:53:21 +0000 (13:53 +0000)]
Fix printing bits above first eight.

Reported by: Coverity
CID: 1372596
MFC after: 1 week

7 years agoAdd options to capture stdout and / or stderr and pass the output on
des [Wed, 22 Mar 2017 13:16:04 +0000 (13:16 +0000)]
Add options to capture stdout and / or stderr and pass the output on
to the user.  There is currently no buffering, so the result may be
somewhat unpredictable if the conversation function adds a newline,
like openpam_ttyconv() does.

Clean up and simplify the environment handling code, which triggered
an inexplicable bug on some systems.

MFC after: 2 weeks

7 years agoSwitch from using periph_links to sim_links.
mav [Wed, 22 Mar 2017 11:06:33 +0000 (11:06 +0000)]
Switch from using periph_links to sim_links.

periph_links field belongs to periph drivers and must not be used here.

MFC after: 2 weeks

7 years agoCleanup response queue processing.
mav [Wed, 22 Mar 2017 08:56:03 +0000 (08:56 +0000)]
Cleanup response queue processing.

MFC after: 2 weeks

7 years agoSet the interpreter path to /nonexistent.
ed [Wed, 22 Mar 2017 07:05:27 +0000 (07:05 +0000)]
Set the interpreter path to /nonexistent.

CloudABI executables are statically linked and don't have an
interpreter. Setting the interpreter path to NULL used to work
previously, but r314851 introduced code that checks the string
unconditionally. Running CloudABI executables now causes a null pointer
dereference.

Looking at the rest of imgact_elf.c, it seems various other codepaths
already leaned on the fact that the interpreter path is set. Let's just
go ahead and pick an obviously incorrect interpreter path to appease
imgact_elf.c.

MFC after: 1 week

7 years agoMake file descriptor passing work for CloudABI's sendmsg().
ed [Wed, 22 Mar 2017 06:43:10 +0000 (06:43 +0000)]
Make file descriptor passing work for CloudABI's sendmsg().

Reduce the potential amount of code duplication between cloudabi32 and
cloudabi64 by creating a cloudabi_sock_recv() utility function. The
cloudabi32 and cloudabi64 modules will then only contain code to convert
the iovecs to the native pointer size.

In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in
an mbuf and pass that on to kern_sendit().

7 years agoPrint out name of non-dynamic sysctl in sysctl_remove_oid_locked
ngie [Wed, 22 Mar 2017 05:27:20 +0000 (05:27 +0000)]
Print out name of non-dynamic sysctl in sysctl_remove_oid_locked

This will provide a slightly better smoking gun than just stating
"can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9)
and sysctl_remove_{name,oid}(9) with a non-dynamic (likely
static) sysctl.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agolibkvm: bump WARNS to 6 after recent commits done to resolve warnings issues
ngie [Wed, 22 Mar 2017 02:44:39 +0000 (02:44 +0000)]
libkvm: bump WARNS to 6 after recent commits done to resolve warnings issues

MFC after: 1 month
Tested with: make tinderbox; clang 4.0.0 (amd64), gcc 4.2.1/6.3.0 (amd64)
Sponsored by: Dell EMC Isilon

7 years agolibkvm: fix warning issues post-r291406
ngie [Wed, 22 Mar 2017 02:42:00 +0000 (02:42 +0000)]
libkvm: fix warning issues post-r291406

- Fix -Wunused warnings with *_native detection handlers by marking `kd`
  __unused, except with arm/mips, where a slightly more complicated scheme
  is required to handle the native case vs the non-native case.
- Fix -Wmissing-variable-declarations warnings by marking struct kvm_arch
  objects static.

Differential Revision: D10071
MFC after: 1 week
Reviewed by: vangyzen
Tested with: WIP test code (D10024) // kgdb7121 (i386 crash/kernel on amd64)
Sponsored by: Dell EMC Isilon

7 years agoclock_gettime.2: add some clock IDs
vangyzen [Wed, 22 Mar 2017 00:50:36 +0000 (00:50 +0000)]
clock_gettime.2: add some clock IDs

Add the CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clock_id
values to the clock_gettime(2) man page.  Reformat the excessively
long paragraph (sentence!) into a tag list.

Reported by: jilles in https://reviews.freebsd.org/D10020
MFC after: 3 days
Sponsored by: Dell EMC

7 years agokern_fail: Allow sleeping for more than 2147483/hz seconds
cem [Tue, 21 Mar 2017 22:41:37 +0000 (22:41 +0000)]
kern_fail: Allow sleeping for more than 2147483/hz seconds

Because of integer types, the timeout calculation result was limited to
INT_MAX / (1000 * hz) seconds.  For systems with hz=10000, this is only 215
seconds.  Perform the calculation with 64-bit math to allow sleeping for the
full INT_MAX / hz interval (215000 seconds on such hz=10000 systems).

Submitted by: Scott Ferris <sferris at isilon.com>
Sponsored by: Dell EMC Isilon

7 years agoEliminate a "format string is not a string literal" warning.
ian [Tue, 21 Mar 2017 22:21:29 +0000 (22:21 +0000)]
Eliminate a "format string is not a string literal" warning.

7 years agoRename _cc to _gcc to be more clear.
bdrewery [Tue, 21 Mar 2017 22:09:00 +0000 (22:09 +0000)]
Rename _cc to _gcc to be more clear.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoDelete trailing whitespace (no functional change)
ngie [Tue, 21 Mar 2017 22:00:52 +0000 (22:00 +0000)]
Delete trailing whitespace (no functional change)

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoGcc has incompatible internal declarations for __divtc3 and __multc3 as
dim [Tue, 21 Mar 2017 21:07:37 +0000 (21:07 +0000)]
Gcc has incompatible internal declarations for __divtc3 and __multc3 as
defined in compiler-rt, but it has no option to silence its warning, so
make gcc warnings for libcompiler_rt non-fatal.

Noticed by: lwhsu
MFC after: 3 days

7 years agokvm_write: fix -Wcast-qual warning in pointer arithmetic argument
ngie [Tue, 21 Mar 2017 20:48:36 +0000 (20:48 +0000)]
kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

Differential Revision: D10082
MFC after: 1 week
Reviewed by: cem (earlier diff), vangyzen
Submitted by: cem [1]
Sponsored by: Dell EMC Isilon

7 years agoDocument sbuf_hexdump(9) in just sbuf(9)
ngie [Tue, 21 Mar 2017 19:10:07 +0000 (19:10 +0000)]
Document sbuf_hexdump(9) in just sbuf(9)

- Remove duplicate references to sbuf_hexdump(9) from hexdump(3).
  sbuf_hexdump(9) already pointed back to hexdump(3) for implementation
  details.
- Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness

MFC after: 1 week
Reviewed by: vangyzen (earlier diff)
Sponsored by: Dell EMC Isilon
Differential Revision: D9912

7 years agokvm_geterr: handle `kd` == NULL in a deterministic/graceful manner
ngie [Tue, 21 Mar 2017 19:02:17 +0000 (19:02 +0000)]
kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

Differential Revision: D10022
MFC after: 1 week
Reviewed by: vangyzen
Sponsored by: Dell EMC Isilon

7 years agotighten buffer bounds in imgact_binmisc_populate_interp
emaste [Tue, 21 Mar 2017 18:02:14 +0000 (18:02 +0000)]
tighten buffer bounds in imgact_binmisc_populate_interp

We must ensure there's space for the terminating null in the temporary
buffer in imgact_binmisc_populate_interp().

Note that there's no buffer overflow here because xbe->xbe_interpreter's
length and null termination is checked in imgact_binmisc_add_entry()
before imgact_binmisc_populate_interp() is called. However, the latter
should correctly enforce its own bounds.

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

7 years agoForce same alignment on struct xinpgen as we have on struct xinpcb. This
glebius [Tue, 21 Mar 2017 16:23:44 +0000 (16:23 +0000)]
Force same alignment on struct xinpgen as we have on struct xinpcb.  This
fixes 32-bit builds.

7 years agoRemove another remnants left after r246713.
mav [Tue, 21 Mar 2017 14:14:11 +0000 (14:14 +0000)]
Remove another remnants left after r246713.

MFC after: 2 weeks

7 years agoRemove some dead code left after r246713.
mav [Tue, 21 Mar 2017 13:49:43 +0000 (13:49 +0000)]
Remove some dead code left after r246713.

MFC after: 2 weeks

7 years agoImprove command timeout handling.
mav [Tue, 21 Mar 2017 13:10:37 +0000 (13:10 +0000)]
Improve command timeout handling.

Let firmware do its best first, and if it can't, try software recovery.
I would remove software timeout handler completely, but found bunch of
complains on command timeout on sparc64 mailing list few years ago, so
better be safe in case of interrupt loss.

MFC after: 2 weeks

7 years agoThe .Cm macro usage fixed.
maxim [Tue, 21 Mar 2017 13:01:08 +0000 (13:01 +0000)]
The .Cm macro usage fixed.

PR: 217977
Submitted by: tobik

7 years agoRemove questionable reqp->req_time access.
mav [Tue, 21 Mar 2017 11:26:31 +0000 (11:26 +0000)]
Remove questionable reqp->req_time access.

MFC after: 2 weeks

7 years agoClean/unify some macro usage.
mav [Tue, 21 Mar 2017 10:34:34 +0000 (10:34 +0000)]
Clean/unify some macro usage.

MFC after: 2 weeks

7 years agoMinor cosmetic addition to r315673.
mav [Tue, 21 Mar 2017 09:24:07 +0000 (09:24 +0000)]
Minor cosmetic addition to r315673.

Now CAM_SIM_LOCK() macros are not used and may be removed later.

MFC after: 2 weeks