]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd __cxa_thread_atexit(3) API implementation.
kib [Sat, 6 Aug 2016 13:32:40 +0000 (13:32 +0000)]
Add __cxa_thread_atexit(3) API implementation.

This is the backing feature to implement C++11 thread storage duration
specified by the thread_local keyword.  A destructor for given
thread-local object is registered to be executed at the thread
termination time using __cxa_thread_atexit().  Libc calls the
__cxa_thread_calls_dtors() during exit(3), before finalizers and
atexit functions, and libthr calls the function at the thread
termination time, after the stack unwinding and thread-specific key
destruction.

There are several uncertainties in the API which lacks a formal
specification.  Among them:
- is it allowed to register destructors during destructing;
we allow, but limiting the nesting level.  If too many iterations
detected, a diagnostic is issued to stderr and thread forcibly
terminates for now.
- how to handle destructors which belong to an unloading dso;
for now, we ignore destructor calls for such entries, and
issue a diagnostic.  Linux does prevent dso unload until all
threads with destructors from the dso terminated.
It is supposed that the diagnostics allow to detect real-world
applications relying on the above details and possibly adjust
our implementation.  Right now the choices were to provide the slim
API (but that rarely stands the practice test).

Tests are added to check generic functionality and to specify some of
the above implementation choices.

Submitted by: Mahdi Mokhtari <mokhi64_gmail.com>
Reviewed by: theraven
Discussed with: dim (detection of -std=c++11 supoort for tests)
Sponsored by: The FreeBSD Foundation (my involvement)
MFC after: 2 weeks
Differential revisions: https://reviews.freebsd.org/D7224,
    https://reviews.freebsd.org/D7427

7 years agoCreate namespace for the symbols added during 12-CURRENT cycle.
kib [Sat, 6 Aug 2016 13:28:58 +0000 (13:28 +0000)]
Create namespace for the symbols added during 12-CURRENT cycle.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoMark an unused parameter as such.
tuexen [Sat, 6 Aug 2016 12:51:07 +0000 (12:51 +0000)]
Mark an unused parameter as such.

MFC after: 3 days

7 years agoFix various bugs in relation to the I-DATA chunk support
tuexen [Sat, 6 Aug 2016 12:33:15 +0000 (12:33 +0000)]
Fix various bugs in relation to the I-DATA chunk support

This is joint work with rrs.

MFC after: 3 days

7 years agofix .zfs-related cases in zfs_lookup that were broken by r303763
avg [Sat, 6 Aug 2016 11:02:07 +0000 (11:02 +0000)]
fix .zfs-related cases in zfs_lookup that were broken by r303763

The problem is that the special .zfs nodes are not represented by
znodes but by special gfs-based nodes.
r303763 changed interface of zfs_dirlook such that started operating on
znodes rather than on vnodes and, thus, the function became unsuitable
for handling .zfs entities.
The solution is to move the handling of the special cases to zfs_lookup,
the only consumer of zfs_dirlook.
I already had this solution applied in D7421, but for different reasons.

Reported by: asomers
MFC after: 3 days
X-MFC with: r303763

7 years agoFix some logic in PCIe HotPlug; display EI status
vangyzen [Fri, 5 Aug 2016 23:23:48 +0000 (23:23 +0000)]
Fix some logic in PCIe HotPlug; display EI status

The interpretation of the Electromechanical Interlock Status was
inverted, so we disengaged the EI if a card was inserted.
Fix it to engage the EI if a card is inserted.

When displaying the slot capabilites/status with pciconf:

- We inverted the sense of the Power Controller Control bit,
  saying the power was off when it was really on (according to
  this bit).  Fix that.

- Display the status of the Electromechanical Interlock:
        EI(engaged)
        EI(disengaged)

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D7426

7 years agomthca: Add a wrapper for the firmware's DIAG_RPRT command.
markj [Fri, 5 Aug 2016 21:34:09 +0000 (21:34 +0000)]
mthca: Add a wrapper for the firmware's DIAG_RPRT command.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoalways install etcupdate
bapt [Fri, 5 Aug 2016 19:24:52 +0000 (19:24 +0000)]
always install etcupdate

Now that etcupdate does not depend on rcs anymore there is no need to
conditionnally install it

7 years agoetcupdate: directly use diff3(1) instead of merge(1)
bapt [Fri, 5 Aug 2016 19:22:33 +0000 (19:22 +0000)]
etcupdate: directly use diff3(1) instead of merge(1)

During the last attempt to rmeove GNU rcs, 2 blockers were spotted:
We need an ident(1) and etcupdate(8) uses merge(1).

Now nothing should prevent to remove rcs from base

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

7 years agosdiff: remove non finish/function code
bapt [Fri, 5 Aug 2016 19:14:55 +0000 (19:14 +0000)]
sdiff: remove non finish/function code

2 extra options not available neither on other BSD nor in GNU sdiff:
--diff-pid and --pipe-fd were present in the SoC code, none were usable

Just remove it

7 years agoFix GCE image publication. The gcutil utility is deprecated in favor
gjb [Fri, 5 Aug 2016 19:00:45 +0000 (19:00 +0000)]
Fix GCE image publication.  The gcutil utility is deprecated in favor
of gcloud.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years ago[ar934x] add tap/tun as modules, for people who wish to use VPNs.
adrian [Fri, 5 Aug 2016 17:17:36 +0000 (17:17 +0000)]
[ar934x] add tap/tun as modules, for people who wish to use VPNs.

7 years ago[arge] add some extra MDIO debugging support
adrian [Fri, 5 Aug 2016 17:16:35 +0000 (17:16 +0000)]
[arge] add some extra MDIO debugging support

* add an ANY debug level which will always echo the message if debugging
  is compiled in;
* log MDIO transaction timeouts if debugging is compiled in;
* the argemdio device is different to arge, so turning on MDIO debugging
  flags in arge->sc_debug doesn't help.  Add a debug sysctl to argemdio
  as well so that MDIO transactions can be debugged.

Tested:

* AR9331

7 years agoCorrect a spelling error.
alc [Fri, 5 Aug 2016 16:44:11 +0000 (16:44 +0000)]
Correct a spelling error.

7 years agoxen-netfront: improve the logic when handling nic features from ioctl
royger [Fri, 5 Aug 2016 15:48:56 +0000 (15:48 +0000)]
xen-netfront: improve the logic when handling nic features from ioctl

Simplify the logic involved in changing the nic features on the fly, and
only reset the frontend when really needed (when changing RX features). Also
don't return from the ioctl until the interface has been properly
reconfigured.

While there, make sure XN_CSUM_FEATURES is used consistently.

Reported by: julian
MFC after: 5 days
X-MFC-with: r303488
Sponsored by: Citrix Systems R&D

7 years agoRemove lockmgr_waiters(9) and BUF_LOCKWAITERS(9); they were not used
trasz [Fri, 5 Aug 2016 13:53:28 +0000 (13:53 +0000)]
Remove lockmgr_waiters(9) and BUF_LOCKWAITERS(9); they were not used
for anything.

Reviewed by: kib@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7420

7 years agotcp/lro: If timestamps mismatch or it's a FIN, force flush.
sephe [Fri, 5 Aug 2016 09:08:00 +0000 (09:08 +0000)]
tcp/lro: If timestamps mismatch or it's a FIN, force flush.

This keeps the segments/ACK/FIN delivery order.

Before this patch, it was observed: if A sent FIN immediately after
an ACK, B would deliver FIN first to the TCP stack, then the ACK.
This out-of-order delivery causes one unnecessary ACK sent from B.

Reviewed by: gallatin, hps
Obtained from:  rrs, gallatin
Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe)
Differential Revision: https://reviews.freebsd.org/D7415

7 years agoKeep a reference count on USB keyboard polling to allow recursive
hselasky [Fri, 5 Aug 2016 08:58:00 +0000 (08:58 +0000)]
Keep a reference count on USB keyboard polling to allow recursive
cngrab() during a panic for example, similar to what the AT-keyboard
driver is doing.

Found by: Bruce Evans <brde@optusnet.com.au>
MFC after: 1 week

7 years agohyperv/vmbus: Only make sure the TX bufring will not be closed.
sephe [Fri, 5 Aug 2016 08:57:51 +0000 (08:57 +0000)]
hyperv/vmbus: Only make sure the TX bufring will not be closed.

KVP can write data, whose size is > 1/2 TX bufring size.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7414

7 years agozfs: honour and make use of vfs vnode locking protocol
avg [Fri, 5 Aug 2016 06:23:06 +0000 (06:23 +0000)]
zfs: honour and make use of vfs vnode locking protocol

ZFS POSIX Layer is originally written for Solaris VFS which is very
different from FreeBSD VFS.  Most importantly many things that FreeBSD VFS
manages on behalf of all filesystems are implemented in ZPL in a different
way.
Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS
functionality or, in the worst cases, badly interacts / interferes
with VFS.

The most prominent problem is a deadlock caused by the lock order reversal
of vnode locks that may happen with concurrent zfs_rename() and lookup().
The deadlock is a result of zfs_rename() not observing the vnode locking
contract expected by VFS.

This commit removes all ZPL internal locking that protects parent-child
relationships of filesystem nodes.  These relationships are protected
by vnode locks and the code is changed to take advantage of that fact
and to properly interact with VFS.

Removal of the internal locking allowed all ZPL dmu_tx_assign calls to
use TXG_WAIT mode.

Another victim, disputable perhaps, is ZFS support for filesystems with
mixed case sensitivity.  That support is not provided by the OS anyway,
so in ZFS it was a buch of dead code.

To do:
- replace ZFS_ENTER mechanism with VFS managed / visible mechanism
- replace zfs_zget with zfs_vget[f] as much as possible
- get rid of not really useful now zfs_freebsd_* adapters
- more cleanups of unneeded / unused code
- fix / replace .zfs support

PR: 209158
Reported by: many
Tested by: many (thank you all!)
MFC after: 5 days
Sponsored by: HybridCluster / ClusterHQ
Differential Revision: https://reviews.freebsd.org/D6533

7 years agoioat(4): Log channel number in CTR events
cem [Fri, 5 Aug 2016 02:56:31 +0000 (02:56 +0000)]
ioat(4): Log channel number in CTR events

7 years agoFix a regression in pf.conf while parsing the 'interval' keyword.
loos [Fri, 5 Aug 2016 02:19:03 +0000 (02:19 +0000)]
Fix a regression in pf.conf while parsing the 'interval' keyword.

The bug was introduced by r287009.

PR: 210924
Submitted by: kp@
Sponsored by: Rubicon Communications (Netgate)
Pointy hat to: loos

7 years agopfctl: Make most global variables static.
kp [Thu, 4 Aug 2016 19:24:44 +0000 (19:24 +0000)]
pfctl: Make most global variables static.

This will make it easier to link as a library.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agopfctl: Add missing __FBSDID to pfctl_osfp.c
kp [Thu, 4 Aug 2016 19:24:05 +0000 (19:24 +0000)]
pfctl: Add missing __FBSDID to pfctl_osfp.c

7 years agoRegenerate after r303755.
bdrewery [Thu, 4 Aug 2016 19:15:51 +0000 (19:15 +0000)]
Regenerate after r303755.

MFC after: 3 days
X-MFC-With: r303755
Sponsored by: EMC / Isilon Storage Division

7 years agoStill provide freebsd10_* symbols from libc for COMPAT10.
bdrewery [Thu, 4 Aug 2016 19:14:18 +0000 (19:14 +0000)]
Still provide freebsd10_* symbols from libc for COMPAT10.

r296773 was done to only remove libc symbols for <7.  We want to provide
the syscall symbols going forward for 7+.

Discussed with: jhb
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd __printflike() to bus_describe_intr() to enable -Wformat checks.
jhb [Thu, 4 Aug 2016 18:29:16 +0000 (18:29 +0000)]
Add __printflike() to bus_describe_intr() to enable -Wformat checks.

Fix a few places that were passing a raw string as the format to use
a "%s" format string instead.

MFC after: 2 months

7 years agoDon't permit mappings of invalid physical addresses on amd64 via /dev/mem.
jhb [Thu, 4 Aug 2016 17:55:23 +0000 (17:55 +0000)]
Don't permit mappings of invalid physical addresses on amd64 via /dev/mem.

Discussed with: kib

7 years ago[etherswitch] add LED API to the documentation and command line tool.
adrian [Thu, 4 Aug 2016 17:46:07 +0000 (17:46 +0000)]
[etherswitch] add LED API to the documentation and command line tool.

Submitted by: Dan Nelson <dnelson_1901@yahoo.com>

7 years ago[etherswitch] add in an initial API for controlling per-port LED behaviour.
adrian [Thu, 4 Aug 2016 17:45:35 +0000 (17:45 +0000)]
[etherswitch] add in an initial API for controlling per-port LED behaviour.

This is just implemented for the AR8327 for now.

Submitted by: Dan Nelson <dnelson_1901@yahoo.com>

7 years agocxgbe/t4_tom: The page pod arena allocates from pod address space and
np [Thu, 4 Aug 2016 17:29:42 +0000 (17:29 +0000)]
cxgbe/t4_tom: The page pod arena allocates from pod address space and
not index space.  The minimum valid allocation out of this arena is the
size of a single page pod.

Sponsored by: Chelsio Communications

7 years agoClean up the comments and code style in and around vm_pageout_cluster().
alc [Thu, 4 Aug 2016 16:20:12 +0000 (16:20 +0000)]
Clean up the comments and code style in and around vm_pageout_cluster().
In particular, fix factual, grammatical, and spelling errors in various
comments, and remove comments that are out of place in this function.

Reviewed by: kib, markj
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7410

7 years agoindent(1): Use bsearch() for looking up type keywords.
pfg [Thu, 4 Aug 2016 15:27:09 +0000 (15:27 +0000)]
indent(1): Use bsearch() for looking up type keywords.

Reference:
https://github.com/pstef/freebsd_indent/commit/f3b8e6e57fd47364b2360b44011a2fad5d11adc7

Submitted by: Piotr Stefaniak
Differential Revision: https://reviews.freebsd.org/D6966

7 years agoRemove the pvh_global_lock lock from the arm64 pmap. It is unneeded on arm64
andrew [Thu, 4 Aug 2016 13:49:36 +0000 (13:49 +0000)]
Remove the pvh_global_lock lock from the arm64 pmap. It is unneeded on arm64
as invalidation will have completed before the pmap_invalidate_* functions
have complete.

Discussed with: alc, kib
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoRemove unused - never actually implemented - vnode lock types
trasz [Thu, 4 Aug 2016 13:45:18 +0000 (13:45 +0000)]
Remove unused - never actually implemented - vnode lock types
from vnode_if.src.

MFC after: 1 month

7 years agoGrammar fixes.
pluknet [Thu, 4 Aug 2016 11:38:53 +0000 (11:38 +0000)]
Grammar fixes.

7 years agomdoc: The .Fn function.
pluknet [Thu, 4 Aug 2016 11:22:51 +0000 (11:22 +0000)]
mdoc: The .Fn function.

7 years agoDragonFly 4.6.0 release added.
maxim [Thu, 4 Aug 2016 10:49:00 +0000 (10:49 +0000)]
DragonFly 4.6.0 release added.

7 years agoreport sector size and number of sectors in lsdev output for bios disks
avg [Thu, 4 Aug 2016 06:40:51 +0000 (06:40 +0000)]
report sector size and number of sectors in lsdev output for bios disks

MFC after: 3 weeks

7 years agohyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP support
sephe [Thu, 4 Aug 2016 05:05:35 +0000 (05:05 +0000)]
hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP support

The Hyper-V on pre-win10 systems will only report SPC-2 conformance,
but it actually conforms to SPC-3.  The INQUIRY response is adjusted
to propagate the SPC-3 version information to CAM.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7405

7 years agoAdd in tap/tun for openvpn-on-mips experiments.
adrian [Thu, 4 Aug 2016 01:49:18 +0000 (01:49 +0000)]
Add in tap/tun for openvpn-on-mips experiments.

(FWIW, it does work.)

7 years agoindent(1): add new -sac and -U options.
pfg [Wed, 3 Aug 2016 22:08:07 +0000 (22:08 +0000)]
indent(1): add new -sac and -U options.

Add -sac (space after cast) and -nsac options.
These control whether space character is put after a cast operator or not.
Default is -nsac.

Add -U option for providing a file containing list of types.
This is needed for properly deciding which asterisks denote unary
operation and which denote binary.

These come from PostgreSQL.

Reference:
https://github.com/pstef/freebsd_indent/commit/84b00e3d46dfd6d955b2f481a1f3b275de9ad6d1
https://github.com/pstef/freebsd_indent/commit/49c52cf383fa2a246a1a22c6640a5a21b0f1fd90

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoFix a style(9) bug.
jkim [Wed, 3 Aug 2016 20:21:58 +0000 (20:21 +0000)]
Fix a style(9) bug.

7 years agoSupport nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).
jkim [Wed, 3 Aug 2016 20:08:39 +0000 (20:08 +0000)]
Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).

7 years ago[ar934x] shuffle AR93XX_BASE -> std.AR934X
adrian [Wed, 3 Aug 2016 19:23:22 +0000 (19:23 +0000)]
[ar934x] shuffle AR93XX_BASE -> std.AR934X

7 years ago[ar9330] ok, fine, I'll finally undo the 2011-era mistake of _BASE config files.
adrian [Wed, 3 Aug 2016 19:18:53 +0000 (19:18 +0000)]
[ar9330] ok, fine, I'll finally undo the 2011-era mistake of _BASE config files.

Repeated prodding by: imp

7 years ago[ar9330] add in module support for ipfw nat.
adrian [Wed, 3 Aug 2016 19:13:09 +0000 (19:13 +0000)]
[ar9330] add in module support for ipfw nat.

This actually does work, and works pretty well.

7 years agoCorrect some comments.
bdrewery [Wed, 3 Aug 2016 18:48:56 +0000 (18:48 +0000)]
Correct some comments.

Sponsored by: EMC / Isilon Storage Division
MFC after: 3 days

7 years agoWe need aw_nmi to be attached which needs GIC so attach a bit later.
manu [Wed, 3 Aug 2016 18:45:56 +0000 (18:45 +0000)]
We need aw_nmi to be attached which needs GIC so attach a bit later.
Also the GPIOC doesn't need to be attach early

Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7082

7 years agouuid_to_string(3) is allocating memory and can fail on that.
oshogbo [Wed, 3 Aug 2016 18:04:08 +0000 (18:04 +0000)]
uuid_to_string(3) is allocating memory and can fail on that.
Check if any error accrued.

7 years agoFix EHCI driver by excluding first 512K from available memory
gonzo [Wed, 3 Aug 2016 18:03:14 +0000 (18:03 +0000)]
Fix EHCI driver by excluding first 512K from available memory

On Zynq 256K-512K memory region is not accessible by all bus masters.
EHCI driver fails when trying to use it for DMA transfers. Patching
memory node does not help because ubldr overrides values there with
the ones obtained from u-boot. So as a workaround we just mark first
512K as reserved.

PR: 211484
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>
MFC after: 3 days

7 years agoFix misleading description of the -b option in the geli init command.
oshogbo [Wed, 3 Aug 2016 18:02:10 +0000 (18:02 +0000)]
Fix misleading description of the -b option in the geli init command.

Reviewed by: bjk, wblock
Differential Revision: https://reviews.freebsd.org/D7226
Discussed with: AllanJude

7 years agoFix a few cosmetic issues in boot1.efi.
markj [Wed, 3 Aug 2016 17:17:01 +0000 (17:17 +0000)]
Fix a few cosmetic issues in boot1.efi.

- Use ANSI function signatures.
- Remove unneeded checks for a NULL boot module.
- Use nitems().

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoUse the port device name for the iov device for Chelsio T4/T5 cards.
jhb [Wed, 3 Aug 2016 17:11:08 +0000 (17:11 +0000)]
Use the port device name for the iov device for Chelsio T4/T5 cards.

Chelsio T4/T5 adapters are multifunction cards.  The main driver uses
physical function 4 (PF4).  However, VF devices for SR-IOV are only
supported on physical functions 0 through 3, where PF0 creates VFs tied
to port 0, etc.  The t4iov/t5iov driver was previously added to
create VF devices for ports that are present on each adapter.  This
change uses the recently added pci_iov_attach_name() function to
name the character device in /dev/iov after the associated port on
the card (e.g. /dev/iov/cxl0 is used to create VFs that share the
cxl0 port).  With this in place, mark the t4iov/t5iov devices quiet
to prevent them from cluttering dmesg.

Reviewed by: rstone
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7402

7 years agoPermit the name of the /dev/iov entry to be set by the driver.
jhb [Wed, 3 Aug 2016 17:09:12 +0000 (17:09 +0000)]
Permit the name of the /dev/iov entry to be set by the driver.

The PCI_IOV option creates character devices in /dev/iov for each PF
device driver that registers support for creating VFs.  By default the
character device is named after the PF device (e.g. /dev/iov/foo0).
This change adds a variant of pci_iov_attach() called pci_iov_attach_name()
that allows the name of the /dev/iov entry to be specified by the
driver.

Reviewed by: rstone
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7400

7 years agoApply the fix from r232612 to fixed function counters.
jhb [Wed, 3 Aug 2016 16:52:00 +0000 (16:52 +0000)]
Apply the fix from r232612 to fixed function counters.

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

7 years agoDisable DSA again.
des [Wed, 3 Aug 2016 16:34:20 +0000 (16:34 +0000)]
Disable DSA again.

MFC after: 3 days

7 years agoindent(1): accept offsetof(3) as a keyword.
pfg [Wed, 3 Aug 2016 16:33:34 +0000 (16:33 +0000)]
indent(1): accept offsetof(3) as a keyword.

Reference:
https://github.com/pstef/freebsd_indent/commit/c470e5e2c974aa38450ca4762b93829f7a7bfa4d

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRemove DSA from default cipher list and disable SSH1.
des [Wed, 3 Aug 2016 16:08:21 +0000 (16:08 +0000)]
Remove DSA from default cipher list and disable SSH1.

Upstream did this a long time ago, but we kept DSA and SSH1 in FreeBSD for
reasons which boil down to POLA.  Now is a good time to catch up.

MFC after: 3 days
Relnotes: yes

7 years agoRemove ncl_printf(), use printf(9) directly. After r303710 the
kib [Wed, 3 Aug 2016 15:58:20 +0000 (15:58 +0000)]
Remove ncl_printf(), use printf(9) directly.  After r303710 the
function duplicates printf().

Correct function names in the messages [*].

Noted by: bde [*]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCorrect assertion on vcpuid argument to vm_gpa_hold().
jhb [Wed, 3 Aug 2016 15:20:10 +0000 (15:20 +0000)]
Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168
Submitted by: Dave Cameron <daverabbitz@ihug.co.nz>
Reviewed by: grehan
MFC after: 1 month

7 years agoMerge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
kib [Wed, 3 Aug 2016 13:51:53 +0000 (13:51 +0000)]
Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
difference between files.
For pc98, put x86/mp_x86.c into the same place as used by i386 file list.
Fix typo in comment.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove unneeded (recursing) Giant acquisition around vprintf(9).
kib [Wed, 3 Aug 2016 11:49:17 +0000 (11:49 +0000)]
Remove unneeded (recursing) Giant acquisition around vprintf(9).

Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agolocks: fix sx compilation on mips after r303643
mjg [Wed, 3 Aug 2016 09:15:10 +0000 (09:15 +0000)]
locks: fix sx compilation on mips after r303643

The kernel.h header is required for the SYSINIT macro, which apparently
was present on amd64 by accident.

Reported by: kib

7 years agoAlthough the code amount is not big, move POSIX error processing into
ache [Wed, 3 Aug 2016 09:09:34 +0000 (09:09 +0000)]
Although the code amount is not big, move POSIX error processing into
two sepatate functions to make glob(3) code less obscure and more simple.
There is no needs to make them inline since it is error path which supposed
to not happes often.

7 years agoRemove Giant asserts. Update comment.
kib [Wed, 3 Aug 2016 08:57:15 +0000 (08:57 +0000)]
Remove Giant asserts.  Update comment.

Owning Giant in the init/uninit is accidental due to the moment where
VFS modules initialization is performed, and is not enforced by the
VFS interface.  The Giant lock does not prevent a parallel execution
of the code, it is VFS which implements the proper protocol.

Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSome style changes. Fix a typo in comment.
kib [Wed, 3 Aug 2016 08:53:29 +0000 (08:53 +0000)]
Some style changes.  Fix a typo in comment.

Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExplain why swapgeom_close_ev() is delegated.
kib [Wed, 3 Aug 2016 07:11:19 +0000 (07:11 +0000)]
Explain why swapgeom_close_ev() is delegated.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove mention of the Giant from the fork_return() description.
kib [Wed, 3 Aug 2016 07:10:09 +0000 (07:10 +0000)]
Remove mention of the Giant from the fork_return() description.
Making emphasis on this lock in the core function comment is confusing
for the modern kernel.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoRegenerate system call tables for r303699 and r303700.
ed [Wed, 3 Aug 2016 06:36:45 +0000 (06:36 +0000)]
Regenerate system call tables for r303699 and r303700.

7 years agoRe-add traling slash that was removed in r303699.
ed [Wed, 3 Aug 2016 06:35:58 +0000 (06:35 +0000)]
Re-add traling slash that was removed in r303699.

I must have accidentally pressed some random key in vim.

7 years agomprotect(): Change prototype to comply to POSIX.
ed [Wed, 3 Aug 2016 06:33:04 +0000 (06:33 +0000)]
mprotect(): Change prototype to comply to POSIX.

Our mprotect() function seems to take a "const void *" address to the
pages whose permissions need to be adjusted. POSIX uses "void *". Simply
stick to the POSIX one to prevent us from writing unportable code.

PR: 211423 (exp-run)
Tested by: antoine@ (Thanks!)

7 years agoRemove a duplicate PMC CPU number
jhibbits [Wed, 3 Aug 2016 01:46:55 +0000 (01:46 +0000)]
Remove a duplicate PMC CPU number

CPU number for MPC85XX is a duplicate for E500.  Since we don't support MPC85XX
"uncore" registers right now, rather than renumbering it simply remove it, and
it will properly use the E500 CPU ID.

7 years agoMerge MPC85XX and QorIQ config options
jhibbits [Wed, 3 Aug 2016 01:22:11 +0000 (01:22 +0000)]
Merge MPC85XX and QorIQ config options

Summary:
MPC85XX and QorIQ are very similar.  When the DPAA dTSEC driver was
added, QORIQ_DPAA was brought in as a config option to support the differences
in hardware register settings between QorIQ (e500mc-, e5500- based) SoCs and
QUICC (e500v1/e500v2-based) SoCs, particularly in the Local Access Window (LAW)
target settings.

Unify these settings using macros to hide details and ease porting, and use a
new function (mpc85xx_is_qoriq()) to distinguish between QorIQ and QUICC SoCs at
runtime.

An alternative to using the function could be to use a variable initialized at
platform attach time, which may incur less overhead at runtime.  Since it's not
in the critical path once booted, this optimization doesn't seem necessary at
first pass.

Reviewed by: nwhitehorn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7294

7 years agocxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
np [Tue, 2 Aug 2016 23:54:21 +0000 (23:54 +0000)]
cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
per-adapter data structure.  This replaces a global array with hardcoded
page sizes.

Sponsored by: Chelsio Communications

7 years agoAdd link for getnetgrent_r(3).
bdrewery [Tue, 2 Aug 2016 23:46:32 +0000 (23:46 +0000)]
Add link for getnetgrent_r(3).

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agotruss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall
bapt [Tue, 2 Aug 2016 22:47:06 +0000 (22:47 +0000)]
truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall

trussinfo->curthread must be initialized before calling enter_syscall(),
it is used by t->proc->abi->fetch_args().
Without that truss is segfaulting and the attached program also crash.

Submitted by: Nikita Kozlov (nikita@gandi.net)
Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7399

7 years agotools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
imp [Tue, 2 Aug 2016 21:55:23 +0000 (21:55 +0000)]
tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
we need to include it in -legacy or not. Since the ifdef was removed,
this broke building 10.x and older source trees on -current. Restore
just enough of _WITH_GETLINE to allow these older source trees to
still build and properly omit getline() from their -legacy library.

7 years agokgzip.8: note that it is deprecated and clarify BUGS section
emaste [Tue, 2 Aug 2016 21:48:26 +0000 (21:48 +0000)]
kgzip.8: note that it is deprecated and clarify BUGS section

kgzip is only useful on i386 and has a number of other limitations.
We're better served by officially deprecating it and encouraging users
to use loader(8) instead.

Reviewed by: dteske, wblock
Differential Revision: https://reviews.freebsd.org/D7098

7 years agopfctl: Use const where possible.
kp [Tue, 2 Aug 2016 20:32:02 +0000 (20:32 +0000)]
pfctl: Use const where possible.

This adds const qualifiers where it is possible.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoMove/add ARM ELF PHDR types to elf_common.h
emaste [Tue, 2 Aug 2016 20:26:04 +0000 (20:26 +0000)]
Move/add ARM ELF PHDR types to elf_common.h

Accidentally missed in r303674

7 years agoFix a segfault in bsdgrep when parsing the invalid extended regexps "?"
dim [Tue, 2 Aug 2016 20:25:22 +0000 (20:25 +0000)]
Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Reported by: Steve Kargl
MFC after: 1 week

7 years agoreadelf: report ARM program and section header types
emaste [Tue, 2 Aug 2016 20:11:04 +0000 (20:11 +0000)]
readelf: report ARM program and section header types

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7390

7 years agopfctl: Match prototype of pfctl_load_hostid.
kp [Tue, 2 Aug 2016 19:54:40 +0000 (19:54 +0000)]
pfctl: Match prototype of pfctl_load_hostid.

The prototype and the implementation of the pfctl_load_hostid used a
different data type for one of the parameters.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoAdd ELFOSABI_ARM_AEABI ELF OSABI constant
emaste [Tue, 2 Aug 2016 18:42:32 +0000 (18:42 +0000)]
Add ELFOSABI_ARM_AEABI ELF OSABI constant

Reported by: andrew
Sponsored by: The FreeBSD Foundation

7 years agoproc_init: Fix a few memory leaks of 'phdl'
cem [Tue, 2 Aug 2016 18:13:50 +0000 (18:13 +0000)]
proc_init: Fix a few memory leaks of 'phdl'

In the normal case and correct failure cases, the 'phdl' pointer is passed to
callers to use or clean up as needed.  However, some failure cases returned
early, failing to export the phdl pointer.

This was introduced in the restructuring of r303533.

Reported by: Coverity
CID: 1361070
Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division

7 years agopfctl: Allow TOS bits to be cleared
kp [Tue, 2 Aug 2016 15:41:42 +0000 (15:41 +0000)]
pfctl: Allow TOS bits to be cleared

TOS value 0 is valid, so use 256 as an invalid value rather than zero.
This allows users to enforce TOS == 0 with pf.

Reported by: Radek KrejĨa <radek.krejca@starnet.cz>

7 years agosed(1): Revert r303047 "cleanup" and therefore r303572.
pfg [Tue, 2 Aug 2016 15:35:53 +0000 (15:35 +0000)]
sed(1): Revert r303047 "cleanup" and therefore r303572.

While big, the change was meant to have no effect on behavior and instead
so far we have found two regressions: one in the etcupdate tests and
another one in the games/openttd port[1].

Revert to a known working state. We will likely have to split the patch in
functional parts before bringing back the changes.

PR: 195929
Reported by: danfe, madpilot [1]

7 years agoRemove trailing whitespace from the arm64 pmap
andrew [Tue, 2 Aug 2016 15:26:46 +0000 (15:26 +0000)]
Remove trailing whitespace from the arm64 pmap

Obtained from: ABT Systems Ltd
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation

7 years agoUpdate RISC-V port to Privileged Architecture Version 1.9.
br [Tue, 2 Aug 2016 14:50:14 +0000 (14:50 +0000)]
Update RISC-V port to Privileged Architecture Version 1.9.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoFix NULL pointer dereference.
ae [Tue, 2 Aug 2016 12:18:06 +0000 (12:18 +0000)]
Fix NULL pointer dereference.
ro pointer can be NULL when IPSec consumes mbuf.

PR: 211486
MFC after: 3 days

7 years agotcp/lro: Implement hash table for LRO entries.
sephe [Tue, 2 Aug 2016 06:36:47 +0000 (06:36 +0000)]
tcp/lro: Implement hash table for LRO entries.

This significantly improves HTTP workload performance and reduces
HTTP workload latency.

Reviewed by: rrs, gallatin, hps
Obtained from: rrs, gallatin
Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe)
Differential Revision: https://reviews.freebsd.org/D6689

7 years agolocks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case
mjg [Tue, 2 Aug 2016 03:05:59 +0000 (03:05 +0000)]
locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case

Reported by: Michael Butler <imb protected-networks.net>

7 years agolocks: fix up ifdef guards introduced in r303643
mjg [Tue, 2 Aug 2016 00:15:08 +0000 (00:15 +0000)]
locks: fix up ifdef guards introduced in r303643

Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct
define.

MFC after: 1 week

7 years agortentry: Initialize rt_mtx with MTX_NEW
cem [Mon, 1 Aug 2016 23:07:31 +0000 (23:07 +0000)]
rtentry: Initialize rt_mtx with MTX_NEW

The "rtentry" zone does not use UMA_ZONE_ZINIT, so it is invalid to assume the
mutex's memory will be zero.  Without MTX_NEW, garbage backing memory may
trigger the "re-initializing a mutex" assertion.

PR: 200991
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoopencrypto AES-ICM: Fix heap corruption typo
cem [Mon, 1 Aug 2016 22:57:03 +0000 (22:57 +0000)]
opencrypto AES-ICM: Fix heap corruption typo

This error looks like it was a simple copy-paste typo in the original commit
for this code (r275732).

PR: 204009
Reported by: Chang-Hsien Tsai <luke.tw AT gmail.com>
Sponsored by: EMC / Isilon Storage Division

7 years agoFix ddb "show proc" to show full arguments
cem [Mon, 1 Aug 2016 22:41:50 +0000 (22:41 +0000)]
Fix ddb "show proc" to show full arguments

PR: 200052
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoStore the offset of the KDOORBELL and GTS registers in the softc.
jhb [Mon, 1 Aug 2016 22:39:51 +0000 (22:39 +0000)]
Store the offset of the KDOORBELL and GTS registers in the softc.

VF devices use a different register layout than PF devices.  Storing
the offset in a value in the softc allows code to be shared between the
PF and VF drivers.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7389

7 years agoipoib: Bound the number of egress mbufs buffered during pathrec lookups.
markj [Mon, 1 Aug 2016 22:22:11 +0000 (22:22 +0000)]
ipoib: Bound the number of egress mbufs buffered during pathrec lookups.

In pathological situations where the master subnet manager becomes
unresponsive for an extended period, we may otherwise end up queuing all
of the system's mbufs while waiting for a response to a path record lookup.

This addresses the same issue as commit 1e85b806f9 in Linux.

Reviewed by: cem, ngie
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDisable PCI hotplug support for slots with power controllers.
jhb [Mon, 1 Aug 2016 22:19:23 +0000 (22:19 +0000)]
Disable PCI hotplug support for slots with power controllers.

After further review of the spec, I do not think the current HotPlug
code handles slots with power controllers correctly.  In particular,
the power state of the slot is to be inferred from other events, not
from examining the state of the power control bit in SLOT_CTL.  For now,
disable PCI hotplug support on such slots.

PR: 211081
Tested by: Jeffrey E Pieper <jeffrey.e.pieper@intel.com>
MFC after: 3 days