104577 Commits

Author SHA1 Message Date
hiren
6d45a159b0 MFC r301522 (by bz)
Implement a `show panic` command to DDB which will helpfully print the
panic string again if set, in case it scrolled out of the active
window.  This avoids having to remember the symbol name.

Also add a show callout <addr> command to DDB in order to inspect
some struct callout fields in case of panics in the callout code.
This may help to see if there was memory corruption or to further
ease debugging problems.

No objection by:    bz
2016-09-16 00:14:26 +00:00
hselasky
0042789fce MFC r305590:
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR:		170358
2016-09-15 08:35:46 +00:00
kib
8628e8e910 MFC r305744:
Fix typo in comment.
2016-09-15 08:26:59 +00:00
kib
6a85dd3622 MFC r305129:
Make swapoff reliable.
2016-09-14 10:51:06 +00:00
mav
2932b17b57 MFC r305123: Fix kernel panic when inheriting properties without default.
There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.
2016-09-14 09:13:17 +00:00
mav
b536ad3bd8 MFC r305536: Fix channel initialization in FBS mode.
Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
MFC r305536: Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).
2016-09-14 09:11:03 +00:00
mav
693cfd5203 MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().
Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.
2016-09-13 09:25:38 +00:00
hselasky
9a6fa1e8fe MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by:	avos@
2016-09-12 10:17:25 +00:00
sephe
5588186dae MFC 305177
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

    Reviewed by:    araujo, hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7710
2016-09-12 08:32:06 +00:00
jhb
2c4c5ee1df MFC 303720: Apply the fix from r232612 to fixed function counters. 2016-09-09 21:19:31 +00:00
jhb
7380cda6f5 MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
PR:		208168
2016-09-09 20:30:36 +00:00
jhb
a40f879158 MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
Move msix_disable_migration under #ifdef SMP since it doesn't make sense
for !SMP kernels.

PR:		212014
2016-09-09 19:57:32 +00:00
hselasky
2442d6725d MFC r304571:
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.
2016-09-09 06:38:13 +00:00
pfg
1061080342 MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.
2016-09-08 15:06:28 +00:00
hselasky
9a13035421 MFC r281499:
Modify the return value of the uhci/ehci/xhci PCI probe routines to
'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership
of the device and pass it through to the guest.

In the common case where there are no competing drivers for USB controllers
this change is a no-op.

PR:		212256
2016-09-08 09:50:03 +00:00
dim
be91514db3 MFC r305389:
With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D7777
2016-09-07 19:25:08 +00:00
dim
83216cdbb7 MFC r305388:
With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by:	imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776
2016-09-07 19:21:52 +00:00
dim
5af3f0b5e8 MFC r305360:
With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by:	np
Differential Revision: https://reviews.freebsd.org/D7772
2016-09-07 19:17:03 +00:00
dim
2df99ac12a MFC r305345:
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
	if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
		     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
		if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
		    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
					nACK | SELECT | PERROR | nBUSY)) {
					~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D7771
2016-09-07 19:02:47 +00:00
dim
5fce709aa8 MFC r305344:
Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D7770
2016-09-07 18:53:46 +00:00
emaste
5c6abe41ac Regen after r305518: Allow getdtablesize in capability mode 2016-09-07 04:07:43 +00:00
emaste
33cdd4c4c4 MFC r305140: Allow getdtablesize in capability mode 2016-09-07 04:06:25 +00:00
pfg
3fae70ce81 MFC r303799, r303800:
ext2fs:	Add defines for some missing ext4 features and inode flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from:	NetBSD
2016-09-06 19:53:05 +00:00
davidcs
cf073edeab MFC 304249
Add support for set/get cam search mode
2016-09-06 19:29:14 +00:00
davidcs
855215474e MFC r394247
Upgrade fw, bootloader and minidump template to version 5.4.58
    Add minidump retrieval code

MFC r394248
    Add ql_minidump.h
2016-09-06 19:27:00 +00:00
avg
0ecb086e4a MFC r304674: intpm: add support for SB800 2016-09-06 06:25:10 +00:00
avg
f531fd05da MFC r303738: report sector size and number of sectors in lsdev output
for bios disks
2016-09-06 06:13:47 +00:00
ngie
a9bcfb0220 MFC r286321:
r286321 (by lwhsu):

Fix `make depend` in sys/modules
2016-09-02 04:23:26 +00:00
ngie
3d3e8a124c MFstable/11 r305271:
MFC r303576:

Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

Tested with:	clang 3.8.1, gcc 4.2.1, gcc 5.3.0
2016-09-02 04:21:40 +00:00
markj
a80af232a4 MFC r285522:
Fix cleanup race between unp_dispose and unp_gc.

This change modifies the original commit to avoid changing the
domain_dispose KPI.

Tested by:	Oliver Pinter
2016-09-02 00:14:28 +00:00
sephe
2affb9c948 MFC 304202
tcp/lro: Make # of LRO entries tunable

    Reviewed by:    hps, gallatin
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7499
2016-09-01 08:01:13 +00:00
kib
3f022705af MFC r304812:
In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible
error from sleep.
2016-09-01 07:21:42 +00:00
kib
b69eb90edd MFC r304808:
Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.

PR:	211947
2016-09-01 07:20:50 +00:00
markj
f5388b59e2 MFC 303855:
Handle races with listening socket close when connecting a unix socket.

PR:	211531
2016-08-31 21:35:51 +00:00
dim
fc932588a6 MFC r304953:
Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by:	cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by:	The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to:	dim
2016-08-31 18:00:41 +00:00
badger
d8feb13e02 MFC r304184:
sem_post(): wake up the sleeper only after adjusting has_waiters

If the caller of sem_post() wakes up a thread sleeping via sem_wait()
before it clears the has_waiters flag, the caller of sem_wait() has no way of
knowing when it is safe to destroy the semaphore and reuse the memory. This is
because the caller of sem_post() may be interrupted between the wake step and
the clearing of has_waiters. It will then write into the has_waiters flag in
userspace after being preempted for some unknown amount of time.

Approved by:	vangyzen (mentor)
Sponsored by:	Dell Inc.
2016-08-30 13:39:42 +00:00
hselasky
0e4018e22d MFC r304629:
Don't separate the status stage of the XHCI USB control transfers into
its own job because this breaks the simplified QEMU XHCI TRB parser,
which expects the complete USB control transfer as a series of back to
back TRBs. The old behaviour is kept under #ifdef in case this change
breaks enumeration of any USB devices.

PR:		212021
2016-08-29 08:51:27 +00:00
hselasky
96d0380d04 MFC r304601:
Increase the maximum RX/TX queue size. This allows for a RX/TX queue
size of 16384 mbufs. Previously the limit was 8192.

Sponsored by:	Mellanox Technologies
2016-08-29 08:49:38 +00:00
hselasky
3fd67a157f MFC r304597:
Fix for invalid use of bits in input context. Basically split
configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
xhci_cmd_configure_ep() respectivly. This resolves some errors when
using XHCI under QEMU and gets is more in line with the XHCI
specification.

PR:		212021
2016-08-29 08:42:37 +00:00
alc
a9e26c2eb3 MFC r303982
Correct errors and clean up the comments on the active queue scan.

  Eliminate some unnecessary blank lines.
2016-08-28 05:07:13 +00:00
kib
2a3105a7da MFC r303426:
Rewrite subr_sleepqueue.c use of callouts to not depend on the
specifics of callout KPI.
2016-08-27 11:45:05 +00:00
kib
f633fa427a MFC r303425:
Add callout_when(9).

MFC r303919:
Fix indentation.
2016-08-27 11:38:37 +00:00
kib
d8372db7e0 MFC r264388 (by davide):
Define SBT_MAX.

MFC r267896 (by davide):
Improve r264388.

MFC note.  The SBT_MAX definition already existed on stable/10, but without
the refinement from r267896.  Also, consumers of SBT_MAX were not converted,
since r264388 was not merged properly.

Reviewed by:	mav
2016-08-27 10:56:04 +00:00
ache
d0cf3e46be Bump __FreeBSD_version after LC_*_MASK fix 2016-08-26 21:26:33 +00:00
hselasky
362ce96b2d MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by:	Alex Bowden <alex.bowden@outlook.com>
Sponsored by:	Mellanox Technologies
2016-08-26 12:06:43 +00:00
sephe
ed356f765b MFC 303766
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
2016-08-26 06:19:12 +00:00
kib
c29dc2b429 MFC r304286:
Remove duplicated code.
2016-08-24 09:20:27 +00:00
mav
b8dd3c9356 Fix HA mode configuration on FreeBSD 10.x.
This is direct commit, compensating CTLFLAG_RDTUN difference between
FreeBSD 10.x and 11.x branches.
2016-08-24 07:50:28 +00:00
arybchik
8b080b5d18 MFC r301724
sfxge(4): handle negative ticks difference correctly

ticks are signed int and if statistics is not updated for a long time
(more than INT_MAX ticks, but less than UINT_MAX) difference becomes
negative and less than hz for a long time.

Other option to repeat is simply load driver (which initializes
timestamps to 0) when ticks are negative.

Sponsored by:   Solarflare Communications, Inc.
2016-08-23 13:51:55 +00:00
kib
69c00374f5 MFC r304232:
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.
2016-08-23 07:55:32 +00:00