Commit Graph

208137 Commits

Author SHA1 Message Date
Steven Hartland
4088e74393 Fix phy interrupts setup for ixl
Fix the inverted set of interrupts being used as the mask for ixl.

Without this ixl devices fail to detect link state changes.

Reviewed by:	erj, sbruno
MFC after:	2 days
Sponsored by:	Multiplay
2016-01-29 21:06:59 +00:00
Zbigniew Bodek
4111e0a100 Fix sending IPI to all CPUs on ARM64
There is no explanation why IPI ID is incremented here by "16".
This should have been removed in r285533 but somehow survived.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5120
2016-01-29 18:43:51 +00:00
Svatopluk Kraus
37b8426b33 Retire pmap_pte_init_mmu_v6() which was used by old pmap-v6. 2016-01-29 17:43:03 +00:00
Alexander Motin
668e1ba140 MFV 295046: 6358 A faulted pool with only unavailable vdevs triggers
assertion failure in libzfs

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Serban Maduta <serban.maduta@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Vatca <dan.vatca@gmail.com>

illumos/illumos-gate@b289d045e0
2016-01-29 17:20:59 +00:00
Alexander Motin
0fbf79a6b3 6358 A faulted pool with only unavailable vdevs triggers assertion
failure in libzfs

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Serban Maduta <serban.maduta@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Vatca <dan.vatca@gmail.com>

illumos/illumos-gate@b289d045e0
2016-01-29 17:18:50 +00:00
Alan Somers
d4b9233a96 Add a sysctl to allow ZFS pools backed by zvols
Change 294329 removed the ability to build ZFS pools that are backed by
zvols, because having that ability (even if it's not used) leads to
deadlocks. By popular demand, I'm adding an off-by-default sysctl to
reenable that ability.

Reviewed by:	lidl, delphij
MFC after:	Never
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4998
2016-01-29 17:08:26 +00:00
Svatopluk Kraus
1fc390d1a1 Remove NPTEPG definition which is not used anywhere now after
introduction of new pmap dump interface (r294722). And do not
expose pt_entry_t type.
2016-01-29 16:42:03 +00:00
Svatopluk Kraus
480f7464c1 Use kernel_pmap directly instead of pmap_kernel(). The kernel_pmap is
already used for __ARM_ARCH >= 6 and so even for __ARM_ARCH < 6 on some
common places.
2016-01-29 16:01:37 +00:00
Ruslan Bukin
28029b68c0 Welcome the RISC-V 64-bit kernel.
This is the final step required allowing to compile and to run RISC-V
kernel and userland from HEAD.

RISC-V is a completely open ISA that is freely available to academia
and industry.

Thanks to all the people involved! Special thanks to Andrew Turner,
David Chisnall, Ed Maste, Konstantin Belousov, John Baldwin and
Arun Thomas for their help.
Thanks to Robert Watson for organizing this project.

This project sponsored by UK Higher Education Innovation Fund (HEIF5) and
DARPA CTSRD project at the University of Cambridge Computer Laboratory.

FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv

Reviewed by:	andrew, emaste, kib
Relnotes:	Yes
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D4982
2016-01-29 15:12:31 +00:00
Konstantin Belousov
bf420ace0a 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
2016-01-29 14:12:12 +00:00
Wojciech Macek
8a1867f4aa 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
2016-01-29 13:06:30 +00:00
Michal Meloun
4f7da057cb ARM: After removal of old pmap-v6 code, rename pmap-v6-new.c to pmap-v6.c. 2016-01-29 11:00:33 +00:00
Michal Meloun
41a7c569b0 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.
2016-01-29 10:31:54 +00:00
Marius Strobl
05ef7ed17b 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
2016-01-29 01:54:32 +00:00
Brooks Davis
45308eec4a Use intptr_t note ptrdiff_t when storing flags in the bottom bits of
pointers.

Obtained from:	CheriBSD (e3a69027cc)
Sponsored by:	DARPA, AFRL
2016-01-29 01:22:12 +00:00
Bryan Drewery
0c370c1a96 Note the double fork behavior with filemon.
X-MFC-With:	r295029
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-29 01:09:04 +00:00
Bryan Drewery
22bcf8a634 Document the purpose and non-purpose of filemon(4).
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-29 01:00:12 +00:00
Brooks Davis
34fe534bcf Declare bt_devenum() to match the definition.
Obtained from:	CheriBSD (1c1dad87ef)
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2016-01-29 00:59:48 +00:00
Bryan Drewery
d5e53f99be 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
2016-01-29 00:44:32 +00:00
Bryan Drewery
6137c5d990 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
2016-01-29 00:44:28 +00:00
Jim Harris
aeae6079b4 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
2016-01-28 23:15:14 +00:00
Michael Tuexen
a4cab32319 Remove debug output which was committed by accident.
Thanks to Oliver Pinter for reporting.

MFC after: 3 days
X-MFC with: r294995
2016-01-28 23:12:12 +00:00
Bryan Drewery
f889a61ae5 filemon: Use process_exec EVENTHANDLER to capture sys_execve.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-28 21:45:25 +00:00
Eric van Gyzen
0e3d6ed44e 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
2016-01-28 20:24:15 +00:00
Jung-uk Kim
8180e704ac Merge OpenSSL 1.0.2f.
Relnotes:	yes
2016-01-28 20:15:22 +00:00
Bryan Drewery
2cf60b3ce2 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
2016-01-28 18:57:47 +00:00
Jung-uk Kim
c188d4cade Import OpenSSL 1.0.2f. 2016-01-28 18:41:59 +00:00
Zbigniew Bodek
db7cfc199e 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
2016-01-28 16:58:49 +00:00
Gleb Smirnoff
009d75e764 Use m_getjcl() instead of manually selecting zone.
Reviewed by:	arybchik
2016-01-28 16:51:56 +00:00
Michael Tuexen
79b67faaf6 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
2016-01-28 16:05:46 +00:00
Zbigniew Bodek
3f51d8888a 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
2016-01-28 15:44:14 +00:00
Zbigniew Bodek
68a594774e 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
2016-01-28 15:40:56 +00:00
Zbigniew Bodek
88c5cdf401 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
2016-01-28 15:38:02 +00:00
Zbigniew Bodek
bc5758b633 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
2016-01-28 15:34:13 +00:00
Zbigniew Bodek
be624ad430 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
2016-01-28 15:30:58 +00:00
Michal Meloun
cdf4ec6873 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
2016-01-28 14:11:59 +00:00
Zbigniew Bodek
60ba692c78 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
2016-01-28 12:43:58 +00:00
Edward Tomasz Napierala
50102a6342 Remove ffs_mountroot() prototype; seems to be long gone.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-28 12:21:23 +00:00
Wojciech Macek
8eb447cc45 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
2016-01-28 12:00:17 +00:00
Enji Cooper
fc7e71c52d 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
2016-01-28 03:24:06 +00:00
Bryan Drewery
e95c55e50d Follow-up r294967: Mark flags unused.
X-MFC-With:	r294967
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-28 01:19:19 +00:00
Bryan Drewery
2f6009620f 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
2016-01-28 01:17:55 +00:00
Bryan Drewery
79d699139b 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
2016-01-28 00:51:17 +00:00
Bryan Drewery
50c99f32a9 filemon_dtr: Lock the associated filemon handle before writing to it.
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-27 21:37:43 +00:00
Kirk McKusick
abe53f7e91 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
2016-01-27 21:27:05 +00:00
Kirk McKusick
d2a28cb080 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
2016-01-27 21:23:01 +00:00
Bryan Drewery
2b198fe92f 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
2016-01-27 21:17:43 +00:00
Bryan Drewery
64c368a488 filemon_ioctl: Lock the associated filemon handle before writing to it.
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-27 21:14:09 +00:00
Bryan Drewery
e8c87a09dc filemon_ioctl: Handle error from devfs_get_cdevpriv(9).
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-01-27 21:12:18 +00:00
Ed Maste
13f727c862 Replace prebuilt uuencoded gallant.fnt with editable hex version 2016-01-27 20:23:42 +00:00