]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agorpc.sprayd: raise WARNS to 6
asomers [Mon, 5 Mar 2018 16:11:07 +0000 (16:11 +0000)]
rpc.sprayd: raise WARNS to 6

MFC after: 3 weeks

6 years agoWe shouldn't need to execute code in the recursive page table mappings;
jtl [Mon, 5 Mar 2018 15:12:35 +0000 (15:12 +0000)]
We shouldn't need to execute code in the recursive page table mappings;
therefore, it should be safe to set the NX bit on the PML4E for the
recursive page table mappings.  According to the Intel docs, the effect
of the NX bit should propogate to any page reached through a PML4E which
has the NX bit set.

Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D14333

6 years agoPrior to r329071, pmap_bootstrap() used pmap_kmem_choose() to round the
jtl [Mon, 5 Mar 2018 15:10:17 +0000 (15:10 +0000)]
Prior to r329071, pmap_bootstrap() used pmap_kmem_choose() to round the
first available virtual address to a 2MB boundary. After r329071,
create_pagetables() rounds firstaddr up to a 2MB boundary. This ensures
the kernel is mapped in super-pages, which is the point of the logic
in pmap_kmem_choose(). Therefore, it is no longer necessary for
pmap_bootstrap() to round up to the 2MB boundary again.

As pmap_bootstrap() was the only user of pmap_kmem_choose(), we can
delete pmap_kmem_choose().

Reviewed by: kib
MFC after: 2 weeks
X-MFC-with: r329071
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D14355

6 years agoOptimize ibcore RoCE address handle creation from user-space.
hselasky [Mon, 5 Mar 2018 14:34:52 +0000 (14:34 +0000)]
Optimize ibcore RoCE address handle creation from user-space.

Creating a UD address handle from user-space or from the kernel-space,
when the link layer is ethernet, requires resolving the remote L3
address into a L2 address. Doing this from the kernel is easy because
the required ARP(IPv4) and ND6(IPv6) address resolving APIs are readily
available. In userspace such an interface does not exist and kernel
help is required.

It should be noted that in an IP-based GID environment, the GID itself
does not contain all the information needed to resolve the destination
IP address. For example information like VLAN ID and SCOPE ID, is not
part of the GID and must be fetched from the GID attributes. Therefore
a source GID should always be referred to as a GID index. Instead of
going through various racy steps to obtain information about the
GID attributes from user-space, this is now all done by the kernel.

This patch optimises the L3 to L2 address resolving using the existing
create address handle uverbs interface, retrieving back the L2 address
as an additional user-space information structure.

This commit combines the following Linux upstream commits:

IB/core: Let create_ah return extended response to user
IB/core: Change ib_resolve_eth_dmac to use it in create AH
IB/mlx5: Make create/destroy_ah available to userspace
IB/mlx5: Use kernel driver to help userspace create ah
IB/mlx5: Report that device has udata response in create_ah

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoGet correct network device when accepting incoming RDMA connections in ibcore.
hselasky [Mon, 5 Mar 2018 14:24:30 +0000 (14:24 +0000)]
Get correct network device when accepting incoming RDMA connections in ibcore.

This patch ensures the GID index is always used as a basis of resolving
incoming RDMA connections, as compared to the GID value itself.

Background:
On a per infiniband port basis, the GID identifier is not a unique identifier!
This assumption falls apart when VLAN ID, IPv6 scope ID and RoCE type,
as supported by RoCE v2, is taken into account. This additional
information is stored in the so-called GID attributes and is needed to
correctly identify the destination network interface for an incoming
connection.

Different VLANs are allowed to define the same IPv4 addresses and especially
for the default IPv6 link-local addresses or when using so-called containers
or jails, this is true.

The VNET information for the destination network interface is needed in
order to perform the L2 address lookup in the right Virtual Network Stack
context.

Consequently old functions previously used by RoCE v1, like
rdma_addr_find_smac_by_sgid() are impossible to support, because
there can be multiple identical GIDs associated with the same
infiniband port, and the answer to such a request becomes undefined.
This function has been removed.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoPass valid if_index to rdma_addr_find_l2_eth_by_grh() in ibcore when possible.
hselasky [Mon, 5 Mar 2018 14:22:36 +0000 (14:22 +0000)]
Pass valid if_index to rdma_addr_find_l2_eth_by_grh() in ibcore when possible.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for loopback in ibcore.
hselasky [Mon, 5 Mar 2018 13:57:37 +0000 (13:57 +0000)]
Add support for loopback in ibcore.

Implement the missing pieces in addr_resolve() to support loopback
addresses. IB core will test for the IFF_LOOPBACK flag in the network
interface and treat these devices in a special way.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMake sure to register the VLAN GIDs using the VLAN network interface
hselasky [Mon, 5 Mar 2018 12:39:34 +0000 (12:39 +0000)]
Make sure to register the VLAN GIDs using the VLAN network interface
and not the parent one in ibcore. Else looking up the VLAN GIDs will
fail for VLAN IPs.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoNeed to check for IPv6 linklocal address inside rdma_resolve_addr() in ibcore.
hselasky [Mon, 5 Mar 2018 12:04:34 +0000 (12:04 +0000)]
Need to check for IPv6 linklocal address inside rdma_resolve_addr() in ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMap type of service, TOS, to IB or VLAN service level 1:1 in ibcore.
hselasky [Mon, 5 Mar 2018 11:59:54 +0000 (11:59 +0000)]
Map type of service, TOS, to IB or VLAN service level 1:1 in ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoSelect RoCEv2 by default in ibcore.
hselasky [Mon, 5 Mar 2018 11:58:37 +0000 (11:58 +0000)]
Select RoCEv2 by default in ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMake deletion of RoCE GID entries synchronous in ibcore.
hselasky [Mon, 5 Mar 2018 11:57:26 +0000 (11:57 +0000)]
Make deletion of RoCE GID entries synchronous in ibcore.

When a network device is departing, the RoCE GID entries should be
cleared before the default L2 link layer address is freed. Else a NULL
pointer access may happen.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for IPv6 link local GIDs equal to the default GID for
hselasky [Mon, 5 Mar 2018 11:55:29 +0000 (11:55 +0000)]
Add support for IPv6 link local GIDs equal to the default GID for
VLANs in ibcore.

IPv6 link local addresses are usually derived from the netdev MAC
address. This is applicable to VLAN devices and its lower netdevice as
well. In such cases the IPv6 link local address is a duplicate of the
default GID.

Now that link local IPv6 addresses based GIDs are supported, allow
adding such GID entries in the GID table.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoDo not add RoCEv2 default GID in ibcore when IPv6 is disabled to honor the
hselasky [Mon, 5 Mar 2018 11:52:39 +0000 (11:52 +0000)]
Do not add RoCEv2 default GID in ibcore when IPv6 is disabled to honor the
networking stack's IPv6 disabled setting. Else the offload HCA can start using
IPv6 packets for QPs.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd missing FreeBSD tags and SVN properties to ibcore.
hselasky [Mon, 5 Mar 2018 11:49:45 +0000 (11:49 +0000)]
Add missing FreeBSD tags and SVN properties to ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRegister each GICv3 ITS driver with a useful cross reference. We currently
andrew [Mon, 5 Mar 2018 10:11:30 +0000 (10:11 +0000)]
Register each GICv3 ITS driver with a useful cross reference. We currently
only use the first driver, however this may change in the future and
hardware exists with multiple ITS devices.

Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)

6 years agoIn the ACPI GICv3 attach function call device_get_children to get the list
andrew [Mon, 5 Mar 2018 10:09:18 +0000 (10:09 +0000)]
In the ACPI GICv3 attach function call device_get_children to get the list
of children. We expect this to be populated when configuring the secondary
cores.

Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)

6 years ago- Remove extra NULL check before free().
hrs [Mon, 5 Mar 2018 03:38:31 +0000 (03:38 +0000)]
- Remove extra NULL check before free().
- Fix null pointer dereference in netbuffree() and use netbuffree()
  where applicable.

6 years agoPartially back out changes in r327464. stdlib.h is used when
hrs [Mon, 5 Mar 2018 03:34:01 +0000 (03:34 +0000)]
Partially back out changes in r327464.  stdlib.h is used when
RPCBIND_DEBUG is enabled.

6 years agoSwitch imx_gpio to attach at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE.
ian [Mon, 5 Mar 2018 02:32:23 +0000 (02:32 +0000)]
Switch imx_gpio to attach at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE.
Pretty much any other device might need to manipulate a gpio pin during its
probe or attach routines, so these devices must be available as early as
possible.

The gpio device is an interrupt controller, but I didn't choose the
INTERRUPT pass for that reason (it works fine as an interrupt controller as
long as it attaches any time before interrupts are enabled).  That just
looked like the right place in the passes to ensure that it attaches before
any type of device that might need gpio pin manipulations.

6 years agoMove the new AMD-Vi IVHD [ACPI_IVRS_HARDWARE_NEW]definitions added in r329360 in...
anish [Mon, 5 Mar 2018 02:28:25 +0000 (02:28 +0000)]
Move the new AMD-Vi IVHD [ACPI_IVRS_HARDWARE_NEW]definitions added in r329360 in contrib ACPI to local files till ACPI code adds new definitions reported by jkim.
Rename ACPI_IVRS_HARDWARE_NEW to ACPI_IVRS_HARDWARE_EFRSUP, since new definitions add Extended Feature Register support.  Use IvrsType to distinguish three types of IVHD - 0x10(legacy), 0x11 and 0x40(with EFR). IVHD 0x40 is also called mixed type since it supports HID device entries.
Fix 2 coverity bugs reported by cem.

Reported by:jkim, cem
Approved by:grehan
Differential Revision://reviews.freebsd.org/D14501

6 years agoDefer attaching the spibus until timers and interrupts are working. The
ian [Mon, 5 Mar 2018 02:13:28 +0000 (02:13 +0000)]
Defer attaching the spibus until timers and interrupts are working.  The
driver requires interrupts to do transfers, and the drivers for the SPI
devices on the bus quite reasonably expect to be able to do IO while probing
and attaching.

6 years agoDo not stop the loop that configures gpio chipselect pins on the first
ian [Mon, 5 Mar 2018 02:08:33 +0000 (02:08 +0000)]
Do not stop the loop that configures gpio chipselect pins on the first
error, just ignore pins that don't configure and keep setting up the ones
that do.  (But when bootverbose is on, whine about the errors.)

6 years agochflags: Add -x option to not traverse mount points.
bdrewery [Mon, 5 Mar 2018 01:56:07 +0000 (01:56 +0000)]
chflags: Add -x option to not traverse mount points.

MFC after: 2 weeks

6 years agolualoader: Use FILESDIR instead of BINDIR
kevans [Mon, 5 Mar 2018 01:18:32 +0000 (01:18 +0000)]
lualoader: Use FILESDIR instead of BINDIR

Minor nit: We're not installing binaries, we're installing scripts/files
that are documented to be installed based on FILESDIR.

6 years agolualoader: Add note about importance of including the cli module early
kevans [Mon, 5 Mar 2018 00:59:55 +0000 (00:59 +0000)]
lualoader: Add note about importance of including the cli module early

6 years agoSwitch to the new bcd_clocktime conversion routines, and add calls to the
ian [Mon, 5 Mar 2018 00:43:53 +0000 (00:43 +0000)]
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

6 years agolockmgr: save on sleepq when cmpset fails
mjg [Mon, 5 Mar 2018 00:30:07 +0000 (00:30 +0000)]
lockmgr: save on sleepq when cmpset fails

6 years agoSwitch to the new bcd_clocktime conversion routines, and add calls to the
ian [Mon, 5 Mar 2018 00:15:56 +0000 (00:15 +0000)]
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

6 years agoSwitch to the new bcd_clocktime conversion routines, and add calls to the
ian [Sun, 4 Mar 2018 23:39:40 +0000 (23:39 +0000)]
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

6 years agolockmgr: whack unused lockmgr_note_exclusive_upgrade
mjg [Sun, 4 Mar 2018 22:14:20 +0000 (22:14 +0000)]
lockmgr: whack unused lockmgr_note_exclusive_upgrade

6 years agomtx: tidy up recursion handling in thread lock
mjg [Sun, 4 Mar 2018 22:01:23 +0000 (22:01 +0000)]
mtx: tidy up recursion handling in thread lock

Normally after grabbing the lock it has to be verified we got the right one
to begin with. However, if we are recursing, it must not change thus the
check can be avoided. In particular this avoids a lock read for non-recursing
case which found out the lock was changed.

While here avoid an irq trip of this happens.

Tested by: pho (previous version)

6 years agoThe year is stored in a single byte in sram, in binary format, as a count
ian [Sun, 4 Mar 2018 21:58:32 +0000 (21:58 +0000)]
The year is stored in a single byte in sram, in binary format, as a count
of years since the century, so strip the century out when converting to or
from bcd_clocktime format (the conversion routines will infer century by
pivoting on 70).

6 years agosx: don't do an atomic op in upgrade if it cananot succeed
mjg [Sun, 4 Mar 2018 21:41:05 +0000 (21:41 +0000)]
sx: don't do an atomic op in upgrade if it cananot succeed

The code already pays the cost of reading the lock to obtain the waiters
flag. Checking whether there is more than one reader is not a problem and
avoids dirtying the line.

This also fixes a small corner case: if waiters were to show up between
reading the flag and upgrading the lock, the operation would fail even
though it should not. No correctness change here though.

6 years agolocks: fix a corner case in r327399
mjg [Sun, 4 Mar 2018 21:38:30 +0000 (21:38 +0000)]
locks: fix a corner case in r327399

If there were exactly rowner_retries/asx_retries (by default: 10) transitions
between read and write state and the waiters still did not get the lock, the
next owner -> reader transition would result in the code correctly falling
back to turnstile/sleepq where it would incorrectly think it was waiting
for a writer and decide to leave turnstile/sleepq to loop back. From this
point it would take ts/sq trips until the lock gets released.

The bug sometimes manifested itself in stalls during -j 128 package builds.

Refactor the code to fix the bug, while here remove some of the gratituous
differences between rw and sx locks.

6 years agoRemove redundant test from r330410.
kib [Sun, 4 Mar 2018 21:15:31 +0000 (21:15 +0000)]
Remove redundant test from r330410.

If the input slist is non-empty, counter cannot be zero after freeing.

Noted by: mjg
MFC after: 2 weeks

6 years agoBuild iicbus/rtc8583 as a module.
ian [Sun, 4 Mar 2018 21:06:21 +0000 (21:06 +0000)]
Build iicbus/rtc8583 as a module.

6 years agoConvert to the new(ish) bcd_clocktime conversion functions, add calls to
ian [Sun, 4 Mar 2018 21:04:30 +0000 (21:04 +0000)]
Convert to the new(ish) bcd_clocktime conversion functions, add calls to
the new debug output functions, and when setting the clock, propagate the
timespec nsecs to the 1/100ths register.

6 years agoUnify bulk free operations in several pmaps.
kib [Sun, 4 Mar 2018 20:53:20 +0000 (20:53 +0000)]
Unify bulk free operations in several pmaps.

Submitted by: Yoshihiro Ota
Reviewed by: markj
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D13485

6 years agoRefer to SysV IPC permissions as numeric constants.
brooks [Sun, 4 Mar 2018 20:06:02 +0000 (20:06 +0000)]
Refer to SysV IPC permissions as numeric constants.

POSIX defines no macros for these permissions.

Also remove unneeded headers from synopsis.

PR: 225905
Reviewed by: wblock
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14461

6 years agoProperly wrap the BUILD_BUG() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:42:50 +0000 (19:42 +0000)]
Properly wrap the BUILD_BUG() function macro in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd calls to the new clock_dbgprint_xxx() functions. Also, stop applying
ian [Sun, 4 Mar 2018 19:32:52 +0000 (19:32 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.  Also, stop applying
a local .5 second adjustment to the time, since that is now done by the
code in subr_rtc.c.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:26:47 +0000 (19:26 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agoOops, fix a paste-o.
ian [Sun, 4 Mar 2018 19:25:54 +0000 (19:25 +0000)]
Oops, fix a paste-o.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:23:48 +0000 (19:23 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:20:11 +0000 (19:20 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agolockmgr: start decomposing the main routine
mjg [Sun, 4 Mar 2018 19:12:54 +0000 (19:12 +0000)]
lockmgr: start decomposing the main routine

The main routine takes 8 args, 3 of which are almost the same for most uses.
This in particular pushes it above the limit of 6 arguments passable through
registers on amd64 making it impossible to tail call.

This is a prerequisite for further cleanups.

Tested by: pho

6 years agoStub kernel_param_lock() and kernel_param_unlock() in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:10:30 +0000 (19:10 +0000)]
Stub kernel_param_lock() and kernel_param_unlock() in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement wait_event_lock_irq() macro function in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:07:10 +0000 (19:07 +0000)]
Implement wait_event_lock_irq() macro function in the LinuxKPI.

MFC after: 1 week
Requested by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies

6 years agoFix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.
ian [Sun, 4 Mar 2018 18:58:24 +0000 (18:58 +0000)]
Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.

6 years agoKeep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI
hselasky [Sun, 4 Mar 2018 18:53:41 +0000 (18:53 +0000)]
Keep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI
to avoid compilation breakage in external kernel modules.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoImplement DEFINE_WAIT_FUNC() function macro and default_wake_function()
hselasky [Sun, 4 Mar 2018 18:51:43 +0000 (18:51 +0000)]
Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()
in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement pr_err_ratelimited() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:27:50 +0000 (18:27 +0000)]
Implement pr_err_ratelimited() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement __MODULE_STRING() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:21:21 +0000 (18:21 +0000)]
Implement __MODULE_STRING() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement BUILD_BUG() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:19:44 +0000 (18:19 +0000)]
Implement BUILD_BUG() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement writel_relaxed() in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:17:54 +0000 (18:17 +0000)]
Implement writel_relaxed() in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoDefine noinline and __maybe_unused macros in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:13:31 +0000 (18:13 +0000)]
Define noinline and __maybe_unused macros in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement for_each_clear_bit() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:10:18 +0000 (18:10 +0000)]
Implement for_each_clear_bit() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement GENMASK_ULL() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:08:21 +0000 (18:08 +0000)]
Implement GENMASK_ULL() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoRename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI
hselasky [Sun, 4 Mar 2018 18:04:37 +0000 (18:04 +0000)]
Rename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI
to be compatible with Linux.

MFC after: 1 week
Requested by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies

6 years agoopen.3: Use .Fa where appropriate
eadler [Sun, 4 Mar 2018 18:00:32 +0000 (18:00 +0000)]
open.3: Use .Fa where appropriate

Obtained From: DragonFlyBSD (78732326a796ca521f3c0fe33c6fc9c695742ede)

6 years agoFlag the first interface on a KTLINK FTDI-based jtag+uart device as being
ian [Sun, 4 Mar 2018 17:30:16 +0000 (17:30 +0000)]
Flag the first interface on a KTLINK FTDI-based jtag+uart device as being
the jtag port, so that a tty is not created for it.

This is based on information in the PR and from the vendor website.  When
the PR was first opened we had no facility for flagging the jtag ports.  I
stumbled across the still-open PR with the idea of closing it, and noticed
that this wee update was needed.

PR: 175893

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sun, 4 Mar 2018 17:06:37 +0000 (17:06 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 release (upstream r326565).

Release notes for llvm, clang and lld will be available here soon:
<http://releases.llvm.org/6.0.0/docs/ReleaseNotes.html>
<http://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/6.0.0/tools/lld/docs/ReleaseNotes.html>

Relnotes: yes
MFC after: 3 months
X-MFC-With: r327952
PR: 224669

6 years agodb_script_exec: use a saved script name when reporting commands executed
avg [Sun, 4 Mar 2018 13:27:21 +0000 (13:27 +0000)]
db_script_exec: use a saved script name when reporting commands executed

Before executing a command in a ddb script ddb prints an information
line of the form:
  db:1:my-script> command
where 1 is the script's depth level, "my-script" is the scipt's name,
and "command" is the current command in the script.
db_script_exec() uses its 'scriptname' parameter to produce that string.
In the case when db_script_exec() is called from db_run_cmd() the
argument points to db_tok_string that is a global variable used for
command parsing.  So, its value changes with every command executed.

This commit changes the code to use the script's name stored in
ds_scriptname to print the line.

MFC after: 2 weeks

6 years agoMention that CTLFLAG_MPSAFE is only for _PROC entries.
imp [Sun, 4 Mar 2018 06:19:41 +0000 (06:19 +0000)]
Mention that CTLFLAG_MPSAFE is only for _PROC entries.

6 years agoWhere we can, pass the kernel an FDT facsimile of the OF device tree rather
nwhitehorn [Sun, 4 Mar 2018 04:49:09 +0000 (04:49 +0000)]
Where we can, pass the kernel an FDT facsimile of the OF device tree rather
than a pointer to Open Firmware by default. This eliminates a number of
potentially unsafe calls to firmware from the kernel and provides better
performance.

This feature is meant to be expanded until it is on by default
unconditionally and, ideally, we can then garbage-collect the
nightmare pile of hacks required to call into Open Firmware from a live
kernel.

Reviewed by: jhibbits

6 years agolualoader: logdef -> logodef typo
kevans [Sun, 4 Mar 2018 03:23:19 +0000 (03:23 +0000)]
lualoader: logdef -> logodef typo

6 years agolualoader: Return meaningful value in cli_execute
kevans [Sun, 4 Mar 2018 03:21:12 +0000 (03:21 +0000)]
lualoader: Return meaningful value in cli_execute

loader.command(...) will return whatever the executed function returns, so
follow suit and return whatever loader.command() returned or whatever the
Lua function returns.

6 years agoAdd documentation for CTLFLAG_MPSAFE.
imp [Sun, 4 Mar 2018 03:13:13 +0000 (03:13 +0000)]
Add documentation for CTLFLAG_MPSAFE.

6 years agoWhen lld is ld, install bfd's man page as ld.bfd.1
emaste [Sun, 4 Mar 2018 01:37:49 +0000 (01:37 +0000)]
When lld is ld, install bfd's man page as ld.bfd.1

When WITH_LLD_IS_LD is set, lld's man page is installed as ld.1.gz, as
was GNU BFD's man page prior to this change.

Reported by: Tobias Kortkamp
Sponsored by: The FreeBSD Foundation

6 years agoMove "common" Open Firmware parts of the loader used only on PowerPC to
nwhitehorn [Sat, 3 Mar 2018 23:39:07 +0000 (23:39 +0000)]
Move "common" Open Firmware parts of the loader used only on PowerPC to
the powerpc/ subdirectory. These have never used by SPARC and we have
no other (and almost certainly will have no other) Open Firmware platforms.
This makes the directory structure simpler and lets us avoid some
cargo-cult MI patterns on code that is, and always was,
architecture-specific.

6 years agoDon't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.
bdrewery [Sat, 3 Mar 2018 23:23:23 +0000 (23:23 +0000)]
Don't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.

This is mostly to allow using MAKEOBJDIRPREFIX in src-env.conf on stable where
src.sys.obj.mk is not going to be MFC'd.  It is still valid on head but
effectively a NOP due to MAKEOBJDIRPREFIX being handled differently in
src.sys.obj.mk.

Reported by: eadler
MFC after: 1 week
Sponsored by: Dell EMC

6 years agoIgnore MAKEOBJDIRPREFIX from src-env.conf in sub-makes.
bdrewery [Sat, 3 Mar 2018 23:23:01 +0000 (23:23 +0000)]
Ignore MAKEOBJDIRPREFIX from src-env.conf in sub-makes.

A sub-make, such as in 'make buildworld', may want to override MAKEOBJDIRPREFIX
but is unable to do so if src-env.conf is forcing it to another value.  Without
using '?=' the sub-make may use the wrong .OBJDIR.

Reported by: eadler
Sponsored by: Dell EMC

6 years agoDocument pause_sig(9) and update prototypes for existing pause(9) and
hselasky [Sat, 3 Mar 2018 23:08:49 +0000 (23:08 +0000)]
Document pause_sig(9) and update prototypes for existing pause(9) and
pause_sbt(9) functions.

MFC after: 1 week
Suggested by: cem@
Sponsored by: Mellanox Technologies

6 years agoCorrect a misplaced closing paren. Does not affect the result, but does
ian [Sat, 3 Mar 2018 22:28:20 +0000 (22:28 +0000)]
Correct a misplaced closing paren.  Does not affect the result, but does
clarify (at least for me) that the multiplication happens before the shift.

6 years agoMinor (mostly) wording changes.
ian [Sat, 3 Mar 2018 22:10:16 +0000 (22:10 +0000)]
Minor (mostly) wording changes.

6 years agosys/linux: Fix a few potential infoleaks in cloudabi
eadler [Sat, 3 Mar 2018 21:50:55 +0000 (21:50 +0000)]
sys/linux: Fix a few potential infoleaks in cloudabi

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After: 1 month
Sponsored by: DARPA/AFRL

6 years agoMinor changes to wording.
ian [Sat, 3 Mar 2018 21:41:16 +0000 (21:41 +0000)]
Minor changes to wording.

6 years agosys/linux: Fix a few potential infoleaks in Linux IPC
eadler [Sat, 3 Mar 2018 21:14:55 +0000 (21:14 +0000)]
sys/linux: Fix a few potential infoleaks in Linux IPC

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After: 1 month

6 years agosys/fuse: fix off by one error
eadler [Sat, 3 Mar 2018 20:42:39 +0000 (20:42 +0000)]
sys/fuse: fix off by one error

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Domagoj Stolfa <domagoj.stolfa@gmail.com>

6 years agoUse mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits
hselasky [Sat, 3 Mar 2018 19:26:40 +0000 (19:26 +0000)]
Use mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits
of precision.

MFC after: 1 week
Suggested by: ian@
Sponsored by: Mellanox Technologies

6 years agoImplement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
hselasky [Sat, 3 Mar 2018 18:54:16 +0000 (18:54 +0000)]
Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
instead of pause() in the msleep() function to avoid rounding errors when
converting delay values forth and back. Add a guard for a delay value
of zero milliseconds which is undefined.

MFC after: 1 week
Requested by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies

6 years agoMove imx6_usbphy to SUPPORTDEV, massage associated comment
kevans [Sat, 3 Mar 2018 18:52:19 +0000 (18:52 +0000)]
Move imx6_usbphy to SUPPORTDEV, massage associated comment

No objections from: ian

6 years agoaw_syscon(4): Move to BUS_PASS_SUPPORTDEV
kevans [Sat, 3 Mar 2018 18:40:46 +0000 (18:40 +0000)]
aw_syscon(4): Move to BUS_PASS_SUPPORTDEV

It would have been on an actual named pass before, but none were really
appropriate in name. Move it to the recently created SUPPORTDEV pass, which
perfectly describes it and keeps it in the right order.

6 years agoAllow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
hselasky [Sat, 3 Mar 2018 18:36:38 +0000 (18:36 +0000)]
Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
Define pause_sig() function macro helper similarly to other kernel functions
which catch signals. Update outdated function description.

Discussed with: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoaw_mmc: Regulator improvement
manu [Sat, 3 Mar 2018 18:30:31 +0000 (18:30 +0000)]
aw_mmc: Regulator improvement

Getting regulator is good, enabling them is better.
When the mmc stack decide to change the voltage for IO, don't
change the main vcc of the sd/mmc, only the io vcc.

6 years agoaxp81x: Add support for AXP803
manu [Sat, 3 Mar 2018 18:28:19 +0000 (18:28 +0000)]
axp81x: Add support for AXP803

AXP803 and AXP813/818 are very similar, only two regulators differs.
AXP803 is the companion chip for A64/R18
AXP813 is the companion chip for A83T
AXP818 is the companion chip for H8 (~A83T)
Add support for all regulators found in both of them.

6 years agolualoader: Shift menu+brand even for logo=none with customized pos
kevans [Sat, 3 Mar 2018 18:25:50 +0000 (18:25 +0000)]
lualoader: Shift menu+brand even for logo=none with customized pos

6 years agolualoader: Tweak positioning and fix an off-by-one
kevans [Sat, 3 Mar 2018 18:13:14 +0000 (18:13 +0000)]
lualoader: Tweak positioning and fix an off-by-one

- All of our default positions were offset from forth
- Our menu frame size was smaller than in forth
- Logo/brand drawing had an off-by-one, drawing one column lower on the
  screen than they should have been.
- While here, switch a print() to printc() as it's expected that logos may
  contain color and other escpae sequences that we'll need to honor.

6 years agoCorrect the return code from pause() during cold startup from zero to
hselasky [Sat, 3 Mar 2018 18:12:21 +0000 (18:12 +0000)]
Correct the return code from pause() during cold startup from zero to
EWOULDBLOCK. This also matches the description in pause(9).

Discussed with: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agolualoader: Respect loader_menu_title_align
kevans [Sat, 3 Mar 2018 17:38:25 +0000 (17:38 +0000)]
lualoader: Respect loader_menu_title_align

It may be set to "left" or "right" -- any other value will cause the title
to be centered.

I've chosen to position these things just inside the vertical borders,
rather than overlapping the corners. This is an arbitrary choice and easily
amendable if this looks terrible.

6 years agolualoader: Respect loader_menu_title, prepare for align
kevans [Sat, 3 Mar 2018 17:25:49 +0000 (17:25 +0000)]
lualoader: Respect loader_menu_title, prepare for align

6 years agolualoader: Execute menu_timeout_command at the end of menu autoboot
kevans [Sat, 3 Mar 2018 17:18:40 +0000 (17:18 +0000)]
lualoader: Execute menu_timeout_command at the end of menu autoboot

Instead of hardcoding "boot", respect menu_timeout_command from Forth. It
still defaults to 'boot', so this will not be a functional change for most.

6 years agoliblua: Add loader.interpret
kevans [Sat, 3 Mar 2018 17:13:12 +0000 (17:13 +0000)]
liblua: Add loader.interpret

This allows lua to pass back a command string to be executed as if it were
typed at the loader prompt- loader tries to execute the string first as pure
lua, then parses it and gives lua a chance to intercept before it tries to
execute it itself.

This will be used to implement menu_timeout_command, among other things,
which *should* be used to execute basic loader commands independent of the
chosen interpreter.

6 years agodb_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
avg [Sat, 3 Mar 2018 15:10:37 +0000 (15:10 +0000)]
db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common

Since that change the system call stack traces look like this:
  ...
  sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0
  amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0
  fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0
So, db_nextframe() stopped recognizing the system call frame.
This commit should fix that.

Reviewed by: kib
MFC after: 4 days

6 years agoMove setting the IRQ base and length into the common GICv3 ITS attach
andrew [Sat, 3 Mar 2018 13:20:44 +0000 (13:20 +0000)]
Move setting the IRQ base and length into the common GICv3 ITS attach
function. This is common across both ACPI and FDT.

Sponsored by: ABT Systems Ltd
Sponsored by: Cavium (Hardware)

6 years agoAdd the missing GICv3 dev info struct to the ACPI dev info.Previously we
andrew [Sat, 3 Mar 2018 13:19:08 +0000 (13:19 +0000)]
Add the missing GICv3 dev info struct to the ACPI dev info.Previously we
would read from the resource list when querying from this.

Sponsored by: ABT Systems Ltd
Sponsored by: Cavium (Hardware)

6 years agoIntroduce BUS_PASS_SUPPORTDEV
manu [Sat, 3 Mar 2018 12:43:11 +0000 (12:43 +0000)]
Introduce BUS_PASS_SUPPORTDEV

The reason for this new pass is :

The earlier pass names are really specific (interrupt, timer, scheduler etc ..)
and making a driver that other device driver (that attach at DEFAULT pass)
needs probe at earlier pass can be confiusing. We can live with GPIO driver
at INTERRUPT pass because they are often an interrupt controller too but having
a usb phy driver probed at RESOURCES (or SCHEDULER for example) is silly.
The number was choosen to have a lot of margin if we want to introduce other
pass in the futur.

Reviewed by: ian, imp, kevans
Differential Revision: https://reviews.freebsd.org/D14568

6 years ago[fdt_pinctrl] Add man pages for fdt_pinctrl driver
gonzo [Sat, 3 Mar 2018 02:49:49 +0000 (02:49 +0000)]
[fdt_pinctrl] Add man pages for fdt_pinctrl driver

- Add fdt_pinctrl(4) with general information for the driver
- Add fdt_pinctrl(9) with fdt_pinctrl KPI description

Reviewed by: ian, manu, wblock
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14235

6 years agoHonor physical memory regions marked unavailable in the FDT, when present.
nwhitehorn [Sat, 3 Mar 2018 02:06:48 +0000 (02:06 +0000)]
Honor physical memory regions marked unavailable in the FDT, when present.
The most notable of these is the FDT itself, which it is a bad idea to
overwrite.