]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAllow PCI VGA devices to be detached.
Peter Grehan [Thu, 3 May 2018 22:51:44 +0000 (22:51 +0000)]
Allow PCI VGA devices to be detached.

GPUs often have a VGA PCI class code and are probed/attached
by the VGA driver. Allow them to be detached so they can
be presented as passthru devices to VM guests.

Submitted by: mmacy
Reviewed by: jhb, imp, rgrimes
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15269

6 years agoAdd helper macros to hide some boring repeatable ceremonies to define
Konstantin Belousov [Thu, 3 May 2018 21:45:59 +0000 (21:45 +0000)]
Add helper macros to hide some boring repeatable ceremonies to define
ifuncs on x86.

Also keep helpers to define 'pseudo-ifuncs' which are emulated by the
indirect jmp.

Reviewed by: jhb (previous version, as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D13838

6 years agoImplement support for ifuncs in the kernel linker.
Konstantin Belousov [Thu, 3 May 2018 21:37:46 +0000 (21:37 +0000)]
Implement support for ifuncs in the kernel linker.

Required MD bits are only provided for x86.

Reviewed by: jhb (previous version, as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D13838

6 years agoGarbage collect the a83t emac overlays
Kyle Evans [Thu, 3 May 2018 19:49:40 +0000 (19:49 +0000)]
Garbage collect the a83t emac overlays

The 4.16 DTS import brought in emac support for the a83t. Since these
boards' DTS is pulled from /boot and I forgot to hook these up to the build,
they should be fairly safe to go away.

The a83t-sid and h3-sid overlays are still relevant. a83t-sid will likely
come in with 4.18 DTS.

6 years agodtb/allwinner: Add a83t-sid overlay
Kyle Evans [Thu, 3 May 2018 19:45:48 +0000 (19:45 +0000)]
dtb/allwinner: Add a83t-sid overlay

6 years agoRedo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce.
Jung-uk Kim [Thu, 3 May 2018 19:00:50 +0000 (19:00 +0000)]
Redo r332918 with the ACPICA API and remove debug.acpi.suspend_deep_bounce.

AcpiOsEnterSleep() was meant to implement this feature.

Reviewed by: avg

6 years agorsu(4) does not require legal.realtek.license_ack=1
Kyle Evans [Thu, 3 May 2018 18:20:35 +0000 (18:20 +0000)]
rsu(4) does not require legal.realtek.license_ack=1

The rsu firmware license check has been disabled since r292756. Changes
rsu(4) since the license ack is no longer required.

While here, add `device rsufw` hint to the kernel configuration lines and
add/update paths to the installed license file in both rsu(4) and rsufw(4).

Submitted by: Mateusz Piotrowski (0mp)
Reviewed by: bcr (manpages)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D14966

6 years agoAdd a stub manual page for iflib(9).
Benno Rice [Thu, 3 May 2018 17:52:40 +0000 (17:52 +0000)]
Add a stub manual page for iflib(9).

Currently 'man -k iflib' would find you the right pages for iflib
documentation, namely iflibdd(9) and iflibdi(9) but 'man iflib' would leave
you in the dark. This allows both approaches to find the relevant
documentation.

Reviewed by: kmacy, shurd
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D15219

6 years agoDocument ifdi_tx_queues_alloc and ifdi_rx_queues_alloc.
Benno Rice [Thu, 3 May 2018 17:49:26 +0000 (17:49 +0000)]
Document ifdi_tx_queues_alloc and ifdi_rx_queues_alloc.

Prior to this change the manual page documented ifdi_queues_alloc which has
been replaced by separate methods for tx and rx queues.

Reviewed by: kmacy, shurd
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D15218

6 years agoAllow iflib NIC drivers to sleep rather than busy wait
Stephen Hurd [Thu, 3 May 2018 17:02:31 +0000 (17:02 +0000)]
Allow iflib NIC drivers to sleep rather than busy wait

Since the move to SMP NIC driver locking has had to go through serious
contortions using mtx around long running hardware operations. This moves
iflib past that.

Individual drivers may now sleep when appropriate.

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: shurd
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14983

6 years agoamdsbwd: add suspend and resume methods
Andriy Gapon [Thu, 3 May 2018 15:33:18 +0000 (15:33 +0000)]
amdsbwd: add suspend and resume methods

Without the suspend method the watchdog may fire in S1 state.  Without
the resume method the watchdog is not re-enabled after returning from S3
state.  I observe this on one of my systems.

Not sure if watchdog(4) should participate in the suspend actions.
Right now everything is up to individual drivers.

MFC after: 2 weeks

6 years agocc_cubic:
Sean Bruno [Thu, 3 May 2018 15:01:27 +0000 (15:01 +0000)]
cc_cubic:
- Update cubic parameters to draft-ietf-tcpm-cubic-04

Submitted by: Matt Macy <mmacy@mattmacy.io>
Reviewed by: lstewart
Differential Revision: https://reviews.freebsd.org/D10556

6 years agonxge(4) deprecation notice
Sean Bruno [Thu, 3 May 2018 14:48:42 +0000 (14:48 +0000)]
nxge(4) deprecation notice

Submitted by: kbowling
Reviewed by: brooks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15277

6 years agohpet: use macros instead of magic values for the timer mode
Andriy Gapon [Thu, 3 May 2018 13:14:31 +0000 (13:14 +0000)]
hpet: use macros instead of magic values for the timer mode

MFC after: 1 week

6 years agoStyle.
Konstantin Belousov [Thu, 3 May 2018 10:17:37 +0000 (10:17 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D13838

6 years ago- Add us.iso Macbook/Macbook Pro keyboard support
Ruey-Cherng Yu [Thu, 3 May 2018 06:52:47 +0000 (06:52 +0000)]
- Add us.iso Macbook/Macbook Pro keyboard support

Approved by: delphij
Differential Revision: https://reviews.freebsd.org/D14504

6 years agozgrep(1): Note that -r/-R are not currently supported.
Kyle Evans [Thu, 3 May 2018 02:56:13 +0000 (02:56 +0000)]
zgrep(1): Note that -r/-R are not currently supported.

This is better behavior than just silently doing the wrong thing. We do not
currently have plans to support -r/-R with the compression-enabled greps.

Reported by: jilles

6 years agofcntl(2): Vaguely document that ENOTTY is possible, with light examples
Kyle Evans [Thu, 3 May 2018 02:42:13 +0000 (02:42 +0000)]
fcntl(2): Vaguely document that ENOTTY is possible, with light examples

Reported by: vs (2006, FreeBSD 6.1-BETA3)
Reported by: me (2018, angry debugging session)
MFC after: 1 month

6 years agoAdd Marvell ArmadaXP and Armada38X to GENERIC config
Marcin Wojtas [Thu, 3 May 2018 01:23:42 +0000 (01:23 +0000)]
Add Marvell ArmadaXP and Armada38X to GENERIC config

Include source files and drivers for Marvell ArmadaXP and Armada38X
in GENERIC kernel config.

Submitted by: Michal Mazur <mkm@semihalf.com>
              Rafal Kozik <rk@semihalf.com>
Reviewed by: manu
Tested by: manu
Obtained from: Semihalf
Sponsored by: Stormshield

6 years agoFix SoC identification issue on Marvell platforms
Marcin Wojtas [Thu, 3 May 2018 01:10:41 +0000 (01:10 +0000)]
Fix SoC identification issue on Marvell platforms

Marvell SoC identification function was called by SYSINIT on all armv7
platforms, which brakes platforms other than Marvell built with
GENERIC config. Fix this by shifting SoC identifying to Marvell platform
initialization.

Submitted by: Patryk Duda <pdk@semihalf.com>
Reviewed by: manu
Tested by: manu
Obtained from: Semihalf
Sponsored by: Stormshield

6 years ago[etc] Update newsyslog.conf default comment
Eitan Adler [Thu, 3 May 2018 00:57:19 +0000 (00:57 +0000)]
[etc] Update newsyslog.conf default comment

Remove line about allowed flags. It was missing 'pRTY' and is duplicative
of the man page. It didn't describe the flags in any detail to help
remind users of how to configure newsylog.

6 years agoBuild lld as long as we have a C++11 host compiler
Ed Maste [Wed, 2 May 2018 23:43:33 +0000 (23:43 +0000)]
Build lld as long as we have a C++11 host compiler

As with Clang, build our toolchain components by default when the host
compiler is capable of doing so, to make them available for testing and
experimentation.

Sponsored by: The FreeBSD Foundation

6 years agoSend an ICMPv6 PacketTooBig message in case of forwading a packet which
Michael Tuexen [Wed, 2 May 2018 22:11:16 +0000 (22:11 +0000)]
Send an ICMPv6 PacketTooBig message in case of forwading a packet which
is too big for the outgoing interface and no firewall is involed.
This problem was introduced in
https://svnweb.freebsd.org/changeset/base/324996
Thanks to Irene Ruengeler for finding the bug and testing the fix.

Reviewed by: kp@
MFC after: 3 days

6 years agoFollow up to r333173, Retire ixgb(4)
Sean Bruno [Wed, 2 May 2018 21:32:20 +0000 (21:32 +0000)]
Follow up to r333173, Retire ixgb(4)

Remove sys/modules/ixgb and add the linked man page for if_ixgb via
ObsoleteFiles.

Submitted by: kbowling
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15273

6 years agoRevert r333183, since I am not sure that just initializing the
Rick Macklem [Wed, 2 May 2018 21:29:42 +0000 (21:29 +0000)]
Revert r333183, since I am not sure that just initializing the
list is the correct thing to do and that is already done without
this commit.

6 years agoAdd two missing LIST_INIT()s.
Rick Macklem [Wed, 2 May 2018 20:36:11 +0000 (20:36 +0000)]
Add two missing LIST_INIT()s.

This patch adds two missing LIST_INIT()s. Found by inspection.
In practice, these are currently no-ops, since the structure they are
in is malloc'd with M_ZERO and all LIST_INIT does is set the pointer
in the list head to NULL. (In other words, the M_ZERO has already
correctly initialized it.)

MFC after: 2 months

6 years agomlx5en: Always allow VLAN id 0.
Konstantin Belousov [Wed, 2 May 2018 20:22:03 +0000 (20:22 +0000)]
mlx5en: Always allow VLAN id 0.

According to the 802.1Q-2014 9.6 VLAN Tag Control Information, VID value 0
means that there is no VLAN tag assigned to the packet, and only PCP and
DEI values from the tag are meaningful.  Current flow table programming
filter out such packets.

When programming VLAN filter for flow table, unconditionally add rule which
accept packets with VLAN id 0.  The packets are already handled correctly
by the network stack.

Reviewed by: hselasky, slavash
Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoFix LOR between controller and queue locks.
Alexander Motin [Wed, 2 May 2018 20:13:03 +0000 (20:13 +0000)]
Fix LOR between controller and queue locks.

Admin pass-through requests took controller lock before the queue lock,
but in case of request submission to a failed controller controller lock
was taken after the queue lock.  Fix that by reducing the lock scopes and
switching to mtx_pool locks to track pass-through request completion.

Sponsored by: iXsystems, Inc.

6 years agoSImplify the call to tcp_drop(), since the handling of soft error
Michael Tuexen [Wed, 2 May 2018 20:04:31 +0000 (20:04 +0000)]
SImplify the call to tcp_drop(), since the handling of soft error
is also done in tcp_drop(). No functional change.

Sponsored by: Netflix, Inc.

6 years agoUnbreak RaspberryPi 2 boot after r332839
Oleksandr Tymoshenko [Wed, 2 May 2018 20:04:25 +0000 (20:04 +0000)]
Unbreak RaspberryPi 2 boot after r332839

r332839 changed number of cells per interrupt for local_intc from 1 to 2
to pass type of IRQ. Driver expected only 1 cell so after r332839
all interrupt children of local_intc failed to allocate IRQ resource.

Fix this regression by relaxing check for number of cells in interrupt
property to be either 1 or 2.

PR: 227904

6 years agoFix in the documentation that the default hop limit is not 30, but
Michael Tuexen [Wed, 2 May 2018 19:36:46 +0000 (19:36 +0000)]
Fix in the documentation that the default hop limit is not 30, but
the value of the sysctl variable net.inet6.ip6.hlim.
This is true since
https://svnweb.freebsd.org/base?view=revision&revision=122574
The default of 30 (which was correct up to r122574) was incorrectly
documented in
https://svnweb.freebsd.org/base?view=revision&revision=130268

Thanks to Timo Voelker for makeing me aware of the inconsistency
between to code and the documentation.

MFC after: 3 days

6 years agoSeparate list manipulation locking from state change in multicast
Stephen Hurd [Wed, 2 May 2018 19:36:29 +0000 (19:36 +0000)]
Separate list manipulation locking from state change in multicast

Multicast incorrectly calls in to drivers with a mutex held causing drivers
to have to go through all manner of contortions to use a non sleepable lock.
Serialize multicast updates instead.

Submitted by: mmacy <mmacy@mattmacy.io>
Reviewed by: shurd, sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14969

6 years agoUse PCI power-mgmt to reset a device if FLR fails.
Peter Grehan [Wed, 2 May 2018 17:41:00 +0000 (17:41 +0000)]
Use PCI power-mgmt to reset a device if FLR fails.

A large number of devices don't support PCIe FLR, in particular
graphics adapters. Use PCI power management to perform the
reset if FLR fails or isn't available, by cycling the device
through the D3 state.

This has been tested by a number of users with Nvidia and AMD GPUs.

Submitted and tested by: Matt Macy
Reviewed by: jhb, imp, rgrimes
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15268

6 years agoRetire ixgb(4)
Sean Bruno [Wed, 2 May 2018 15:59:15 +0000 (15:59 +0000)]
Retire ixgb(4)

This driver was for an early and uncommon legacy PCI 10GbE for a single
ASIC, Intel 82597EX. Intel quickly shifted to the long lived ixgbe family.

Submitted by: kbowling
Reviewed by: brooks imp jeffrey.e.pieper@intel.com
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15234

6 years agobsdgrep: Adjust a missed NLS reference that was invalidated by recent work
Kyle Evans [Wed, 2 May 2018 15:45:31 +0000 (15:45 +0000)]
bsdgrep: Adjust a missed NLS reference that was invalidated by recent work

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>

6 years agoxen: fix formatting of xen_init_ops
Roger Pau Monné [Wed, 2 May 2018 10:20:55 +0000 (10:20 +0000)]
xen: fix formatting of xen_init_ops

No functional change

Sponsored by: Citrix Systems R&D

6 years agoxen: fix gntdev
Roger Pau Monné [Wed, 2 May 2018 10:19:17 +0000 (10:19 +0000)]
xen: fix gntdev

Current interface to the gntdev in FreeBSD is wrong, and mostly worked
out of luck before the PTI FreeBSD fixes, when kernel and user-space
where sharing the same page tables.

On FreeBSD ioctls have the size of the passed struct encoded in the
ioctl number, because the generic ioctl handler in the OS takes care
of copying the data from user-space to kernel space, and then calls
the device specific ioctl handler. Thus using ioctl structs with
variable sizes is not possible.

The fix is to turn the array of structs at the end of
ioctl_gntdev_alloc_gref and ioctl_gntdev_map_grant_ref into pointers,
that can be properly accessed from the kernel gntdev driver using the
copyin/copyout functions. Note that this is exactly how it's done for
the privcmd driver.

Sponsored by:   Citrix Systems R&D

6 years agoClean enclosure_table when resetting num_enc_table_entries to zero.
Alexander Motin [Wed, 2 May 2018 02:41:09 +0000 (02:41 +0000)]
Clean enclosure_table when resetting num_enc_table_entries to zero.

Garbage left there by r325363 in some scenarios found to lead to later
enclosure mapping failures.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

6 years agocmp(1): Provide some long options
Kyle Evans [Wed, 2 May 2018 01:32:34 +0000 (01:32 +0000)]
cmp(1): Provide some long options

These match GNU cmp(1) for compatibility where applicable.

Future work might implement the -i option from GNU cmp(1) to express skip
either in terms of both files or of the form "SKIP1:SKIP2" rather than
specifying them as additional arguments to cmp(1).

MFC after: 1 month

6 years agouniq(1): Add some long options
Kyle Evans [Wed, 2 May 2018 01:17:08 +0000 (01:17 +0000)]
uniq(1): Add some long options

These match GNU uniq(1) where appropriate for compatibility's sake.

While here, re-sort options alphabetically by the short-option.

MFC after: 1 month

6 years agoseq(1): Move long_opts up with globals
Kyle Evans [Wed, 2 May 2018 01:04:13 +0000 (01:04 +0000)]
seq(1): Move long_opts up with globals

6 years agoRefactor dadone(). There was no useful code sharing in it; it was just
Scott Long [Tue, 1 May 2018 21:42:27 +0000 (21:42 +0000)]
Refactor dadone().  There was no useful code sharing in it; it was just
a 1500 line switch statement.  Callers now specify a discrete completion
handler, though they're still welcome to track state via ccb_state.

Sponsored by: Netflix

6 years agocxgbe(4): Move all TCAM filter code into a separate file.
Navdeep Parhar [Tue, 1 May 2018 20:17:22 +0000 (20:17 +0000)]
cxgbe(4): Move all TCAM filter code into a separate file.

Sponsored by: Chelsio Communications

6 years agocam_periph_runccb() changed several years ago to overwrite the ccb callback
Scott Long [Tue, 1 May 2018 20:09:29 +0000 (20:09 +0000)]
cam_periph_runccb() changed several years ago to overwrite the ccb callback
pointer.  It's now unhelpful and misleading for callers to continue to set
it, so bring all callers into conformance.  There's no real functional change,
but it makes reading the code a lot less confusing.

Sponsored by: Netflix

6 years agoMFV: r333077
Jung-uk Kim [Tue, 1 May 2018 19:17:38 +0000 (19:17 +0000)]
MFV: r333077

Merge ACPICA 20180427.

6 years agoixl(4): Update to 1.9.9-k
Eric Joyner [Tue, 1 May 2018 18:50:12 +0000 (18:50 +0000)]
ixl(4): Update to 1.9.9-k

Refresh upstream driver before impending conversion to iflib.

Major changes:

- Support for descriptor writeback mode (required by ixlv(4) for AVF support)
- Ability to disable firmware LLDP agent by user (PR 221530)
- Fix for TX queue hang when using TSO (PR 221919)
- Separate descriptor ring sizes for TX and RX rings

PR: 221530, 221919
Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: #IntelNetworking
MFC after: 1 day
Relnotes: Yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D14985

6 years agoAdd and fix comments for cam_periph_runccb()
Scott Long [Tue, 1 May 2018 17:48:50 +0000 (17:48 +0000)]
Add and fix comments for cam_periph_runccb()

Sponsored by: Netflix

6 years agoAdd ability to perform a firmware reset during driver initialization.
Josh Paetzel [Tue, 1 May 2018 17:39:20 +0000 (17:39 +0000)]
Add ability to perform a firmware reset during driver initialization.

Required by Lancer Gen 5 hardware.

Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
Obtained from: Broadcom

6 years agoPrint the dump progress indicator after calling dump_start().
Mark Johnston [Tue, 1 May 2018 17:32:43 +0000 (17:32 +0000)]
Print the dump progress indicator after calling dump_start().

Dumpers may wish to print messages from an initialization hook; this
change ensures that such messages aren't mixed with output from the
generic dump code.

MFC after: 1 week

6 years agoRetire lmc(4)
Ed Maste [Tue, 1 May 2018 16:30:48 +0000 (16:30 +0000)]
Retire lmc(4)

This driver supports legacy, 32-bit PCI devices, and had an ambiguous
license.  Supported devices were already reported to be rare in 2003
(when an earlier version of the driver was removed in r123201).

Reviewed by: rgrimes
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15245

6 years agoUse M. Warner Losh everywhere on my copyrights.
Warner Losh [Tue, 1 May 2018 16:29:22 +0000 (16:29 +0000)]
Use M. Warner Losh everywhere on my copyrights.
Remove 'All Rights Reserved' where I can.

6 years agoRemove 'All Rights Reserved.' from all of my Copyrights in sys/arm and
Warner Losh [Tue, 1 May 2018 16:21:01 +0000 (16:21 +0000)]
Remove 'All Rights Reserved.' from all of my Copyrights in sys/arm and
always use 'M. Warner Losh' for consistency.

'All Rights Reserved.' was prescribed by the Buenos Aires Copyright
Convention of 1910, but has been mostly dead since the early 1990's
and completely meaningless since 2000 when Nicaragua ratified the
Berne convention.

Some files not done due to ambiguity of various types.

6 years agoOptionally panic when cxgbe encounters a fatal error
Andrew Gallatin [Tue, 1 May 2018 15:33:21 +0000 (15:33 +0000)]
Optionally panic when cxgbe encounters a fatal error

Sometimes it is better to panic than to leave a machine
unreachable.

Reviewed by: np
Sponsored by: Netflix

6 years agoInitial debug server for bhyve.
John Baldwin [Tue, 1 May 2018 15:17:46 +0000 (15:17 +0000)]
Initial debug server for bhyve.

This commit adds a new debug server to bhyve.  Unlike the existing -g
option which provides an efficient connection to a debug server
running in the guest OS, this debug server permits inspection and
control of the guest from within the hypervisor itself without
requiring any cooperation from the guest.  It is similar to the debug
server provided by qemu.

To avoid conflicting with the existing -g option, a new -G option has
been added that accepts a TCP port.  An IPv4 socket is bound to this
port and listens for connections from debuggers.  In addition, if the
port begins with the character 'w', the hypervisor will pause the
guest at the first instruction until a debugger attaches and
explicitly continues the guest.  Note that only a single debugger can
attach to a guest at a time.

Virtual CPUs are exposed to the remote debugger as threads.  General
purpose register values can be read for each virtual CPU.  Other
registers cannot currently be read, and no register values can be
changed by the debugger.

The remote debugger can read guest memory but not write to guest
memory.  To facilitate source-level debugging of the guest, memory
addresses from the debugger are treated as virtual addresses (rather
than physical addresses) and are resolved to a physical address using
the active virtual address translation of the current virtual CPU.
Memory reads should honor memory mapped I/O regions, though the debug
server does not attempt to honor any alignment or size constraints
when accessing MMIO.

The debug server provides limited support for controlling the guest.
The guest is suspended when a debugger is attached and resumes when a
debugger detaches.  A debugger can suspend a guest by sending a Ctrl-C
request (e.g. via Ctrl-C in GDB).  A debugger can also continue a
suspended guest while remaining attached.  Breakpoints are not yet
supported.  Single stepping is supported on Intel CPUs that support
MTRAP VM exits, but is not available on other systems.

While the current debug server has limited functionality, it should
at least be usable for basic debugging now.  It is also a useful
checkpoint to serve as a base for adding additional features.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D15022

6 years agocxgbe(4): Destroy the cdev before disabling interrupts in driver detach.
Navdeep Parhar [Tue, 1 May 2018 14:59:38 +0000 (14:59 +0000)]
cxgbe(4): Destroy the cdev before disabling interrupts in driver detach.

Filter work requests are submitted in the nexus cdev's ioctl which then
blocks waiting for a reply.  If driver detach runs in this state and
disables interrupts the ioctl will never complete and detach will hang
in destroy_cdev.

Sponsored by: Chelsio Communications

6 years agouart_snps: Add early printf support
Emmanuel Vadot [Tue, 1 May 2018 13:57:08 +0000 (13:57 +0000)]
uart_snps: Add early printf support

Move the allwinner early printf support to the snps driver as it
should work with all implementation.
While here add instruction for enabling it on 64bits SoCs.

6 years agoixgb(4): Add deprecation notice for this old and busted 10GE adapter.
Sean Bruno [Tue, 1 May 2018 12:58:01 +0000 (12:58 +0000)]
ixgb(4):  Add deprecation notice for this old and busted 10GE adapter.

This is a prequisite before we remove the driver from -current.

Reviewed by: emaste kbowling imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D15244

6 years agoFix bthidd build with GCC 4.2 after r333110
Vladimir Kondratyev [Tue, 1 May 2018 08:03:12 +0000 (08:03 +0000)]
Fix bthidd build with GCC 4.2 after r333110

Rename inlined function parameter to avoid shadowing of devname libc
function declared in stdlib.h header

Reported by: lwhsu
Tested by: lwhsu

6 years agoRemove dead errata fixup code
Justin Hibbits [Tue, 1 May 2018 04:31:17 +0000 (04:31 +0000)]
Remove dead errata fixup code

This code caused more problems than it should have fixed (boot failures) on
the machines I tested, so has been commented out for a while now.  Remove
it, and assume the errata fixups were done by the bootloader where they
belong.

6 years agoReport the kernel base address properly in kldstat when using PowerPC kernels
Nathan Whitehorn [Tue, 1 May 2018 04:06:59 +0000 (04:06 +0000)]
Report the kernel base address properly in kldstat when using PowerPC kernels
loaded at addresses other than their link address.

6 years agopwd_mkdb: retire legacy v3 db support (-l option)
Ed Maste [Tue, 1 May 2018 00:53:46 +0000 (00:53 +0000)]
pwd_mkdb: retire legacy v3 db support (-l option)

pwd_mkdb has emitted v4 password database records since 2003 (r113596)
in addition to v3, and as of r283981 by default it emitted only v4.
As described in r283981, retire the -l legacy option.

The -B and -L options were originally added to set the endianness of v3
records emitted by pwd_mkdb, but they also set the db hash endiannes and
so have been retained temporarily.

Announced on the FreeBSD-Current and FreeBSD-Stable lists.  In stable/11
the man page contains a deprecation notice, and pwd_mkdb will emit a
deprecation notice if the -l option is specified.

Reviewed by: delphij, lidl, rgrimes
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15144

6 years agoInstall smartpqi.4 only on amd64, as with the driver
Ed Maste [Tue, 1 May 2018 00:36:56 +0000 (00:36 +0000)]
Install smartpqi.4 only on amd64, as with the driver

Sponsored by: The FreeBSD Foundation

6 years agoFix iflib_encap() EFBIG handling bugs
Andrew Gallatin [Mon, 30 Apr 2018 23:53:27 +0000 (23:53 +0000)]
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)

6 years agoImprove nvme(4) attach/detach sequences.
Alexander Motin [Mon, 30 Apr 2018 23:05:57 +0000 (23:05 +0000)]
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.

6 years agocxgbe(4): Convert ACT_OPEN_RPL to a shared CPL.
Navdeep Parhar [Mon, 30 Apr 2018 21:47:30 +0000 (21:47 +0000)]
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

6 years agoFix use-after-free in nvme_qpair_destroy().
Alexander Motin [Mon, 30 Apr 2018 21:28:10 +0000 (21:28 +0000)]
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.

6 years agoTurn off IBRS on suspend.
Konstantin Belousov [Mon, 30 Apr 2018 20:18:32 +0000 (20:18 +0000)]
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

6 years agoFix null pointer dereference on nodes without a "compatible" property.
Nathan Whitehorn [Mon, 30 Apr 2018 19:37:32 +0000 (19:37 +0000)]
Fix null pointer dereference on nodes without a "compatible" property.

MFC after: 1 week

6 years agoSet si_drv1 for nvmeXnsY in a new race-free way.
Alexander Motin [Mon, 30 Apr 2018 19:21:20 +0000 (19:21 +0000)]
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.

6 years agoseq(1): Provide some long options
Kyle Evans [Mon, 30 Apr 2018 18:55:01 +0000 (18:55 +0000)]
seq(1): Provide some long options

These match GNU seq(1) names where applicable for compatibility purposes.

MFC after: 1 month

6 years agocxgbe/t4_tom: Use appropriate macros instead of magic math while
Navdeep Parhar [Mon, 30 Apr 2018 17:33:44 +0000 (17:33 +0000)]
cxgbe/t4_tom: Use appropriate macros instead of magic math while
constructing the atid of an active open work request.

Sponsored by: Chelsio Communications

6 years agoDisable connectat/bindat with AT_FDCWD in capmode
Ed Maste [Mon, 30 Apr 2018 17:31:06 +0000 (17:31 +0000)]
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

6 years agoClarify bindat/connectat use with AT_FDCWD
Ed Maste [Mon, 30 Apr 2018 17:16:17 +0000 (17:16 +0000)]
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

6 years agolibibumad/umad.c: In get_port, ignore sysctl get rate errors
Slava Shwartsman [Mon, 30 Apr 2018 15:23:45 +0000 (15:23 +0000)]
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

6 years agocxgbe(4): Use opaque cookies or tid range-checks to determine the
Navdeep Parhar [Mon, 30 Apr 2018 15:18:38 +0000 (15:18 +0000)]
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

6 years agobthidd(8): Add evdev protocol support for bluetooth keyboards and mouses
Vladimir Kondratyev [Mon, 30 Apr 2018 12:16:54 +0000 (12:16 +0000)]
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

6 years agobthidd(8): Add internal support for user-friendly name of remote devices.
Vladimir Kondratyev [Mon, 30 Apr 2018 10:49:29 +0000 (10:49 +0000)]
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

6 years agouinput: Add FreeBSD specific ioctl to set unique identifier of input device.
Vladimir Kondratyev [Mon, 30 Apr 2018 10:34:16 +0000 (10:34 +0000)]
uinput: Add FreeBSD specific ioctl to set unique identifier of input device.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D13456

6 years agobluetooth(3): Add helper functions that performs Bluetooth Remote Name Request
Vladimir Kondratyev [Mon, 30 Apr 2018 10:24:50 +0000 (10:24 +0000)]
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

6 years agolibsdp: Add method that returns actual source BD_ADDR of SDP session.
Vladimir Kondratyev [Mon, 30 Apr 2018 10:15:58 +0000 (10:15 +0000)]
libsdp: Add method that returns actual source BD_ADDR of SDP session.

Reviewed by: emax, wblock (docs)
Differential Revision: https://reviews.freebsd.org/D13456

6 years agoDefine USEC_PER_MSEC and USEC_PER_SEC in the LinuxKPI.
Hans Petter Selasky [Mon, 30 Apr 2018 09:31:09 +0000 (09:31 +0000)]
Define USEC_PER_MSEC and USEC_PER_SEC in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoImprove fix in r304629 by allowing configuration of the behaviour
Hans Petter Selasky [Mon, 30 Apr 2018 07:30:37 +0000 (07:30 +0000)]
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

6 years agoIncluded opt_stack.h in Makefile, to fix module build.
Ram Kishore Vegesna [Mon, 30 Apr 2018 07:24:31 +0000 (07:24 +0000)]
Included opt_stack.h in Makefile, to fix module build.

PR: 227823
Reported by: eugen
Approved by: mav
MFC after: 3 days

6 years agoDon't bail out from the check if readboot() returns !FSFATAL.
Xin LI [Mon, 30 Apr 2018 05:57:55 +0000 (05:57 +0000)]
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: https://android.googlesource.com/platform/external/fsck_msdos/+/d8775a29ea7eac2e5f1504dd21da3725b93b3036
MFC after: 2 weeks

6 years agoAdd back the historical information about being mentored by rrs
Rebecca Cran [Mon, 30 Apr 2018 04:02:48 +0000 (04:02 +0000)]
Add back the historical information about being mentored by rrs

Reviewed by: imp, eadler
Differential Revision: https://reviews.freebsd.org/D15230

6 years agoif_smsc: set MII BUSY bit to read/write PHY regs
Ed Maste [Mon, 30 Apr 2018 02:18:19 +0000 (02:18 +0000)]
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

6 years agoif_smsc: fix reset check
Ed Maste [Mon, 30 Apr 2018 01:58:24 +0000 (01:58 +0000)]
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

6 years agosh: Don't have [ match any [[:class:]]
Jilles Tjoelker [Sun, 29 Apr 2018 17:46:08 +0000 (17:46 +0000)]
sh: Don't have [ match any [[:class:]]

Submitted by: Robert Elz
MFC after: 3 days

6 years agoEliminate some vm object relocks in vm fault.
Konstantin Belousov [Sun, 29 Apr 2018 12:43:08 +0000 (12:43 +0000)]
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

6 years agoClean up the EXAMPLES section of usbconfig(8). This removes parts that
Edward Tomasz Napierala [Sun, 29 Apr 2018 10:45:09 +0000 (10:45 +0000)]
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

6 years agoamd64/mp_machdep.c: Fix GCC build after r333059
Conrad Meyer [Sat, 28 Apr 2018 17:55:28 +0000 (17:55 +0000)]
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 .

6 years agosmartpqi(4): Use conventional path to driver sources
Conrad Meyer [Sat, 28 Apr 2018 17:43:51 +0000 (17:43 +0000)]
smartpqi(4): Use conventional path to driver sources

6 years agosmartpqi(4): Unbreak GCC build
Conrad Meyer [Sat, 28 Apr 2018 17:43:20 +0000 (17:43 +0000)]
smartpqi(4): Unbreak GCC build

Remove redundant declarations.

6 years agopfctl: Don't break connections on skipped interfaces on reload
Kristof Provost [Sat, 28 Apr 2018 13:16:58 +0000 (13:16 +0000)]
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

6 years agoAdd EXAMPLES to tip(1) man page.
Edward Tomasz Napierala [Sat, 28 Apr 2018 12:24:05 +0000 (12:24 +0000)]
Add EXAMPLES to tip(1) man page.

MFC after: 2 weeks

6 years agozpool(8): correct list of default properties in 'list'.
Eitan Adler [Sat, 28 Apr 2018 01:14:16 +0000 (01:14 +0000)]
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)

6 years agoNo need to make objects here.
Warner Losh [Fri, 27 Apr 2018 22:15:18 +0000 (22:15 +0000)]
No need to make objects here.

6 years agoImport ACPICA 20180427.
Jung-uk Kim [Fri, 27 Apr 2018 21:30:01 +0000 (21:30 +0000)]
Import ACPICA 20180427.

6 years agoUse %p to print uintptr_t values rather than %z in MIPS single-step code.
John Baldwin [Fri, 27 Apr 2018 21:22:32 +0000 (21:22 +0000)]
Use %p to print uintptr_t values rather than %z in MIPS single-step code.

6 years agoarm: dts: overlays: Remove the overlay module
Emmanuel Vadot [Fri, 27 Apr 2018 21:15:51 +0000 (21:15 +0000)]
arm: dts: overlays: Remove the overlay module

Move the DTSO variables in the main SoC dtb file

Discussed with: ian