freebsd.git
8 years agoFirst pass to fix the 'tests' packages.
gjb [Tue, 2 Feb 2016 22:26:49 +0000 (22:26 +0000)]
First pass to fix the 'tests' packages.

Sponsored by: The FreeBSD Foundation

8 years agoInclude virecover in vi package.
gjb [Tue, 2 Feb 2016 21:06:09 +0000 (21:06 +0000)]
Include virecover in vi package.

Submitted by: lidl
Sponsored by: The FreeBSD Foundation

8 years agoCreate ee(1) package.
gjb [Tue, 2 Feb 2016 21:04:33 +0000 (21:04 +0000)]
Create ee(1) package.

Sponsored by: The FreeBSD Foundation

8 years agoCreate a package for autofs(5)
gjb [Tue, 2 Feb 2016 17:33:37 +0000 (17:33 +0000)]
Create a package for autofs(5)

Sponsored by: The FreeBSD Foundation

8 years agoCreate a package for vi(1) and related files.
gjb [Tue, 2 Feb 2016 16:47:50 +0000 (16:47 +0000)]
Create a package for vi(1) and related files.

Sponsored by: The FreeBSD Foundation

8 years agoFix naming inconsistency with lib32 debug packages.
gjb [Mon, 1 Feb 2016 18:50:52 +0000 (18:50 +0000)]
Fix naming inconsistency with lib32 debug packages.

Sponsored by: The FreeBSD Foundation

8 years agoFix periodic(8) and rc(8) script inclusion to rcmds package.
gjb [Sat, 30 Jan 2016 01:52:18 +0000 (01:52 +0000)]
Fix periodic(8) and rc(8) script inclusion to rcmds package.

Sponsored by: The FreeBSD Foundation

8 years agoWrap long lines after recent commits.
gjb [Fri, 29 Jan 2016 21:42:27 +0000 (21:42 +0000)]
Wrap long lines after recent commits.

Sponsored by: The FreeBSD Foundation

8 years agoMake sure 'pkg config ABI' uses ABI_FILE for the target.
gjb [Fri, 29 Jan 2016 21:39:44 +0000 (21:39 +0000)]
Make sure 'pkg config ABI' uses ABI_FILE for the target.

Sponsored by: The FreeBSD Foundation

8 years agoCleanup and organize etc/rc.d/Makefile.
gjb [Fri, 29 Jan 2016 21:35:24 +0000 (21:35 +0000)]
Cleanup and organize etc/rc.d/Makefile.
No functional changes.

Sponsored by: The FreeBSD Foundation

8 years agoReorder execution in the 'packages' target so both userland
gjb [Fri, 29 Jan 2016 17:05:30 +0000 (17:05 +0000)]
Reorder execution in the 'packages' target so both userland
and kernel are staged before invoking the 'create-<foo>-packages'
targets.

Include PKG_VERSION value in the 'create-{world,kernel}-packages'
targets so the value is not redefined when packaging the kernel,
which otherwise results in inconsistent and confusing package
version results.

Sponsored by: The FreeBSD Foundation

8 years agoMFH
gjb [Fri, 29 Jan 2016 14:52:54 +0000 (14:52 +0000)]
MFH

Sponsored by: The FreeBSD Foundation

8 years agoAdd implementations of sendmmsg(3) and recvmmsg(3) functions which
kib [Fri, 29 Jan 2016 14:12:12 +0000 (14:12 +0000)]
Add implementations of sendmmsg(3) and recvmmsg(3) functions which
wraps sendmsg(2) and recvmsg(2) into batch send and receive operation.
The goal of this implementation is only to provide API compatibility
with Linux.

The cancellation behaviour of the functions is not quite right, but
due to relative rare use of cancellation it is considered acceptable
comparing with the complexity of the correct implementation.  If
functions are reimplemented as syscalls, the fix would come almost
trivial.  The direct use of the syscall trampolines instead of libc
wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on
cancellation.

Submitted by: Boris Astardzhiev <boris.astardzhiev@gmail.com>
Discussed with: jilles (cancellation behaviour)
MFC after: 1 month

8 years agoFramework for ARM64 instruction disassembler
wma [Fri, 29 Jan 2016 13:06:30 +0000 (13:06 +0000)]
Framework for ARM64 instruction disassembler

    Provide an easy to use framework for ARM64 DDB disassembler.
    This commit does not contain full list of instruction opcodes.

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb, andrew, cognet
Differential revision: https://reviews.freebsd.org/D5114

8 years agoARM: After removal of old pmap-v6 code, rename pmap-v6-new.c to pmap-v6.c.
mmel [Fri, 29 Jan 2016 11:00:33 +0000 (11:00 +0000)]
ARM: After removal of old pmap-v6 code, rename pmap-v6-new.c to pmap-v6.c.

8 years agoARM: remove old pmap-v6 code. The new pmap-v6 is mature enough, and
mmel [Fri, 29 Jan 2016 10:31:54 +0000 (10:31 +0000)]
ARM: remove old pmap-v6 code. The new pmap-v6 is mature enough, and
dual implementation is showstopper for major cleanup.

This patch only removes old code from tree. Cleanups will follow asap.

8 years agoUse '^[>+][^+]' instead of '^[>+]' with grep(1) when filtering the
marius [Fri, 29 Jan 2016 01:54:32 +0000 (01:54 +0000)]
Use '^[>+][^+]' instead of '^[>+]' with grep(1) when filtering the
diff(1) output between two files in "new_only"-mode. Otherwise,
with the default of using unified format a remnant of the header
in the output is the result. This is especially irritating when
the two files differ but the second one is empty, amounting to the
vestige of the header being the only readout.
Reported by: Stefan Haemmerl

MFC after: 3 days

8 years agoUse intptr_t note ptrdiff_t when storing flags in the bottom bits of
brooks [Fri, 29 Jan 2016 01:22:12 +0000 (01:22 +0000)]
Use intptr_t note ptrdiff_t when storing flags in the bottom bits of
pointers.

Obtained from: CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d)
Sponsored by: DARPA, AFRL

8 years agoNote the double fork behavior with filemon.
bdrewery [Fri, 29 Jan 2016 01:09:04 +0000 (01:09 +0000)]
Note the double fork behavior with filemon.

X-MFC-With: r295029
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument the purpose and non-purpose of filemon(4).
bdrewery [Fri, 29 Jan 2016 01:00:12 +0000 (01:00 +0000)]
Document the purpose and non-purpose of filemon(4).

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDeclare bt_devenum() to match the definition.
brooks [Fri, 29 Jan 2016 00:59:48 +0000 (00:59 +0000)]
Declare bt_devenum() to match the definition.

Obtained from: CheriBSD (1c1dad87ef9983a4ca0c7d6eb0792d489436bcd1)
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agofilemon: Track the process pointer rather than a pid.
bdrewery [Fri, 29 Jan 2016 00:44:32 +0000 (00:44 +0000)]
filemon: Track the process pointer rather than a pid.

The process is not held since the process_exit hook is called after the
exithold.  There is no need to hold the process since the hook will
always see it exiting via the process_exit event.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agofilemon_open: Don't record a process to trace here.
bdrewery [Fri, 29 Jan 2016 00:44:28 +0000 (00:44 +0000)]
filemon_open: Don't record a process to trace here.

Only ioctl(FILEMON_SET_PID) should be setting the process-to-be-traced.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unused kernel/post-install file.
gjb [Fri, 29 Jan 2016 00:29:32 +0000 (00:29 +0000)]
Remove unused kernel/post-install file.

Sponsored by: The FreeBSD Foundation

8 years agoAvoid excessively invoking 'pkg bootstrap' if already done.
gjb [Thu, 28 Jan 2016 23:59:34 +0000 (23:59 +0000)]
Avoid excessively invoking 'pkg bootstrap' if already done.

Sponsored by: The FreeBSD Foundation

8 years agonvd: add hw.nvd.delete_max tunable
jimharris [Thu, 28 Jan 2016 23:15:14 +0000 (23:15 +0000)]
nvd: add hw.nvd.delete_max tunable

The NVMe specification does not define a maximum or optimal delete
size, so technically max delete size is min(full size of namespace,
2^32 - 1 LBAs).  A single delete operation for a multi-TB NVMe
namespace though may take much longer to complete than the nvme(4)
I/O timeout period.  So choose a sensible default here that is still
suitably large to minimize the number of overall delete operations.

This also fixes possible uint32_t overflow on initial TRIM operation
for zpool create operations for NVMe namespaces with >4G LBAs.

MFC after: 3 days
Sponsored by: Intel

8 years agoRemove debug output which was committed by accident.
tuexen [Thu, 28 Jan 2016 23:12:12 +0000 (23:12 +0000)]
Remove debug output which was committed by accident.
Thanks to Oliver Pinter for reporting.

MFC after: 3 days
X-MFC with: r294995

8 years agofilemon: Use process_exec EVENTHANDLER to capture sys_execve.
bdrewery [Thu, 28 Jan 2016 21:45:25 +0000 (21:45 +0000)]
filemon: Use process_exec EVENTHANDLER to capture sys_execve.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agokqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT
vangyzen [Thu, 28 Jan 2016 20:24:15 +0000 (20:24 +0000)]
kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT

NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent
pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT.
Do not let the two events be combined, since one would overwrite
the other's data.

PR: 180385
Submitted by: David A. Bright <david_a_bright@dell.com>
Reviewed by: jhb
MFC after: 1 month
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D4900

8 years agoMerge OpenSSL 1.0.2f.
jkim [Thu, 28 Jan 2016 20:15:22 +0000 (20:15 +0000)]
Merge OpenSSL 1.0.2f.

Relnotes: yes

8 years agoFix -include .depend hack from r294370 for headers not in .PATH.
bdrewery [Thu, 28 Jan 2016 18:57:47 +0000 (18:57 +0000)]
Fix -include .depend hack from r294370 for headers not in .PATH.

This hack will be removed in a few weeks.  It is here to fix incremental
builds of SSH between r291941 and r294370.

Reported by: jmallett
MFC after: 1 day
Sponsored by: EMC / Isilon Storage Division

8 years agoFix accounting package rc.d/accounting conflict.
gjb [Thu, 28 Jan 2016 18:44:31 +0000 (18:44 +0000)]
Fix accounting package rc.d/accounting conflict.

Add periodic(8) accounting scripts to acct package.

Sponsored by: The FreeBSD Foundation

8 years agoImport OpenSSL 1.0.2f.
jkim [Thu, 28 Jan 2016 18:41:59 +0000 (18:41 +0000)]
Import OpenSSL 1.0.2f.

8 years agoFix VNIC enumeration after r294993 and r294990
zbb [Thu, 28 Jan 2016 16:58:49 +0000 (16:58 +0000)]
Fix VNIC enumeration after r294993 and r294990

ofw_bus_get_node() must be tested against negative values since
missing parent bus method will result in calling the default method
which simply returns (-1): sys/dev/ofw/ofw_bus_if.m
This was lost in the review process.

Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoUse m_getjcl() instead of manually selecting zone.
glebius [Thu, 28 Jan 2016 16:51:56 +0000 (16:51 +0000)]
Use m_getjcl() instead of manually selecting zone.

Reviewed by: arybchik

8 years agoAlways look in the TCP pool.
tuexen [Thu, 28 Jan 2016 16:05:46 +0000 (16:05 +0000)]
Always look in the TCP pool.
This fixes issues with a restarting peer when the listening
1-to-1 style socket is closed.

MFC after: 3 days

8 years agoSupport new MDIO hierarchy in ThunderX DTB
zbb [Thu, 28 Jan 2016 15:44:14 +0000 (15:44 +0000)]
Support new MDIO hierarchy in ThunderX DTB

Some firmware revisions provide different DTB tree that include
odd MDIO placement in the tree.
This commit adds support for 2 new buses:
- MRML bridge (PCIB subordinate)
- MDIO nexus (MRML subordinate)
This allows for the correct MDIO attachment with both - new and old
firmware.

Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5070

8 years agoAdd FDT bus capabilities to ThunderX PCI driver
zbb [Thu, 28 Jan 2016 15:40:56 +0000 (15:40 +0000)]
Add FDT bus capabilities to ThunderX PCI driver

New ThunderX firmware incorporates modified DTB that presents
different device hierarchy. In the new device tree, MDIO
devices are below two additional buses that oddly hang on
PCI bridge.

Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5069

8 years agoCorrect alloc_ and release_resource methods in thunder_pcie driver
zbb [Thu, 28 Jan 2016 15:38:02 +0000 (15:38 +0000)]
Correct alloc_ and release_resource methods in thunder_pcie driver

- Avoid using BUS_ macros as bus_generic_ functions should be used instead.
- Fix mistaken device_t pointers in thunder_pcie_alloc_resource.
  Should use dev->parent method and allocate resource for child device

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5068

8 years agoDivide ThunderX PCIe driver to general and FDT part
zbb [Thu, 28 Jan 2016 15:34:13 +0000 (15:34 +0000)]
Divide ThunderX PCIe driver to general and FDT part

- Separate FDT and general PCIe driver parts
- Drop some irrelevant printfs that cannot be displayed in
  FDT attach
- Move ranges parsing to FDT portion of PCIe code

Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5067

8 years agoFix finding appropriate BGX node in DTB and move it to a separate function
zbb [Thu, 28 Jan 2016 15:30:58 +0000 (15:30 +0000)]
Fix finding appropriate BGX node in DTB and move it to a separate function

Search for BGX node in DTS in two ways:
1. Try to find it uder root node first
2. If not found under root, find the top level PCI bridge node
   and search all nodes below it until appropriate BGX node is found.
Move search code to another function to make the code more clear.
Remove unused variable by the way.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5066

8 years agoEHCI: Make core reset and port speed reading more generic.
mmel [Thu, 28 Jan 2016 14:11:59 +0000 (14:11 +0000)]
EHCI: Make core reset and port speed reading more generic.

Use driver settable callbacks for handling of:
- core post reset
- reading actual port speed

Typically, OTG enabled EHCI cores wants setting of USBMODE register,
but this register is not defined in EHCI specification and different
cores can have it on different offset.

Also, for cores with TT extension, actual port speed must be determinable.
But again, EHCI specification not covers this so this patch provides
function for two most common variant of speed bits layout.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D5088

8 years agoSMP support for ARMv6/v7 HW watchpoints
zbb [Thu, 28 Jan 2016 12:43:58 +0000 (12:43 +0000)]
SMP support for ARMv6/v7 HW watchpoints

Use per-CPU structure to store HW watchpoints registers state
for each CPU present in the system. Those registers will be restored
upon wake up from the STOP state if requested by the debug_monitor
code. The method is similar to the one introduced to AMD64.

We store all possible 16 registers for HW watchpoints
(maximum allowed by the architecture).
HW breakpoints are not maintained since they are used for single
stepping only.

Pointed out by: kib
Reviewed by:    wma
No strong objections from: kib
Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4338

8 years agoRemove ffs_mountroot() prototype; seems to be long gone.
trasz [Thu, 28 Jan 2016 12:21:23 +0000 (12:21 +0000)]
Remove ffs_mountroot() prototype; seems to be long gone.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix mutex releasing in ARM64 cpu_switch
wma [Thu, 28 Jan 2016 12:00:17 +0000 (12:00 +0000)]
Fix mutex releasing in ARM64 cpu_switch

    The code should be comparing pointers, not any data
    gathered from a blocked_lock.

Spotted by:            cognet
Approved by:           zbb, cognet (mentor)
Differential revision: https://reviews.freebsd.org/D5100

8 years agoAdd pidfile support to ggated(8)
ngie [Thu, 28 Jan 2016 03:24:06 +0000 (03:24 +0000)]
Add pidfile support to ggated(8)

The tests will manipulate the system daemon today, which can cause undesired
service interruption when the tests are run.

This change allows the geom_gate tests to be run with an arbitrary ggated(8)
daemon / geom_gate(4) device pairing.

Other changes:
- Sort #includes
- Use a more common idiom for parsing options with getopt(3)

Differential Revision: https://reviews.freebsd.org/D4836
MFC after: 2 weeks
Reviewed by: bjk (manpages), pjd (maintainer timeout)
Sponsored by: EMC / Isilon Storage Division

8 years agoRestore the 'beforeinstall' for chpass(1), so files with the
gjb [Thu, 28 Jan 2016 02:56:30 +0000 (02:56 +0000)]
Restore the 'beforeinstall' for chpass(1), so files with the
schg flag are handled before being replaced by a symbolic link.

Fix passwd(1)/yppasswd(1) schg issue similarly to chpass(1).

Note:  These are likely temporary fixes while identifying any
remaining files that are not marked as 'flags=schg' via mtree(8).

Sponsored by: The FreeBSD Foundation

8 years agoFollow-up r294967: Mark flags unused.
bdrewery [Thu, 28 Jan 2016 01:19:19 +0000 (01:19 +0000)]
Follow-up r294967: Mark flags unused.

X-MFC-With: r294967
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agofilemon: Trace fork via process_fork event.
bdrewery [Thu, 28 Jan 2016 01:17:55 +0000 (01:17 +0000)]
filemon: Trace fork via process_fork event.

This avoids needing ugly hooks and needing both a vfork and fork
handler.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoEnsure mtree(8) recognizes chpass(1) is schg.
gjb [Thu, 28 Jan 2016 01:15:57 +0000 (01:15 +0000)]
Ensure mtree(8) recognizes chpass(1) is schg.

Convert hard links to symbolic links, and remove the
'beforeinstall' and 'afterinstall' chflags(8) execution.

Sponsored by: The FreeBSD Foundation

8 years agofilemon: Use process_exit EVENTHANDLER to capture process exit.
bdrewery [Thu, 28 Jan 2016 00:51:17 +0000 (00:51 +0000)]
filemon: Use process_exit EVENTHANDLER to capture process exit.

This fixes some cases where a process could exit without being untracked
by filemon.

Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agofilemon_dtr: Lock the associated filemon handle before writing to it.
bdrewery [Wed, 27 Jan 2016 21:37:43 +0000 (21:37 +0000)]
filemon_dtr: Lock the associated filemon handle before writing to it.

Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoThis fixes a bug in UFS2 exported NFS volumes. An NFS client can
mckusick [Wed, 27 Jan 2016 21:27:05 +0000 (21:27 +0000)]
This fixes a bug in UFS2 exported NFS volumes. An NFS client can
crash a server that has exported UFS2 by presenting a filehandle
with an inode number that references an uninitialized inode in a
cylinder group. The problem is that UFS2 only initializes blocks
of inodes as they are first allocated and ffs_fhtovp() does not
validate that the inode is in a range of inodes that have been
initialized. Attempting to read an uninitialized inode gets random
data from the disk. When the kernel tries to interpret it as an
inode, panics often arise.

Reported by: Christos Zoulas (from NetBSD)
Reviewed by: kib

8 years agoFix naming for multiple kernels when building/packaging more than one.
gjb [Wed, 27 Jan 2016 21:24:45 +0000 (21:24 +0000)]
Fix naming for multiple kernels when building/packaging more than one.

Sponsored by: The FreeBSD Foundation

8 years agoThe bread() function was inconsistent about whether it would return
mckusick [Wed, 27 Jan 2016 21:23:01 +0000 (21:23 +0000)]
The bread() function was inconsistent about whether it would return
a buffer pointer in the event of an error (for some errors it would
return a buffer pointer and for other errors it would not return a
buffer pointer). The cluster_read() function was similarly inconsistent.

Clients of these functions were inconsistent in handling errors.
Some would assume that no buffer was returned after an error and
would thus lose buffers under certain error conditions. Others would
assume that brelse() should always be called after an error and
would thus panic the system under certain error conditions.

To correct both of these problems with minimal code churn, bread()
and cluster_write() now always free the buffer when returning an
error thus ensuring that buffers will never be lost. The brelse()
routine checks for being passed a NULL buffer pointer and silently
returns to avoid panics. Thus both approaches to handling error
returns from bread() and cluster_read() will work correctly.

Future code should be written assuming that bread() and cluster_read()
will never return a buffer with an error, so should not attempt to
brelse() the buffer when an error is returned.

Reviewed by: kib

8 years agofilemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c.
bdrewery [Wed, 27 Jan 2016 21:17:43 +0000 (21:17 +0000)]
filemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c.

It only prints the header from filemon_ioctl.  Keep the name though to stay
closer to other implementations.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agofilemon_ioctl: Lock the associated filemon handle before writing to it.
bdrewery [Wed, 27 Jan 2016 21:14:09 +0000 (21:14 +0000)]
filemon_ioctl: Lock the associated filemon handle before writing to it.

Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agofilemon_ioctl: Handle error from devfs_get_cdevpriv(9).
bdrewery [Wed, 27 Jan 2016 21:12:18 +0000 (21:12 +0000)]
filemon_ioctl: Handle error from devfs_get_cdevpriv(9).

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd 'stagekernel' target, which invokes 'distributekernel'
gjb [Wed, 27 Jan 2016 21:10:03 +0000 (21:10 +0000)]
Add 'stagekernel' target, which invokes 'distributekernel'
with -DNO_ROOT to create the METALOG mtree(8) file.

Separate the default STAGEDIR for world (WSTAGEDIR) and kernel
(KSTAGEDIR).

Fix the 'create-kernel-packages' target to work properly.

Evaluate if 'kernel' is set when invoking mtree-to-plist.awk,
which splits the kernel and kernel.debug into separate plist
files.

Fix METALOG creation when building/packaging multiple kernels.

Sponsored by: The FreeBSD Foundation

8 years agoReplace prebuilt uuencoded gallant.fnt with editable hex version
emaste [Wed, 27 Jan 2016 20:23:42 +0000 (20:23 +0000)]
Replace prebuilt uuencoded gallant.fnt with editable hex version

8 years agoDo not unlock rtld_phdr_lock over callback invocations.
kan [Wed, 27 Jan 2016 20:20:37 +0000 (20:20 +0000)]
Do not unlock rtld_phdr_lock over callback invocations.

The dl_iterate_phdr consumer code in libgcc does not expect multiple
callbacks running concurrently. This was fixed once already in r178807,
but accidentally got reverted in r294373.

8 years agoMake .debug file for libgcc_s.so.1 more useful.
kan [Wed, 27 Jan 2016 20:20:35 +0000 (20:20 +0000)]
Make .debug file for libgcc_s.so.1 more useful.

The files compiled into libgcc_s.so.1 did not have -g on
compiler command line, making generated .debug quite
pointless.

8 years agoktrace: tidy up ktrstruct
mjg [Wed, 27 Jan 2016 19:55:02 +0000 (19:55 +0000)]
ktrace: tidy up ktrstruct

- minor style fixes
- avoid doing strlen twice [1]

PR: 206648
Submitted by: C Turt <ecturt gmail.com> (original version) [1]

8 years agoDrop any previous fd when setting a new one.
bdrewery [Wed, 27 Jan 2016 19:11:11 +0000 (19:11 +0000)]
Drop any previous fd when setting a new one.

Reported by: mjg
Sponsored by: EMC / Isilon Storage Division
MFC after: 2 weeks

8 years agoImprove reporting of connection problems in iscsid(8).
trasz [Wed, 27 Jan 2016 18:12:42 +0000 (18:12 +0000)]
Improve reporting of connection problems in iscsid(8).

Obtained from: Mellanox Technologies
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRename netinet/tcp_cc.h to netinet/cc/cc.h.
glebius [Wed, 27 Jan 2016 17:59:39 +0000 (17:59 +0000)]
Rename netinet/tcp_cc.h to netinet/cc/cc.h.

Discussed with: lstewart

8 years agoConvert ss_sp in stack_t and sigstack to void *.
jhb [Wed, 27 Jan 2016 17:55:01 +0000 (17:55 +0000)]
Convert ss_sp in stack_t and sigstack to void *.

POSIX requires these members to be of type void * rather than the
char * inherited from 4BSD.  NetBSD and OpenBSD both changed their
fields to void * back in 1998.  No new build failures were reported
via an exp-run.

PR: 206503 (exp-run)
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5092

8 years agoFix the value we print when the size is too large. While here fix the types
andrew [Wed, 27 Jan 2016 17:47:07 +0000 (17:47 +0000)]
Fix the value we print when the size is too large. While here fix the types
we cast to to be unsigned as the data is unsigned.

Reviewed by: ian

8 years agoWhen finding the physical address of a device allow intermediate addresses
andrew [Wed, 27 Jan 2016 17:33:31 +0000 (17:33 +0000)]
When finding the physical address of a device allow intermediate addresses
to be 64-bit on 32-bit architectures. It is not uncommon for device trees
to use the upper 32-bits to store what effectively is an index into the
parent ranges property. In this case, when running with a 32-bit bus_addr_t
and bus_size_t, we would previously truncate the address, this may then
incorrectly match the wrong range, and return the wrong address.

Tested by: bz (earlier version)

8 years agoficl on i386 should cast to unsigned char output to support efi i386
allanjude [Wed, 27 Jan 2016 16:45:23 +0000 (16:45 +0000)]
ficl on i386 should cast to unsigned char output to support efi i386

make it possible for efi_console to recognize and translate box characters
on i386 build (unsigned versus signed char passed as int issue).

Submitted by: Toomas Soome <tsoome at me.com>
Reviewed by: emaste, smh, dteske
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D4993

8 years agoFix mistake when transitioning to the new defines with ZFS loader. I
imp [Wed, 27 Jan 2016 16:36:18 +0000 (16:36 +0000)]
Fix mistake when transitioning to the new defines with ZFS loader. I
hate adding yet another define, but it is the lessor of the evil
choices available. Kill another evil by removing PATH_BOOT3 and
replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate.

PR: 206659

8 years agosyslogd: Enable repeated line compression for lines of any length.
asomers [Wed, 27 Jan 2016 16:17:15 +0000 (16:17 +0000)]
syslogd: Enable repeated line compression for lines of any length.

Enable repeated line compression for lines of any length, instead of only
short lines. AFAICT repeated line compression was limited to short lines as
a RAM optimization, which made sense when karels added it in 1988, but no
longer.  The penalty is a paltry 904B of RAM per file logged.

Reviewed by: rpaulo
MFC after: 32 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4475

8 years agoFix grep_test:recurse with ZFS and TMPFS tmpdirs
asomers [Wed, 27 Jan 2016 16:13:10 +0000 (16:13 +0000)]
Fix grep_test:recurse with ZFS and TMPFS tmpdirs

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
Fix grep_test:recurse when /tmp is either zfs or tmpfs. The test was
relying on an implicit ordering of directory recursion which happens
to be true when using UFS. grep's specification requires no such
ordering. The solution is to ignore the order of grep's results.

Reviewed by: ngie
MFC after: 32 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4925

8 years agoFix fatal warn when compiling under GCC 5.2.0
dteske [Wed, 27 Jan 2016 15:28:23 +0000 (15:28 +0000)]
Fix fatal warn when compiling under GCC 5.2.0

GCC 5.2.0 generates the following [fatal] warning:
dialog_util.c:270:23: error:
zero-length gnu_printf format string [-Werror=format-zero-length]
   sprintf(dargv[n++], "");

Fix malloc argument while here, removing sprintf.

Reported by: Ruslan Bukin <ruslan.bukin at cl cam ac uk>

8 years agoFix my email.
skra [Wed, 27 Jan 2016 14:47:00 +0000 (14:47 +0000)]
Fix my email.

8 years agoFix generation of dependency rules for the LinuxKPI, the MLX5 driver
hselasky [Wed, 27 Jan 2016 14:46:30 +0000 (14:46 +0000)]
Fix generation of dependency rules for the LinuxKPI, the MLX5 driver
and all of OFED except MLX4[EN/IB].

Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoMFH
gjb [Wed, 27 Jan 2016 14:16:13 +0000 (14:16 +0000)]
MFH

Sponsored by: The FreeBSD Foundation

8 years agoAdd pthread MD part for RISC-V.
br [Wed, 27 Jan 2016 14:10:50 +0000 (14:10 +0000)]
Add pthread MD part for RISC-V.

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

8 years agoSwitch UseDNS back on
des [Wed, 27 Jan 2016 13:40:44 +0000 (13:40 +0000)]
Switch UseDNS back on

8 years agoAdd the RISC-V MD parts of libthread_db.
br [Wed, 27 Jan 2016 10:34:07 +0000 (10:34 +0000)]
Add the RISC-V MD parts of libthread_db.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5064

8 years agoFix issues with TCP_CONGESTION handling after r294540:
glebius [Wed, 27 Jan 2016 07:34:00 +0000 (07:34 +0000)]
Fix issues with TCP_CONGESTION handling after r294540:
o Return back the buf[TCP_CA_NAME_MAX] for TCP_CONGESTION,
  for TCP_CCALGOOPT use dynamically allocated *pbuf.
o For SOPT_SET TCP_CONGESTION do NULL terminating of string
  taking from userland.
o For SOPT_SET TCP_CONGESTION do the search for the algorithm
  keeping the inpcb lock.
o For SOPT_GET TCP_CONGESTION first strlcpy() the name
  holding the inpcb lock into temporary buffer, then copyout.

Together with: lstewart

8 years agoImplement AT_SECURE properly.
delphij [Wed, 27 Jan 2016 07:20:55 +0000 (07:20 +0000)]
Implement AT_SECURE properly.

AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a
boolean flag indicating whether secure mode should be enabled. 1 means
that the program has changes its credentials during the execution.
Being exported AT_SECURE used by glibc issetugid() call.

Submitted by: imp, dchagin
Security: FreeBSD-SA-16:10.linux
Security: CVE-2016-1883

8 years agoAdd debug output via ATF_REQUIRE_MSG when the first call to
ngie [Wed, 27 Jan 2016 07:06:49 +0000 (07:06 +0000)]
Add debug output via ATF_REQUIRE_MSG when the first call to
mlock(2) fails

This helps identify the problem with running this test on my VM
hosts (ENOMEM)

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

8 years agoFix regression introduced on r293801.
araujo [Wed, 27 Jan 2016 06:28:56 +0000 (06:28 +0000)]
Fix regression introduced on r293801.
The UID/GID 93 is in using by jaber on PORTS, we will use
UID/GID 160 for ypldap(8).

Reported by: antoine
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D5062

8 years agoAdjust vm.max_wired in order to avoid hitting EAGAIN artificially
ngie [Wed, 27 Jan 2016 06:24:19 +0000 (06:24 +0000)]
Adjust vm.max_wired in order to avoid hitting EAGAIN artificially

Set vm.max_wired to INT_MAX in :mlock_err, :mlock_mmap, and :mlock_nested to
avoid hitting EAGAIN artificially on the system when running the tests

Require root privileges in order to set the sysctl

Add allow_sysctl_side_effects to require.config as this test is now adjusting
sysctls that can affect the global system state

Unlike the version submitted by cem in OneFS, this version uses a scratch file
to save/restore the previous value of the sysctl. I _really_, _really_ wish
there were better hooks in atf/kyua for per test suite setup/teardown -- using
a file is kludgy, but it's the best I can do to avoid situations where (for
instance), sysctl(3) may fail and drop a core outside the kyua sandbox.

Based on a patch submitted by cem, but modified to take business logic out of
ATF_TP_ADD_TCS(3).

Differential Revision: https://reviews.freebsd.org/D4779
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division

8 years agoFix a crash if `-D' is used without `-t title'
dteske [Wed, 27 Jan 2016 06:21:35 +0000 (06:21 +0000)]
Fix a crash if `-D' is used without `-t title'

dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s dialog_gauge()
and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no title
is set for the widget. Reproducible with `dialog --gauge hi 6 20' (adding
`--title ""' is enough to prevent segmentation fault).

MFC after: 3 days
X-MFC-to: stable/10

8 years agoRemove unused function prototype
dteske [Wed, 27 Jan 2016 06:16:53 +0000 (06:16 +0000)]
Remove unused function prototype

MFC after: 3 days
X-MFC-to: stable/10

8 years agoRequire /sbin/mount_cd9660 when running the cd9660 tests
ngie [Wed, 27 Jan 2016 06:14:20 +0000 (06:14 +0000)]
Require /sbin/mount_cd9660 when running the cd9660 tests

In some cases the test system might not have mount_cd9660(8). Don't
implicitly rely on it while testing cd9660 support; explicitly rely
on it

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

8 years agoMore fixes to the build.
glebius [Wed, 27 Jan 2016 05:15:53 +0000 (05:15 +0000)]
More fixes to the build.

8 years agoFix build on i386. I can't yet understand why does it build on amd64.
glebius [Wed, 27 Jan 2016 04:59:28 +0000 (04:59 +0000)]
Fix build on i386. I can't yet understand why does it build on amd64.

8 years agohyperv/vmbus: Event handling code refactor.
sephe [Wed, 27 Jan 2016 03:53:30 +0000 (03:53 +0000)]
hyperv/vmbus: Event handling code refactor.

- Use taskqueue instead of swi for event handling.
- Scan the interrupt flags in filter
- Disable ringbuffer interrupt mask in filter to ensure no unnecessary
  interrupts.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: adrian, sephe, Dexuan <decui microsoft com>
Approved by: adrian (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4920

8 years agoFix the build post-r294883.
jhibbits [Wed, 27 Jan 2016 03:51:24 +0000 (03:51 +0000)]
Fix the build post-r294883.

Pointy-hat to: jhibbits
X-MFC with: r294883

8 years agoAllow specification of fetch options for ntp leap-seconds fetch.
cy [Wed, 27 Jan 2016 02:25:25 +0000 (02:25 +0000)]
Allow specification of fetch options for ntp leap-seconds fetch.

MFC after: 1 week
X-MFC with: r289421, r293037, r294773

8 years agoConvert rman to use rman_res_t instead of u_long
jhibbits [Wed, 27 Jan 2016 02:23:54 +0000 (02:23 +0000)]
Convert rman to use rman_res_t instead of u_long

Summary:
Migrate to using the semi-opaque type rman_res_t to specify rman resources.  For
now, this is still compatible with u_long.

This is step one in migrating rman to use uintmax_t for resources instead of
u_long.

Going forward, this could feasibly be used to specify architecture-specific
definitions of resource ranges, rather than baking a specific integer type into
the API.

This change has been broken out to facilitate MFC'ing drivers back to 10 without
breaking ABI.

Reviewed By: jhb
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5075

8 years agocleanup and document in some detail the internals of the testing code
luigi [Wed, 27 Jan 2016 02:22:31 +0000 (02:22 +0000)]
cleanup and document in some detail the internals of the testing code
for dummynet schedulers

8 years agothe _Static_assert was not supposed to be in the commit.
luigi [Wed, 27 Jan 2016 02:14:08 +0000 (02:14 +0000)]
the _Static_assert was not supposed to be in the commit.

8 years agoReplace awk with more efficient builtins-only algo
dteske [Wed, 27 Jan 2016 02:11:58 +0000 (02:11 +0000)]
Replace awk with more efficient builtins-only algo

8 years agobugfix: the scheduler template (dn_schk) for the round robin scheduler
luigi [Wed, 27 Jan 2016 02:08:30 +0000 (02:08 +0000)]
bugfix: the scheduler template (dn_schk) for the round robin scheduler
is followed by another structure (rr_schk) whose size must be set
in the schk_datalen field of the descriptor.
Not allocating the memory may cause other memory to be overwritten
(though dn_schk is 192 bytes and rr_schk only 12 so we may be lucky
and end up in the padding after the dn_schk).

This is a merge candidate for stable and 10.3

MFC after: 3 days

8 years agoRevert yacc dependency back to pre-r241298.
bdrewery [Wed, 27 Jan 2016 01:33:26 +0000 (01:33 +0000)]
Revert yacc dependency back to pre-r241298.

Several attempts to fix this logic was done after r241298, which were
all reverted, yet this change was not.

The .h file does not depend on the .c file, so do not impose such a
dependency on it.  They are generated by the same command but do not
depend on each other.  Restore the .ORDER which should handle parallel build
issues.  This fixes an actual bug where the .h file is not recreated
when missing [1].  For example:
  cd lib/libc
  make cleanobj
  make nsparser.h
  rm nsparser.h
  make nsparser.h # will not rebuild nsparser.h

I have been trying to track down a build problem where nsparser.h is
missing when nslexer.o is built.  It is possible this is related.

Reported by: bde [1]
https://lists.freebsd.org/pipermail/svn-src-all/2012-October/059481.html
https://lists.freebsd.org/pipermail/svn-src-all/2012-October/060038.html
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace nslexer.l->nslexer.c custom rule with a -D CFLAG.
bdrewery [Wed, 27 Jan 2016 01:33:23 +0000 (01:33 +0000)]
Replace nslexer.l->nslexer.c custom rule with a -D CFLAG.

This avoids reproducing the lex logic which had dependencies set wrong
and used an intermediate file for modifying the YY_BUF_SIZE.

This has only been possible since flex 2.5.37 was imported in r250873,
which uses #ifndef YY_BUF_SIZE.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division