Commit Graph

111152 Commits

Author SHA1 Message Date
Sepherosa Ziehau
387d355588 hyperv/vmbus: Process event timer before checking events
And update comment.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6600
2016-05-31 04:10:15 +00:00
Adrian Chadd
ee1623827e [ath] add BTCOEX debug section; modify DPRINTF() to take a no-arg format string.
Tested:

* QCA9565, STA mode
2016-05-31 04:09:17 +00:00
Ed Maste
71f44ab168 Add and correct MIPS relocation types
The correct names for R_MIPS_GOT_HI16 and R_MIPS_GOT_LO16 have a _
after GOT. The nonstandard names (R_MIPS_GOTHI16, R_MIPS_GOTLO16) in the
FreeBSD elf_common.h header also had incorrect values and were not used
in the tree, so just remove them.

Add other MIPS relocation types found in FreeBSD/mips64 object files.

Reviewed by:	imp, jmallett
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D6561
2016-05-30 20:51:51 +00:00
Michael Tuexen
3d48d25be7 Add PR_CONNREQUIRED for SOCK_STREAM sockets using SCTP.
This is required to signal connetion setup on non-blocking sockets
via becoming writable. This still allows for implicit connection
setup.

MFC after:	1 week
2016-05-30 18:24:23 +00:00
Michael Tuexen
7b7f31e6cf Fix a byte order issue for the scope stored in the SCTP cookie.
MFC after:	1 week
2016-05-30 11:18:39 +00:00
Sepherosa Ziehau
496d023db3 hyperv/et: Allow Hyper-V event timer be disabled
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6599
2016-05-30 09:44:17 +00:00
Sepherosa Ziehau
6072b2511c hyperv/et: Device renaming; consistent w/ other Hyper-V utils
While I'm here, prefix function names w/ vmbus, since unlike Hyper-V
timecounter, Hyper-V event timer will not work w/o vmbus.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6598
2016-05-30 09:35:36 +00:00
Sepherosa Ziehau
3f07976a64 hyperv: Move timer frequency definition to common place.
And cleanup event timer period settings.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6597
2016-05-30 09:20:08 +00:00
Ed Schouten
049342a994 Add missing restrict keywords to lio_listio(). 2016-05-30 09:18:12 +00:00
Michael Gmelin
0ba5622d8c Fix ig4 operation for certain machines
Some machine BIOSes use the I2C bus and leave it in a state that causes
interrupts to not work properly due to a pending interrupt having been
latched.

Refactor the code a bit to clear pending interrupts when I2C is enabled.
This fixes the primary problem.

Also fix a possible race condition in the interrupt handler where the
interrupt was being cleared after reading the status instead of before.

Reported by:	pfg
Reviewed by:	jhb
Approved by:	jhb
Obtained from:	DragonFly BSD
Differential Revision:	https://reviews.freebsd.org/D6586
2016-05-30 09:05:24 +00:00
Sepherosa Ziehau
efe8791a64 hyperv/et: Make sure only one event timer will be registered
This nullifies the need to use softc.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6591
2016-05-30 08:50:33 +00:00
Sepherosa Ziehau
430d28dbb3 hyperv/vmbus: Move SINT settings to vmbus_var.h
While I'm here remove the event timer's dependency on hv_vmbus_priv.h

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6574
2016-05-30 08:42:35 +00:00
Sepherosa Ziehau
d7bc16443e hyperv/et: Fix STIMER0 operations.
- Make sure that STIMER0 is disabled before writting to it, since
  writing to an enabled STIMER will result in undefined behaviour.
- It is unnecessary to reconfigure STIMER0 upon each et_start().
- Make sure that MSR_HV_REF_TIME_COUNT will not return 0, since
  writing 0 to STIMER_COUNT will disable the target STIMER.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6573
2016-05-30 08:25:09 +00:00
Sepherosa Ziehau
cb2404b4ad bge: Support 5717 C0, which is almost same as 5720 A0
PR:		209758
Obtained from:	DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0
MFC after:	1 week
2016-05-30 06:49:01 +00:00
Jamie Gritton
ee8d6bd352 Mark jail(2), and the sysctls that it (and only it) uses as deprecated.
jail(8) has long used jail_set(2), and those sysctl only cause confusion.
2016-05-30 05:21:24 +00:00
Sepherosa Ziehau
5cfd97e823 mbuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties
This flag has not been used, and drivers setting M_HASHTYPE_OPAQUE have
not been converted as of this commit.

Reviewed by:	hps, gallatin (early version)
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6406
2016-05-30 04:48:06 +00:00
Sepherosa Ziehau
425b763928 tcp: Don't prematurely drop receiving-only connections
If the connection was persistent and receiving-only, several (12)
sporadic device insufficient buffers would cause the connection be
dropped prematurely:
Upon ENOBUFS in tcp_output() for an ACK, retransmission timer is
started.  No one will stop this retransmission timer for receiving-
only connection, so the retransmission timer promises to expire and
t_rxtshift is promised to be increased.  And t_rxtshift will not be
reset to 0, since no RTT measurement will be done for receiving-only
connection.  If this receiving-only connection lived long enough
(e.g. >350sec, given the RTO starts from 200ms), and it suffered 12
sporadic device insufficient buffers, i.e. t_rxtshift >= 12, this
receiving-only connection would be dropped prematurely by the
retransmission timer.

We now assert that for data segments, SYNs or FINs either rexmit or
persist timer was wired upon ENOBUFS.  And don't set rexmit timer
for other cases, i.e. ENOBUFS upon ACKs.

Discussed with:	lstewart, hiren, jtl, Mike Karels
MFC after:	3 weeks
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5872
2016-05-30 03:31:37 +00:00
Zbigniew Bodek
01ed3219b9 Improve ARM debug_monitor for SMP machines
- Reset debug architecture and enable monitor for secondary
  CPUs in init_secondary() rather than when configuring watchpoint, etc.
- Disable HW debugging capabilities when one of the CPU cores fails
  to set up.
- Use dbg_capable() in a more atomic manner to avoid any mismatch
  between CPUs.

Differential Revision: https://reviews.freebsd.org/D6009
2016-05-29 17:35:38 +00:00
Zbigniew Bodek
9ae1207bcf Fix debug_monitor code for older ARMs (ARM11)
- Enable monitor mode prior to accessing watchpoint
  registers for v6, v6.1 architectures.
- Fix configuration scheme for v6, v6.1 and v7 Debug Archs
- Enable monitor unconditionally and for good instead
  of enabling and disabling it (needed for single stepping
  on on v6/v6.1)

Tested on RPI-B and Arndale

Differential Revision: https://reviews.freebsd.org/D6008
2016-05-29 17:33:49 +00:00
Dimitry Andric
4a8240ec66 Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling
for C++.  It clashes with the one in libc++'s <atomic> header.

(Previously, the _Atomic() macro was defined in <stdatomic.h>, which is
only for use with C11, but for various reasons it was moved to its
current location in r251804.)

Discussed with:	bdrewery, ed
MFC after:	2 weeks
2016-05-29 17:32:19 +00:00
Colin Percival
696c3895ae Retune SHA2 code for improved performance on CPUs with more ILP and
a preference for memory load instructions over large code footprints
with embedded immediate variables.

On amd64 CPUs from 2007-2008 there is not a significant change, but
amd64 CPUs from 2009-2010 get roughly 10% more throughput with this
code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and
AMD64 CPUs from 2013-2015 get 20-25% more throughput.  The Raspberry
Pi 2 increases its throughput by 6-8%.

Sponsored by:	Tarsnap Backup Inc.
Performance tested by:	allanjude
MFC after:	3 weeks
2016-05-29 17:26:40 +00:00
Konstantin Belousov
9f790a1756 Do not leak the vm object lock when swap reservation failed, in
vm_object_coalesce().

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-05-29 15:46:19 +00:00
Michal Meloun
74bf497550 ARM GIC: Allow to setup interrupt without configuration data.
In some cases, like for PCI devices, only interrupt numbers are enumerated
from HW. In this case, use INTR_foo_CONFORM as level and trigger values.
2016-05-29 07:39:56 +00:00
Don Lewis
9a81299340 Now that PIE is free of runtime floating point, revert r300853 to
reconnect PIE to the build.
2016-05-29 07:29:35 +00:00
Don Lewis
fe4b5f6659 Cast some expressions that multiply a long long constant by a
floating point constant to int64_t.  This avoids the runtime
conversion of the the other operand in a set of comparisons from
int64_t to floating point and doing the comparisions in floating
point.

Suggested by:	lidl
Submitted by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after:	2 weeks (with r300779)
2016-05-29 07:23:56 +00:00
Enji Cooper
c72088fd52 Delete duplicate declaration for i40e_blink_phy_link_led(..)
It was already declared on line 90

Differential Revision: https://reviews.freebsd.org/D6570
Reported by: gcc
Reviewed by: sbruno
Sponsored by: EMC / Isilon Storage Division
2016-05-29 01:52:05 +00:00
Allan Jude
b468a9ff1d Import the skein hashing algorithm, based on the threefish block cipher
Connect it to userland (libmd, libcrypt, sbin/md5) and kernel (crypto.ko)

Support for skein as a ZFS checksum algorithm was introduced in r289422
but is disconnected because FreeBSD lacked a Skein implementation.

A further commit will enable it in ZFS.

Reviewed by:	cem
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D6166
2016-05-29 01:15:36 +00:00
Bryan Drewery
fdd9048a63 Avoid more literal-suffix errors with C++11 2016-05-29 00:40:29 +00:00
Andriy Voskoboinyk
18d20be00f net80211: replace m_getcl/m_gethdr pair with m_get2 in ieee80211_fragment()
- Switch to m_get2() for mbuf allocation instead of manual mbuf size
determination.
- Reuse MIN() macro for mbuf size selection.
2016-05-28 19:13:39 +00:00
Andriy Voskoboinyk
8722deef15 net80211: fix use-after-free in frame defragmentation procedure.
- Assign frame sequence/fragment number before frame concatenation;
otherwise, frame header pointer (wh) will be invalid.
- Move this code block upper and eliminate duplicate 'lwh = mtod()'
assignment.

Tested with wpi(4) (transmitter) (STA mode) and urtwn(4) (receiver)
(HOSTAP mode).
2016-05-28 18:49:17 +00:00
Alan Somers
7a0c41d5d7 zfsd(8), the ZFS fault management daemon
Add zfsd, which deals with hard drive faults in ZFS pools. It manages
hotspares and replements in drive slots that publish physical paths.

cddl/usr.sbin/zfsd
	Add zfsd(8) and its unit tests

cddl/usr.sbin/Makefile
	Add zfsd to the build

lib/libdevdctl
	A C++ library that helps devd clients process events

lib/Makefile
share/mk/bsd.libnames.mk
share/mk/src.libnames.mk
	Add libdevdctl to the build. It's a private library, unusable by
	out-of-tree software.

etc/defaults/rc.conf
	By default, set zfsd_enable to NO

etc/mtree/BSD.include.dist
	Add a directory for libdevdctl's include files

etc/mtree/BSD.tests.dist
	Add a directory for zfsd's unit tests

etc/mtree/BSD.var.dist
	Add /var/db/zfsd/cases, where zfsd stores case files while it's shut
	down.

etc/rc.d/Makefile
etc/rc.d/zfsd
	Add zfsd's rc script

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
	Fix the resource.fs.zfs.statechange message. It had a number of
	problems:

	It was only being emitted on a transition to the HEALTHY state.
	That made it impossible for zfsd to take actions based on drives
	getting sicker.

	It compared the new state to vdev_prevstate, which is the state that
	the vdev had the last time it was opened.  That doesn't make sense,
	because a vdev can change state multiple times without being
	reopened.

	vdev_set_state contains logic that will change the device's new
	state based on various conditions.  However, the statechange event
	was being posted _before_ that logic took effect.  Now it's being
	posted after.

Submitted by:	gibbs, asomers, mav, allanjude
Reviewed by:	mav, delphij
Relnotes:	yes
Sponsored by:	Spectra Logic Corp, iX Systems
Differential Revision:	https://reviews.freebsd.org/D6564
2016-05-28 17:43:40 +00:00
Allan Jude
1780e40715 Implement SHA-512 truncated (224 and 256 bits)
This implements SHA-512/256, which generates a 256 bit hash by
calculating the SHA-512 then truncating the result. A different initial
value is used, making the result different from the first 256 bits of
the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on
64bit platforms, so the result is a faster 256 bit hash.

The main goal of this implementation is to enable support for this
faster hashing algorithm in ZFS. The feature was introduced into ZFS
in r289422, but is disconnected because SHA-512/256 support was missing.
A further commit will enable it in ZFS.

This is the follow on to r292782

Reviewed by:	cem
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D6061
2016-05-28 16:06:07 +00:00
Andrew Turner
7bc7e3cd65 Don't panic in hwpmc when stopping sampling.
When hwpmc stops sampling it will set the pm_state to something other
than PMC_STATE_RUNNING. This means the following sequence can happen:

CPU 0: Enter the interrupt handler
CPU 0: Set the thread TDP_CALLCHAIN pflag
CPU 1: Stop sampling
CPU 0: Call pmc_process_samples, sampling is stopped so clears ps_nsamples
CPU 0: Finishes interrupt processing with the TDP_CALLCHAIN flag set
CPU 0: Call pmc_capture_user_callchain to capture the user call chain
CPU 0: Find all the pmc sample are free so no call chains need to be captured
CPU 0: KASSERT because of this

This fixes the issue by checking if any of the samples have been stopped
and including this in te KASSERT.

PR:		204273
Reviewed by:	bz, gnn
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6581
2016-05-28 13:05:39 +00:00
Bjoern A. Zeeb
c169d9fe07 In if_attachdomain1() there does not seem to be any reason
to use TRYLOCK rather than just acquire the lock, so just do that.

Reviewed by:		markj
Obtained from:		projects/vnet
MFC after:		2 weeks
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6578
2016-05-28 08:32:15 +00:00
Adrian Chadd
38c4fdf4c6 [ath] add WB335 btcoex for initial testing.
This is like the WB222 coexistence (ie, "MCI", a message bus inside the
chip), and it's currently a cut/paste so I can start using it to flesh
out the differences with WB222.

It doesn't completely /do/ bluetooth coexistence, because it turns out
I need to add some contigmalloc'ed buffers to the btcoex path for this
type of hardware.  I'm putting this work in the "people would like
to see functioning-ish btcoex before FreeBSD-11" bucket because I see
this as "broken".

Tested:

* QCA9535 (WB335) NIC, BT + 2GHz STA
2016-05-28 02:14:24 +00:00
Navdeep Parhar
addd6a52c4 cxgbe/t4_tom: Exempt RDMA connections from a TCP sanity test for now, to
avoid panicking debug kernels.

t4_tom does not keep track of a connection once it switches to ULP mode
iWARP.  If the connection falls out of ULP mode the driver/hardware seq#
etc. are out of sync.  A better fix would be to figure out what the
current seq# are, update the driver's state, and perform all sanity
checks as usual.
2016-05-28 00:38:17 +00:00
Oleksandr Tymoshenko
12889df73f Add gpiokeys to the list of GPIO modules built only if FDT is enabled 2016-05-28 00:22:39 +00:00
Bryan Drewery
b7622235d0 Don't truncate existing error when writing the log.
Suggested by:	markj
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-05-27 23:58:00 +00:00
Bryan Drewery
33094a87c4 Rename function to be less generic.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-05-27 23:57:57 +00:00
Bryan Drewery
7ae27ff963 Write to the log using the tracer's credentials.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-05-27 23:57:53 +00:00
Bryan Drewery
f14fbe72ec exec: Cease tracing if credentials will change with the new image.
This also prevents tracing to a P_INEXEC process since it could race
with other processes attaching to it in filemon_event_process_exec() due
to the filemon_get_proc() race of incrementing ref and then locking the
filemon.  With the no-P_INEXEC invariant in place the p_filemon may only
be the same or NULL when trying to drop it in
filemon_event_process_exec().

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6545
2016-05-27 23:57:43 +00:00
John Baldwin
91970834ed Fix taskqueue groups to work with EARLY_AP_STARTUP.
In the EARLY_AP_STARTUP case the APs are already running when a taskqgroup
is created, so adjust the group at the same time it is created.

Sponsored by:	Netflix
2016-05-27 23:49:16 +00:00
Navdeep Parhar
fc511a3302 iw_cxgbe: Plug a lock leak in process_mpa_request().
If the parent is DEAD or connect_request_upcall() fails, the parent
mutex is left locked.  This leads to a hang when process_mpa_request()
is called again for another child of the listening endpoint.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Obtained from:	upstream iw_cxgb4
Sponsored by:	Chelsio Communications
2016-05-27 23:44:33 +00:00
Enji Cooper
dfdbdb0c82 Fix up r300870
The sys/types.h fix I proposed was only tested with zfs(4), not with
libzpool, which is where the build failure actually existed

Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both
unneeded

MFC after: 1 week
X-MFC with: r300865, r300870
In collaboration with: kib
Submitted by: alc
Sponsored by: EMC / Isilon Storage Division
2016-05-27 22:56:00 +00:00
Alan Somers
151746b244 Avoid issuing spa config updates for physical path when not necessary
ZFS's configuration needs to be updated whenever the physical path for a
device changes, but not when a new device is introduced. This is because new
devices necessarily cause config updates, but only if they are actually
accepted into the pool.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
	Split vdev_geom_set_physpath out of vdev_geom_attrchanged.  When
	setting the vdev's physical path, only request a config update if
	the physical path has changed.  Don't request it when opening a
	device for the first time, because the config sync will happen
	anyway upstack.

sys/geom/geom_dev.c
	Split g_dev_set_physpath and g_dev_set_media out of
	g_dev_attrchanged

Submitted by:	will, asomers
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D6428
2016-05-27 22:32:44 +00:00
Alan Somers
583febf416 Strip leading spaces off of a SCSI disk's serial number
sys/cam/scsi/scsi_xpt.c
	Strip leading spaces off of a SCSI disk's reported serial number
	when populating the CAM serial number. This affects the output of
	"diskinfo -v" and the names of /dev/diskid/DISK-* device nodes,
	among other things.

	SPC5r05 says that the Product Serial Number field from the Unit
	Serial Number VPD page is right-aligned. So any leading spaces are
	not part of the actual serial number. Most devices don't left-pad
	their serial numbers, but some do. In particular, the SN VPD page
	that an LSI HBA emulates for a SATA drive contains enough
	left-padding to fill a 20-byte field.

UPDATING
	Add a note to UPDATING, because some users may have to update
	/etc/fstab or geom labels.

Reviewed by:	ken, mav
MFC after:	Never
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D6516
2016-05-27 22:26:43 +00:00
Jung-uk Kim
3920312eeb Merge ACPICA 20160527.
Relnotes:	yes
2016-05-27 22:16:46 +00:00
Ian Lepore
ad5a172c99 Fix erronious mixed use of tx/rx variables/constants in the same expression.
Pointed out by jmcneill; other instances found by grep -iE 'rx.*tx|tx.*rx'
2016-05-27 22:14:39 +00:00
Navdeep Parhar
69b913d68f iw_cxgbe: Use vmem(9) to manage PBL and RQT allocations.
Submitted by:	Krishnamraju Eraparaju at Chelsio
Reviewed by:	Steve Wise
Sponsored by:	Chelsio Communications
2016-05-27 21:26:26 +00:00
Ian Lepore
1e45d04b7b Go back to unconditionally compiling modules/gpio now that the parts of it
dependent on FDT support are conditionally compiled only on FDT platforms.
2016-05-27 20:43:46 +00:00