Commit Graph

232120 Commits

Author SHA1 Message Date
Andrew Gallatin
f759470750 Fix iflib_encap() EFBIG handling bugs
1) Don't give up if m_collapse() fails.  Rather than giving up, try
m_defrag() immediately.

2) Fix a leak where, if the NIC driver rejected the defrag'ed chain
as having too many segments, we would fail to free the chain.

Reviewed by:  Matthew Macy <mmacy@mattmacy.io> (this version of patch)
Submitted by: Matthew Macy <mmacy@mattmacy.io> (early version of leak fix)
2018-04-30 23:53:27 +00:00
Alexander Motin
e134ecdcfc Improve nvme(4) attach/detach sequences.
This change allows clean device detach on attach failures and driver unload,
while previous code tried to talk to already shut down controller, or even
accessed resources failed to allocate.

Sponsored by:	iXsystems, Inc.
2018-04-30 23:05:57 +00:00
Navdeep Parhar
111638bf68 cxgbe(4): Convert ACT_OPEN_RPL to a shared CPL.
Reserve 3b in the 14b atid to identify the owner and use it to dispatch
the CPL.  This allows all CPLs that use an atid to be used as shared
CPLs, although ACT_OPEN_RPL is the only one being converted in this
revision.

Sponsored by:	Chelsio Communications
2018-04-30 21:47:30 +00:00
Alexander Motin
c6c70c0746 Fix use-after-free in nvme_qpair_destroy().
dma_tag_payload should not be destroyed before payload_dma_map, and seems
it should be used there instead of dma_tag to match creation.

Sponsored by:	iXsystems, Inc.
2018-04-30 21:28:10 +00:00
Konstantin Belousov
986c4ca387 Turn off IBRS on suspend.
Resume starts CPU from the init state, which clears any loaded
microcode updates.  As result, IBRS MSRs are no longer available,
until the microcode is reloaded.

I have to forcibly clear cpu_stdext_feature3, which assumes that CPUID
leaf 7 reg %ebx does not report anything except Meltdown/Spectre bugs
bits.  If future CPUs add new bits there, hw_ibrs_recalculate() and
identify_cpu1()/identify_cpu2() need to be adjusted for that.

Submitted and tested by:	Michael Danilov <mike.d.ft402@gmail.com>
PR:	227866
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15236
2018-04-30 20:18:32 +00:00
Nathan Whitehorn
47280ef170 Fix null pointer dereference on nodes without a "compatible" property.
MFC after:	1 week
2018-04-30 19:37:32 +00:00
Alexander Motin
e4c7e3a1b9 Set si_drv1 for nvmeXnsY in a new race-free way.
r332897 switched to new KPI, but havent used its main benefit.

Sponsored by:	iXsystems, Inc.
2018-04-30 19:21:20 +00:00
Kyle Evans
a3f2c2feb1 seq(1): Provide some long options
These match GNU seq(1) names where applicable for compatibility purposes.

MFC after:	1 month
2018-04-30 18:55:01 +00:00
Navdeep Parhar
f8bc08fa57 cxgbe/t4_tom: Use appropriate macros instead of magic math while
constructing the atid of an active open work request.

Sponsored by:	Chelsio Communications
2018-04-30 17:33:44 +00:00
Ed Maste
2216c6933c Disable connectat/bindat with AT_FDCWD in capmode
Previously it was possible to connect a socket (which had the
CAP_CONNECT right) by calling "connectat(AT_FDCWD, ...)" even in
capabilties mode.  This combination should be treated the same as a call
to connect (i.e. forbidden in capabilities mode).  Similarly for bindat.

Disable connectat/bindat with AT_FDCWD in capabilities mode, fix up the
documentation and add tests.

PR:		222632
Submitted by:	Jan Kokemüller <jan.kokemueller@gmail.com>
Reviewed by:	Domagoj Stolfa
MFC after:	1 week
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D15221
2018-04-30 17:31:06 +00:00
Ed Maste
e2811155f1 Clarify bindat/connectat use with AT_FDCWD
Discovered during investigation into the PR - the description of
AT_FDCWD was somewhat confusing.

PR:		222632
Submitted by:	Jan Kokemüller <jan.kokemueller@gmail.com>
MFC after:	1 week
2018-04-30 17:16:17 +00:00
Slava Shwartsman
37e576b25e libibumad/umad.c: In get_port, ignore sysctl get rate errors
This can cause ibpanic in ibstat when width is not set properly
as can occur when Ethernet port is connected to InfiniBand fabric.

ibpanic: [8167] main: stat of IB device 'mlx5_0' failed: m

With this change, Rate is displayed as 0 with ibstat for
this scenario.

MFC after:      3 days
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies
2018-04-30 15:23:45 +00:00
Navdeep Parhar
4535e8046f cxgbe(4): Use opaque cookies or tid range-checks to determine the
intended recipient of a CPL when it can't be determined solely from the
opcode.  Retire the per-queue handlers for such CPLs in favor of the new
scheme.

Sponsored by:	Chelsio Communications
2018-04-30 15:18:38 +00:00
Vladimir Kondratyev
44af5666d9 bthidd(8): Add evdev protocol support for bluetooth keyboards and mouses
User-visible changes:

"-u" is added to to list of command line options supported by bthidd.
Use it to enable evdev support. uinput and evdev modules should be
kld-loaded or compiled into the kernel in that case.

bthidd_evdev_support rc.conf variable is added to control enabling of
evdev support in bthidd startup script. Possible values are: "YES", "NO",
"AUTO"(default). Setting bthidd_evdev_support to "AUTO" inserts "-u" option
if kernel is compiled with EVDEV_SUPPORT option enabled.

Support for consumer HID usage page keyboard events is implemented. Most of
them are available only through evdev protocol.

kern.evdev.rcpt_mask sysctl is checked, so "sysctl kern.evdev.rcpt_mask=12"
should be executed if EVDEV_SUPPORT is compiled into kernel.

It is recommended to regenerate bthidd.conf entries with bthidcontrol(8)
"Query" command to set user-friendly names of bluetooth devices.

Reviewed by:	emax, gonzo, wblock (docs), bcr (docs, early version)
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 12:16:54 +00:00
Vladimir Kondratyev
e650806966 bthidd(8): Add internal support for user-friendly name of remote devices.
Extend bthidd.conf format to store name of remote Bluetooth HID devices and
implement querying of this information with bthidcontrol(8) "Query" command.

Reviewed by:		emax
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:49:29 +00:00
Vladimir Kondratyev
4b58fa1240 uinput: Add FreeBSD specific ioctl to set unique identifier of input device.
Reviewed by:	gonzo
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:34:16 +00:00
Vladimir Kondratyev
3ee5c55415 bluetooth(3): Add helper functions that performs Bluetooth Remote Name Request
procedure to obtain the user-friendly name of another Bluetooth unit.

Reviewed by:	emax, wblock (docs)
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:24:50 +00:00
Vladimir Kondratyev
515bb54c9f libsdp: Add method that returns actual source BD_ADDR of SDP session.
Reviewed by:	emax, wblock (docs)
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:15:58 +00:00
Hans Petter Selasky
45aca3b1a1 Define USEC_PER_MSEC and USEC_PER_SEC in the LinuxKPI.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-04-30 09:31:09 +00:00
Hans Petter Selasky
dd7ea6c21a Improve fix in r304629 by allowing configuration of the behaviour
through a SYSCTL instead of a compile time define.

Add quirk by default for all LynxPoint XHCI controllers.

PR:		227602
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2018-04-30 07:30:37 +00:00
Ram Kishore Vegesna
15f5662d70 Included opt_stack.h in Makefile, to fix module build.
PR: 227823
Reported by: eugen
Approved by: mav
MFC after: 3 days
2018-04-30 07:24:31 +00:00
Xin LI
3e855e9c21 Don't bail out from the check if readboot() returns !FSFATAL.
This can happen when the fsinfo signature is invalid, and the
user have choose to fix it, in which case the code would return
FSBOOTMOD (not FSOK but not FSFATAL either).

All other (fatal) cases would return FSFATAL.

Obtained from:	Android Open Source Project
Obtained from:	d8775a29ea
MFC after:	2 weeks
2018-04-30 05:57:55 +00:00
Rebecca Cran
7113af0f51 Add back the historical information about being mentored by rrs
Reviewed by:	imp, eadler
Differential Revision:	https://reviews.freebsd.org/D15230
2018-04-30 04:02:48 +00:00
Ed Maste
361558a60f if_smsc: set MII BUSY bit to read/write PHY regs
Per the datasheet, the BUSY bit must be set when reading or writing PHY
registers.  From Linux commit 80928805babf.

Submitted by:	Arshan Khanifar
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15217
2018-04-30 02:18:19 +00:00
Ed Maste
8c9b26c3c4 if_smsc: fix reset check
In smsc_phy_init function, when the driver was trying to reset PHY, it
didn't poll for the correct bit (BMCR_RESET) to be cleared.  Instead, it
anded it with MII_BMCR (which is 0), so it just exited the loop.

This issue was fixed in Linux in commit d94609200069.

Submitted by:	Arshan Khanifar
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-04-30 01:58:24 +00:00
Jilles Tjoelker
4d7f36eea5 sh: Don't have [ match any [[:class:]]
Submitted by:	Robert Elz
MFC after:	3 days
2018-04-29 17:46:08 +00:00
Konstantin Belousov
a7163bb962 Eliminate some vm object relocks in vm fault.
For the vm_fault_prefault() call from vm_fault_soft_fast(), extend the
scope of the object rlock to avoid re-taking it inside
vm_fault_prefault(). It causes pmap_enter_quick() sometimes called
with shadow object lock as well as the page lock, but this looks
innocent.

Noted and measured by:	mjg
Reviewed by:	alc, markj (as part of the larger patch)
Tested by:	pho (as part of the larger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D15122
2018-04-29 12:43:08 +00:00
Edward Tomasz Napierala
41adbaa596 Clean up the EXAMPLES section of usbconfig(8). This removes parts that
become redundant after documenting all the subcommands, and switches
to the new syntax, without the '-d'.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-29 10:45:09 +00:00
Conrad Meyer
538184fa2f amd64/mp_machdep.c: Fix GCC build after r333059
GCC warns about the potentially confusing use of the binary AND ('&')
operator with a left operand containing an addition expression.  (The
confusion would be around the operator precedence between the + and & infix
operators.)  The warning is converted into an error with -Werror.

No functional change.

This construct was actually introduced in r328083, but r333059 (re)moved the
closing parentheses.

For reference, see http://en.cppreference.com/w/c/language/operator_precedence .
2018-04-28 17:55:28 +00:00
Conrad Meyer
e0de38620c smartpqi(4): Use conventional path to driver sources 2018-04-28 17:43:51 +00:00
Conrad Meyer
9cf21c2ee1 smartpqi(4): Unbreak GCC build
Remove redundant declarations.
2018-04-28 17:43:20 +00:00
Kristof Provost
c5e105655b pfctl: Don't break connections on skipped interfaces on reload
On reload we used to first flush everything, including the list of skipped
interfaces.  This can lead to termination of these connections if they send
packets before the new configuration is applied.

Note that this doesn't currently happen on 12 or 11, because of special EACCES
handling introduced in r315514. This special behaviour in tcp_output() may
change, hence the fix in pfctl.

PR:		214613
2018-04-28 13:16:58 +00:00
Edward Tomasz Napierala
e2a08f166a Add EXAMPLES to tip(1) man page.
MFC after:	2 weeks
2018-04-28 12:24:05 +00:00
Eitan Adler
4822188974 zpool(8): correct list of default properties in 'list'.
The default provides output in the following form:
```
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP
HEALTH  ALTROOT
```

this corrects the man page.

Also submitted upstream as
https://github.com/openzfs/openzfs/pull/632/files (with slightly
different changes needed)
2018-04-28 01:14:16 +00:00
Warner Losh
ad7d33c45b No need to make objects here. 2018-04-27 22:15:18 +00:00
John Baldwin
983c0fd434 Use %p to print uintptr_t values rather than %z in MIPS single-step code. 2018-04-27 21:22:32 +00:00
Emmanuel Vadot
f1012f03d1 arm: dts: overlays: Remove the overlay module
Move the DTSO variables in the main SoC dtb file

Discussed with:		ian
2018-04-27 21:15:51 +00:00
Emmanuel Vadot
7f7d3ba77c arm: Fix duplicate ehci DRIVER_MODULE
Name each ehci driver uniquely.
This remove the warning printed at each arm boot :
module_register: cannot register simplebus/ehci from kernel; already loaded from kernel
2018-04-27 21:05:58 +00:00
Emmanuel Vadot
fe7cc38a38 arm: Fix duplicate ahci DRIVER_MODULE
Name each ahci driver uniquely.
This remove the warning printed at each arm boot :
module_register: cannot register simplebus/ahci from kernel; already loaded from kernel
2018-04-27 21:05:18 +00:00
Ed Maste
796c03e9e4 Retire UPDATING entries prior to the stable/10 branch
We do not support building from FreeBSD 9.x releases.

Approved by:	imp
Sponsored by:	The FreeBSD Foundation
2018-04-27 20:20:57 +00:00
Ed Maste
754a9d6c59 Bump min supported release for building HEAD to 10.3
r307825 and r333017 disallow building FreeBSD-HEAD from 9.x or 10.x
versions that have some clang issues.  The minimum supported Subversion
revisions and osreldates containing the fix are:

Version  Min Rev  osreldate
    9.x  r286035     903509
   10.x  r286033    1002501

9.3 is the final 9.x release and does not contain the r286035 fix.
10.3 is the first 10.x release with the fix.  Thus, in practice 10.3 is
the oldest release that can build HEAD.

Although it may still be possible to build HEAD from an up-to-date
stable/9 it's not worth maintaining the special case when the branch
itself is unsupported and there are no usable releases from that branch.

Old UPDATING entries can be removed and the Clang warning in UPDATING
may be updated, in a future commit.

Approved by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15209
2018-04-27 19:50:30 +00:00
John Baldwin
4217c685b1 Use the correct key address when renegotiating the transmit key.
Previously, get_keyid() was returning the address of the receive key
instead of the transmit key when renegotiating the transmit key.  This
could either hang the card (if a connection was only offloading TLS TX
and thus had a receive key address of -1) or cause the connection to
fail by overwriting the wrong key (if both RX and TX TLS were
offloaded).

Submitted by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-04-27 17:20:23 +00:00
Konstantin Belousov
1187fc2dc6 Remove redundant pipe from pdeathsig.c test.
A pipe was was left over from a development version of pdeathsig.c and
is not needed.

Process C waits for a signal that'll be generated when process B
exists. Process B waits for process D to send it a byte via pipe_db
before it exits. Process D sends the byte after it has started
ptrace()ing process C. The point of the test is to show that process C
receives the signal because process B exited, even though C has been
reparented to process D. The pipe pipe_cd isn't doing anything useful
(though in an earlier version of the patch it did). Clean that up by
removing the useless pipe.

Submitted by:	Thomas Munro
MFC after:	6 days
Differential revision:	https://reviews.freebsd.org/D15214
2018-04-27 16:34:28 +00:00
Mateusz Guzik
d552176e4b Unbreak world build after r333064
Reported by:	O. Hartmann <ohartmann walstatt.org>
2018-04-27 15:50:22 +00:00
Ed Maste
b79f74cc64 setfacl: style and break main() into manageable pieces
Submitted by:	Mitchell Horne
MFC with:	r332396
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15060
2018-04-27 15:25:24 +00:00
Mateusz Guzik
9d68f7741f systrace: track it like sdt probes
While here predict false.

Note the code is wrong (regardless of this change). Dereference of the
pointer can race with module unload. A fix would set the probe to a
nop stub instead of NULL.
2018-04-27 15:16:34 +00:00
Ed Maste
715d1396d6 Update ELF Tool Chain to r3614
MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-04-27 13:59:24 +00:00
Ed Maste
b40b8572d7 elf_common.h: add DT_SUNW_ASLR tag
For upcoming ELF Tool Chain import (readelf).
2018-04-27 13:55:46 +00:00
Tycho Nightingale
27275f8a52 Expand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be
excluded from PTI.

Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D15100
2018-04-27 12:44:20 +00:00
Ed Maste
87ec209e33 Import ELF Tool Chain snapshot at r3614
From http://svn.code.sf.net/p/elftoolchain/code/
2018-04-27 12:02:11 +00:00