]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoadd valectl to the system commands
vmaffione [Thu, 31 Oct 2019 21:01:34 +0000 (21:01 +0000)]
add valectl to the system commands

The valectl(4) program is used to manage vale(4) switches.
Add it to the system commands so that it can be used right away.
This program was previously called vale-ctl, and stored in
tools/tools/netmap

Reviewed by: hrs, bcr, lwhsu, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22146

4 years agoavoid kernel stack data leak in core dump thrmisc note
emaste [Thu, 31 Oct 2019 20:42:36 +0000 (20:42 +0000)]
avoid kernel stack data leak in core dump thrmisc note

bzero the entire thrmisc struct, not just the padding.  Other core dump
notes are already done this way.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoAllow bsd.compat.mk to be reliably included outside Makefile.inc1.
brooks [Thu, 31 Oct 2019 20:37:19 +0000 (20:37 +0000)]
Allow bsd.compat.mk to be reliably included outside Makefile.inc1.

Replace explicit TARGET_* variables with COMPAT_* versions defined based
on where the file is being included.

Also, require that bsd.compat.mk be included directly. It's not going to
be widely used so always loading it in bsd.prog.mk doesn't make sense.
Instead users can include it directly.

Reviewed by:  imp, bdrewery (prior revision)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22059

4 years agoUpdate ENA version to v2.1.0
mw [Thu, 31 Oct 2019 16:03:43 +0000 (16:03 +0000)]
Update ENA version to v2.1.0

In this release the netmap support was introduced.

Moreover, it is also now possible to use the LLQ mode of the driver on
the arm64 AWS instances (A1 type).

Differential Revision: https://reviews.freebsd.org/D21938
Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoAdd support for ENA NETMAP partial initialization
mw [Thu, 31 Oct 2019 16:02:42 +0000 (16:02 +0000)]
Add support for ENA NETMAP partial initialization

In NETMAP mode not all queues need to be allocated to NETMAP. Some of
them could be left to the kernel. Configuration is managed by the flags
nr_mode and nr_pending_mode provided per each NETMAP kring.

ENA driver checks those flags and perform proper rings initialization.

Differential Revision: https://reviews.freebsd.org/D21937
Submitted by: Rafal Kozik <rk@semihalf.com>
              Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoAdd support for ENA NETMAP Tx
mw [Thu, 31 Oct 2019 15:59:29 +0000 (15:59 +0000)]
Add support for ENA NETMAP Tx

Two new tables are added to ena_tx_buffer structure:
* netmap_map_seg stores DMA mapping structures,
* netmap_buf_idx stores buff indexes taken from the slots.

When Tx resources are being set, the new mapping structures are created
and netmap Tx rings are being reset.

When Tx resources are being released, used netmap bufs are unmapped from
DMA and then mapping structures are destroyed.

When Tx interrupt occurrs, ena_netmap_tx_irq is called.

ena_netmap_txsync callback signalizes that there are new packets which
should be transmitted.
First, it fills ena_netmap_ctx. Then it performs two actions:
* ena_netmap_tx_frames moves packets from netmap ring to NIC,
* ena_netmap_tx_cleanup restores buffers from NIC and gives them back
to the userspace app.
0 is returned in case of Tx error that could be handled by the driver.

ena_netmap_tx_frames checks if there are packets ready for transmission.
Then, for each of them, ena_netmap_tx_frame is called. If error occurs,
transmitting is stopped, but if the error was cause due to HW ring being
full, information about that is not propagated to the userspace app.
When all packets are ready, doorbell is written to NIC and netmap ring
state is updated.

Parsing of one packet is done by the ena_netmap_tx_frame function.
First, it checks if number of slots does not exceed NIC limit. Invalid
packets are being dropped and the error is propagated to the upper
layer. As each netmap buffer has equal size, which is typically greater
then 2KiB, there shouldn't be any packets which contain too many slots.
Then, the ena_com_tx_ctx structure is being filled. As netmap does not
support any hardware offloads, ena_com_tx_meta structure is set to zero.
After that, ena_netmap_map_slots maps all memory slots for DMA.
If the device works in the LLQ mode, the push header is being determined
by checking if the header fits within the first socket.
If so, the portion of data is being copied directly from the slot.
In other case, the data is copied to the intermediate buffer.
First slots are treated the same as as the others, because DMA mapping
has no impact on LLQ mode. Index of each netmap buffer is taken from
slot and stored in netmap_buf_idx array. In case of mapping error,
memory is unmapped and packets are put back to the netmap ring.

ena_netmap_tx_cleanup performs out of order cleanup of sent buffers.
First, req_id is taken and is validated. As validate_tx_req_id from
ena.c is specific to kernels mbuf, another implementation is provided.
Each req_id is cleaned up by ena_netmap_tx_clean_one function. Buffers
are being unmaped from DMA and put back to netmap ring. In the end,
state of netmap and NIC rings are being updated.

Differential Revision: https://reviews.freebsd.org/D21936
Submitted by: Rafal Kozik <rk@semihalf.com>
              Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoAdd support for ENA NETMAP Rx
mw [Thu, 31 Oct 2019 15:57:44 +0000 (15:57 +0000)]
Add support for ENA NETMAP Rx

Most of code used for Rx ring initialization could be reused in NETMAP.
Reset of NETMAP ring and new alloc method was added. Driver decides if
use kernels mbufs or NETMAPs slots based on IFCAP_NETMAP flag. It
allows to reuse ena_refill_rx_bufs, which provides proper handling of
Rx out of order completion.

ena_netmap_alloc_rx_slot takes exactly the same arguments as
ena_alloc_rx_mbuf, but instead of allocating one mbuf it takes one slot
from NETMAP ring. Based on queue id proper netmap_ring is found. As
NETMAP provides the "partial opening" feature not all of the rings are
avaiable. Not used points to invalid ring. If there is available slot,
it is taken from the ring. Its buffer is mapped to DMA and its index is
stored in ena_rx_buffer field in ena_rx_buffer structure. Then ena_buf
is filled with addresses and ring state is updated.

Cleanup is handled by ena_netmap_free_rx_slot. It unmaps DMA and returns
buffer to ring. As we could not return more bufs than we have taken and
we should not override occupied slots, buf_index should be 0. It is
being checked by assertion.

ena_netmap_rxsync callback puts received packets back to NETMAP ring and
passes them to user space by updating ring pointers. First it fills
ena_netmap_ctx.
Then it performs two actions:
* ena_netmap_rx_frames moves received frames from NIC to NETMAP ring,
* ena_netmap_rx_cleanup fills NIC ring with slots released by userspace
app.

In case of Rx error that could be handled by NIC driver (for example by
performing reset) rx sync should return 0.

ena_netmap_rx_frames first checks if NETMAP ring is in consistent
state and then in the loop receives new frames. When all available
frames are taken nr_hwtail is updated.

Receiving one frame is handled by ena_netmap_rx_frame. If no error
occurrs, each Descriptor is loaded by ena_netmap_rx_load_desc function.
If packets take more than one segments NS_MOREFRAG flag must be set in
all, but not last slot. In case of wrong req_id packet is removed from
NETMAP ring. If packet is successful received counters are updated.

Refiling of NIC ring is performed by ena_netmap_rx_cleanup function.
It calculates number of available slots and call ena_refill_rx_bufs with
proper number.

Differential Revision: https://reviews.freebsd.org/D21935
Submitted by: Rafal Kozik <rk@semihalf.com>
              Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoIntroduce NETMAP support in ENA
mw [Thu, 31 Oct 2019 15:51:18 +0000 (15:51 +0000)]
Introduce NETMAP support in ENA

Mock implementation of NETMAP routines is located in ena_netmap.c/.h
files. All code is protected under the DEV_NETMAP macro. Makefile was
updated with files and flag.

As ENA driver provide own implementations of (un)likely it must be
undefined before including NETMAP headers.

ena_netmap_attach function is called on the end of NIC attach. It fills
structure with NIC configuration and callbacks. Then provides it to
netmap_attach. Similarly netmap_detach is called during ena_detach.

Three callbacks are used.
nm_register is implemented by ena_netmap_reg. It is called when user
space application open or close NIC in NETMAP mode. Current action is
recognized based on onoff parameter: true means on and false off. As
NICs rings need to be reconfigured ena_down and ena_up are reused.
When user space application wants to receive new packets from NIC
nm_rxsync is called, and when there are new packets ready for Tx
nm_txsync is called.

Differential Revision: https://reviews.freebsd.org/D21934
Submitted by: Rafal Kozik <rk@semihalf.com>
              Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoSplit Rx/Tx from initialization code in ENA driver
mw [Thu, 31 Oct 2019 15:44:26 +0000 (15:44 +0000)]
Split Rx/Tx from initialization code in ENA driver

Move Rx/Tx routines to separate file.
Some functions:
* ena_restore_device,
* ena_destroy_device,
* ena_up,
* ena_down,
* ena_refill_rx_bufs
could be reused in upcoming netmap code in the driver. To make it
possible, they were moved to ena.h header.

Differential Revision: https://reviews.freebsd.org/D21933
Submitted by:  Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoFix ENA keep-alive timeout due to prolonged reset
mw [Thu, 31 Oct 2019 15:39:54 +0000 (15:39 +0000)]
Fix ENA keep-alive timeout due to prolonged reset

When the ENA_FLAG_DEVICE_RUNNING flag is disabled, the AENQ handlers
aren't executed. To fix that, the watchdog timestamp should be updated
just before enabling the watchdog.

Timer service was always being enabled, even if the device wasn't up
before the reset. That shouldn't happen, as the timer service is being
executed only for working interface.

Differential Revision: https://reviews.freebsd.org/D21932
Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoAdd WC support for arm64 in the ENA driver
mw [Thu, 31 Oct 2019 15:38:17 +0000 (15:38 +0000)]
Add WC support for arm64 in the ENA driver

As the pmamp_change_attr() is public on arm64 since r351131, it can be
used on the arm64 to map memory range as with the write combined
attribute.

It requires the driver to use generic VM_MEMATTR_WRITE_COMBINING flag
instead of the x86 specific PAT_WRITE_COMBINING.

Differential Revision: https://reviews.freebsd.org/D21931
Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.

4 years agoFix pmap_change_attr() on arm64 to allow KV addresses
mw [Thu, 31 Oct 2019 15:16:10 +0000 (15:16 +0000)]
Fix pmap_change_attr() on arm64 to allow KV addresses

Altough in the comment above the pmap_change_attr() it was mentioned
that VA could be in KV or DMAP memory space. However,
pmap_change_attr_locked() was accepting only the values inside the DMAP
memory range.

To fix that, the condition check was changed so also the va inside the
KV memory range would be accepted.

The sample use case that wasn't supported is the PCI Device that has the
BAR which should me mapped with the Write Combine attribute - for
example BAR2 of the ENA network controller on the A1 instances on AWS.

Tested on A1 AWS instance and changed ENA BAR2 mapped resource to be
write-combined memory region.

Differential Revision: https://reviews.freebsd.org/D22055
MFC after: 2 weeks
Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

4 years agoFix a typo in r353895.
markj [Thu, 31 Oct 2019 14:22:54 +0000 (14:22 +0000)]
Fix a typo in r353895.

Reported by: andrew
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoFix GDB machdep code for PPC/PPC64
luporl [Thu, 31 Oct 2019 12:03:47 +0000 (12:03 +0000)]
Fix GDB machdep code for PPC/PPC64

There was a couple issues with GDB machdep code for PPC/PPC64, the main ones being:
- wrong register sizes being returned
- pcb_context index was wrong (this affects all PPC variants)

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D22201

4 years ago[PPC64] Fix trapstk overflow
luporl [Thu, 31 Oct 2019 11:59:00 +0000 (11:59 +0000)]
[PPC64] Fix trapstk overflow

In some scenarios, the 4K trapstk may overflow, corrupting tmpstk.

This was observed during remote debugging, with the following steps:

At remote host (R):
- enter kdb during boot
- switch to gdb backend

At local host (L):
- attach gdb to R
- try to read an invalid memory position

At R:
- a DSI trap occurs and kdb restarts (all this occurs on trapstk)
- while printing the stacktrace, trapstk overflows and corrupts tmpstk

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D22200

4 years agoiicbb: allow longer SCL low timeout and other improvements
avg [Thu, 31 Oct 2019 11:31:13 +0000 (11:31 +0000)]
iicbb: allow longer SCL low timeout and other improvements

First, SCL low timeout is set to 25 milliseconds by default as opposed
to 1 millisecond before.  The new value is based on the SMBus
specification.  The timeout can be changed on a per bus basis using
dev.iicbb.N.scl_low_timeout sysctl.

The driver uses DELAY to wait for high SCL up to 1 millisecond, then it
switches to pause_sbt(SBT_1MS) for the rest of the timeout.

While here I made a number of other changes.  'udelay' that's used for
timing clock and data signals is now calculated based on the requested
bus frequency (dev.iicbus.N.frequency) instead of being hardcoded to 10
microseconds.  The calculations are done in such a fashion that the
default bus frequency of 100000 is converted to udelay of 10 us.  This
is for backward compatibility.  The actual frequency will be less than a
quarter (I think) of the requested frequency.

Also, I added detection of stuck low SCL in a few places.  Previously,
the code would just carry on after the SCL low timeout and that might
potentially lead to misinterpreted bits.

Finally, I fixed several style issues near the code that I changed.
Many more are still remaining.

Tested by accessing HTU21 temperature and humidity sensor in this setup:
  superio0: <Nuvoton NCT5104D/NCT6102D/NCT6106D (rev. B+)> at port 0x2e-0x2f on isa0
  gpio1: <Nuvoton GPIO controller> at GPIO ldn 0x07 on superio0
  pcib0: allocated type 4 (0x220-0x226) for rid 0 of gpio1
  gpiobus1: <GPIO bus> on gpio1
  gpioiic0: <GPIO I2C bit-banging driver> at pins 14-15 on gpiobus1
  gpioiic0: SCL pin: 14, SDA pin: 15
  iicbb0: <I2C bit-banging driver> on gpioiic0
  iicbus0: <Philips I2C bus> on iicbb0 master-only
  iic0: <I2C generic I/O> on iicbus0

Discussed with: ian, imp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D22109

4 years agocxgbe(4): Use correct size while converting lpacaps32 to native
np [Thu, 31 Oct 2019 00:35:26 +0000 (00:35 +0000)]
cxgbe(4): Use correct size while converting lpacaps32 to native
endianness.

4 years agoiflib: cleanup memory leaks on driver detach
erj [Wed, 30 Oct 2019 20:45:12 +0000 (20:45 +0000)]
iflib: cleanup memory leaks on driver detach

From Jake:
The iflib stack failed to release all of the memory allocated under
M_IFLIB during device detach.

Specifically, the ifmp_ring, the ift_ifdi Tx DMA info, and the ifr_ifdi Rx
DMA info were not being released.

Release this memory so that iflib won't leak memory when a device
detaches.

Since we're freeing the ift_ifdi pointer during iflib_txq_destroy we
need to call this only after iflib_dma_free in iflib_tx_structures_free.

Additionally, also ensure that we destroy the callout mutex associated
with each Tx queue when we free it.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@, gallatin@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D22157

4 years agoUse the new cam_sim_alloc_dev function to properly initialize SIM
kibab [Wed, 30 Oct 2019 20:43:27 +0000 (20:43 +0000)]
Use the new cam_sim_alloc_dev function to properly initialize SIM

Using cam_sim_alloc_dev() allows to properly set sim_dev field so that
sdiob(4) can attach to the CAM device that represents SDIO card.
The same change for SDHCI driver happened in r348800.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D22192

4 years agoRemove redundant hw sysctl declaration. gcc CI complains, but clang doesn't.
imp [Wed, 30 Oct 2019 20:08:10 +0000 (20:08 +0000)]
Remove redundant hw sysctl declaration. gcc CI complains, but clang doesn't.

4 years agoMove all the sys/dev/[a-j]* that are common to files.x86
imp [Wed, 30 Oct 2019 19:53:46 +0000 (19:53 +0000)]
Move all the sys/dev/[a-j]* that are common to files.x86

All these device entries are common between the two files. Move them to
files.x86. Also sort entries from this range into proper order in files.amd64.

4 years agoRemove duplicate lines.
imp [Wed, 30 Oct 2019 19:53:37 +0000 (19:53 +0000)]
Remove duplicate lines.

4 years agoAdd firmware images for Intel 9000-series wifi chips.
markj [Wed, 30 Oct 2019 19:36:50 +0000 (19:36 +0000)]
Add firmware images for Intel 9000-series wifi chips.

This is in preparation for adding the corresponding support to iwm(4).

Version 46 is the latest but contains unrecognized TLVs, so use version
43 for now.

Obtained from: linux-firmware
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

4 years agovm_page_wire_mapped: explain why failure does not affect correctness.
kib [Wed, 30 Oct 2019 17:33:17 +0000 (17:33 +0000)]
vm_page_wire_mapped: explain why failure does not affect correctness.

Reviewed by: markj (previous version)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D22196

4 years agoSet the userspace execute never bit on kernel mappings.
andrew [Wed, 30 Oct 2019 17:32:35 +0000 (17:32 +0000)]
Set the userspace execute never bit on kernel mappings.

Arm64 allows us to create execute only mappings. To make sure userspace is
unable to accidentally execute kernel code set the user execute never
bit in the kernel page tables.

MFC after: 1 week
Sponsored by: DARPA, AFRL

4 years agoMake hyperv keyboard work again.
imp [Wed, 30 Oct 2019 17:18:11 +0000 (17:18 +0000)]
Make hyperv keyboard work again.

r351049 bogusly deleted these lines from files.amd64 but failed to add them to
files.x86. Since this works on i386, add them to files.x86 rather than just
adding them back to files.amd64.

PR: 240734
Reported by: Michael Pro

4 years agoow(4): clean up stray white space
avg [Wed, 30 Oct 2019 15:36:41 +0000 (15:36 +0000)]
ow(4): clean up stray white space

MFC after: 2 weeks

4 years agoARM64: Treat alignment faults as bus errors
jhibbits [Wed, 30 Oct 2019 15:30:40 +0000 (15:30 +0000)]
ARM64: Treat alignment faults as bus errors

Summary:
ARM64 currently treats all data abort exceptions as page faults.  This
can cause infinite loops on non-page fault faults, such as alignment faults.

Since kernel-side alignment faults should be avoided, this adds support directly
to the el0 fault handler, instead of the data_abort() handler.

Test Plan: Tested on rpi3, with a misaligned ldm test.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D22133

4 years agoow(4): protocol timings can now be changed as sysctl-s / tunables
avg [Wed, 30 Oct 2019 15:26:41 +0000 (15:26 +0000)]
ow(4): protocol timings can now be changed as sysctl-s / tunables

I limited potentially infinite timings by 960 us based on a footnote on
page 38 of Maxim Integrated Application Note 937, Book of iButton
Standards: "In order not to mask interrupt signalling by other devices
on the 1–Wire bus, tRSTL + tR should always be less than 960 us."

MFC after: 3 weeks

4 years agoow(4): increase regular mode recovery time, t_rec, to 15 us
avg [Wed, 30 Oct 2019 15:15:53 +0000 (15:15 +0000)]
ow(4): increase regular mode recovery time, t_rec, to 15 us

Previously we used the minimal value of 1 us and it was really tight.
Application Note 3829 has a table describing recommended t_rec values
for various bus voltages, temperature conditions and numbers of slave
devices.  The new value decreases the maximum possible data rate from
16.3 Kbit/s to 13.3 Kbit/s, but it allows for up to four slaves on a
3.3V bus (under room temperature).

References:
- Maxim Integrated Application Note 3829
  Determining the Recovery Time for Multiple-Slave 1-Wire(R) Networks

- Maxim Integrated Application Note 937
  Book of iButton Standards

Discussed with: imp (D22108)
MFC after: 3 weeks

4 years agoAllow exceptions to be masked when in userspace
andrew [Wed, 30 Oct 2019 14:05:50 +0000 (14:05 +0000)]
Allow exceptions to be masked when in userspace

We may want to mask exceptions when in userspace. This was previously
impossible as threads are created with all exceptions unmasked and
signals expected userspace to mask any. Fix these by copying the
mask state on thread creation and allow exceptions to be masked on
signal return, as long as they don't change.

Sponsored by: DARPA, AFRL

4 years agoAllow the userspace ID register fields to be read from the kernel
andrew [Wed, 30 Oct 2019 13:45:40 +0000 (13:45 +0000)]
Allow the userspace ID register fields to be read from the kernel

To allow consistent values to be used in both the kernel and userspace
create a function for these to be read from the kernel. They use a newly
created macro with the name of the ID register to read. For now there is
redundant information in the user_regs array as it still holds the CRm and
Op2 values, however this will be fixed in a later change.

This will be used by ptrace to allow hardware breakpoints in userspace.

Sponsored by: DARPA, AFRL

4 years agoUse a lowercase name for arm64 special registers so they don't conflict
andrew [Wed, 30 Oct 2019 12:47:00 +0000 (12:47 +0000)]
Use a lowercase name for arm64 special registers so they don't conflict
with macros of the same name.

Sponsored by: DARPA, AFRL

4 years agoMove the MRS instruction decode macros to armreg.h
andrew [Wed, 30 Oct 2019 12:33:36 +0000 (12:33 +0000)]
Move the MRS instruction decode macros to armreg.h

These instructions are used to access the registers described in armreg.h,
and will be used in a future change to create a per-register identification
macro.

Sponsored by: DARPA, AFRL

4 years agoUpdate the debug monitor handling to work after userspace has started
andrew [Wed, 30 Oct 2019 10:51:24 +0000 (10:51 +0000)]
Update the debug monitor handling to work after userspace has started

The debug monitor register state is now stored in a struct and updated
when required. Currently there is only a kernel state, however a
per-process state will be added in a future change.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22128

4 years agoUse an array of handlers in the data and instruction aborts
andrew [Wed, 30 Oct 2019 10:42:52 +0000 (10:42 +0000)]
Use an array of handlers in the data and instruction aborts

Previously we would call data_abort on all data and instruction aborts
however this is incorrect for most abort types. Move to use an array
of function pointers to allow for more handlers to be easily added.

Reviewed by: jhibbits
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22170

4 years agoFix the armv8 crypto driver after r354170.
andrew [Wed, 30 Oct 2019 10:41:10 +0000 (10:41 +0000)]
Fix the armv8 crypto driver after r354170.

Sponsored by: DARPA, AFRL

4 years agoThere's nothing architecture specific in "options STATS"; move it from
trasz [Wed, 30 Oct 2019 10:16:28 +0000 (10:16 +0000)]
There's nothing architecture specific in "options STATS"; move it from
sys/amd64/conf/NOTES to sys/conf/NOTES.

Suggested by: jhb@
Sponsored by: Klara Inc, Netflix

4 years agoAdd two files missed in r354170
andrew [Wed, 30 Oct 2019 10:13:14 +0000 (10:13 +0000)]
Add two files missed in r354170

Sponsored by: DARPA, AFRL

4 years agoRename the macros to extract a single arm64 ID field.
andrew [Wed, 30 Oct 2019 10:06:57 +0000 (10:06 +0000)]
Rename the macros to extract a single arm64 ID field.

Because of the previous naming scheme the old ID_AA64PFR0_EL1 macro
collided with a potential macro for the register of the same name. To fix
this collision rename these macros.

Sponsored by: DARPA, AFRL

4 years agoamd64: Fix typo: RDPRU bit is 0x10, not 0x04
cem [Wed, 30 Oct 2019 04:00:44 +0000 (04:00 +0000)]
amd64: Fix typo: RDPRU bit is 0x10, not 0x04

Bit 4 != 4, of course.

X-MFC-With: r354162

4 years agoamd64: Define and decode new AMD64 feature bits
cem [Wed, 30 Oct 2019 01:41:14 +0000 (01:41 +0000)]
amd64: Define and decode new AMD64 feature bits

These are documented in revisions 3.32 of the public AMD64 Vol. 2 and
revision 3.28 of Vol. 3, published October and September 2019, respectively.

4 years agoFreeBSD'fy ZFS zlib zalloc/zfree callbacks.
mav [Tue, 29 Oct 2019 21:25:19 +0000 (21:25 +0000)]
FreeBSD'fy ZFS zlib zalloc/zfree callbacks.

The previous code came from OpenSolaris, which in my understanding require
allocation size to be known to free memory.  To store that size previous
code allocated additional 8 byte header.  But I have noticed that zlib
with present settings allocates 64KB context buffers for each call, that
could be efficiently cached by UMA, but addition of those 8 bytes makes
them fall back to physical RAM allocations, that cause huge overhead and
lock congestion on small blocks.  Since FreeBSD's free() does not have
the size argument, switching to it solves the problem, increasing write
speed to ZVOLs with 4KB block size and GZIP compression on my 40-threads
test system from ~60MB/s to ~600MB/s.

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

4 years agoReplace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY
jeff [Tue, 29 Oct 2019 21:06:34 +0000 (21:06 +0000)]
Replace OBJ_MIGHTBEDIRTY with a system using atomics.  Remove the TMPFS_DIRTY
flag and use the same system.

This enables further fault locking improvements by allowing more faults to
proceed with a shared lock.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D22116

4 years agoUse atomics and a shared object lock to protect the object reference count.
jeff [Tue, 29 Oct 2019 20:58:46 +0000 (20:58 +0000)]
Use atomics and a shared object lock to protect the object reference count.

Certain consumers still need to guarantee a stable reference so we can not
switch entirely to atomics yet.  Exclusive lock holders can still modify
and examine the refcount without using the ref api.

Reviewed by: kib
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21598

4 years agoDrop the object lock earlier in fault and don't relock it after pmap_enter().
jeff [Tue, 29 Oct 2019 20:46:25 +0000 (20:46 +0000)]
Drop the object lock earlier in fault and don't relock it after pmap_enter().

Recent changes in object and page locking have enabled more lock pushdown.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D22036

4 years agoDrop the object lock in vfs_bio and cluster where it is now safe to do so.
jeff [Tue, 29 Oct 2019 20:37:59 +0000 (20:37 +0000)]
Drop the object lock in vfs_bio and cluster where it is now safe to do so.

Recent changes to busy/valid/dirty have enabled page based synchronization
and the object lock is no longer required in many cases.

Reviewed by: kib
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21597

4 years agoFix column title alignment.
trasz [Tue, 29 Oct 2019 20:28:02 +0000 (20:28 +0000)]
Fix column title alignment.

MFC after: 2 weeks

4 years agoarm64: rockchip: typec_phy: Rename timeout to retry
manu [Tue, 29 Oct 2019 18:36:16 +0000 (18:36 +0000)]
arm64: rockchip: typec_phy: Rename timeout to retry

Declare retry in the function scope.
Rename it to retry as there is a timeout function which was
causing to code to compile.

Reported by: jhibbits
MFC after: 1 month
X-MFC-WITH: r354089

4 years agolibexecinfo test: Don't strip installed test
cem [Tue, 29 Oct 2019 18:24:36 +0000 (18:24 +0000)]
libexecinfo test: Don't strip installed test

It turns out that a test of backtrace symbol resolution and formatting
requires symbols.  Another option mightt be building with -rdynamic instead,
but this works for now.

Re-enabled skipped CI test, as it should now pass.

PR: 241562
Submitted by: lwhsu
Reported by: lwhsu
X-MFC-With: r354126, r354135, r354144

4 years agoThere is a long standing problem with multicast programming for NICs
glebius [Tue, 29 Oct 2019 17:36:06 +0000 (17:36 +0000)]
There is a long standing problem with multicast programming for NICs
and IPv6.  With IPv6 we may call if_addmulti() in context of processing
of an incoming packet.  Usually this is interrupt context.  While most
of the NIC drivers are able to reprogram multicast filters without
sleeping, some of them can't.  An example is e1000 family of drivers.
With iflib conversion the problem was somewhat hidden.  Iflib processes
packets in private taskqueue, so going to sleep doesn't trigger an
assertion.  However, the sleep would block operation of the driver and
following incoming packets would fill the ring and eventually would
start being dropped.  Enabling epoch for the full time of a packet
processing again started to trigger assertions for e1000.

Fix this problem once and for all using a general taskqueue to call
if_ioctl() method in all cases when if_addmulti() is called in a
non sleeping context.  Note that nobody cares about returned value.

Reviewed by: hselasky, kib
Differential Revision:   https://reviews.freebsd.org/D22154

4 years agoMerge td_epochnest with td_no_sleeping.
glebius [Tue, 29 Oct 2019 17:28:25 +0000 (17:28 +0000)]
Merge td_epochnest with td_no_sleeping.

Epoch itself doesn't rely on the counter and it is provided
merely for sleeping subsystems to check it.

- In functions that sleep use THREAD_CAN_SLEEP() to assert
  correctness.  With EPOCH_TRACE compiled print epoch info.
- _sleep() was a wrong place to put the assertion for epoch,
  right place is sleepq_add(), as there ways to call the
  latter bypassing _sleep().
- Do not increase td_no_sleeping in non-preemptible epochs.
  The critical section would trigger all possible safeguards,
  no sleeping counter is extraneous.

Reviewed by: kib

4 years agoAugment macros that manipulate td_no_sleeping with assertions to check
glebius [Tue, 29 Oct 2019 17:19:36 +0000 (17:19 +0000)]
Augment macros that manipulate td_no_sleeping with assertions to check
underleak and overflow of the counter.

Reviewed by: kib

4 years agoPull in r373338 from upstream llvm trunk (by Simon Pilgrim):
dim [Tue, 29 Oct 2019 16:51:12 +0000 (16:51 +0000)]
Pull in r373338 from upstream llvm trunk (by Simon Pilgrim):

  Revert rL349624 : Let TableGen write output only if it changed,
  instead of doing so in cmake, attempt 2

  Differential Revision: https://reviews.llvm.org/D55842
  -----------------
  As discussed on PR43385 this is causing Visual Studio msbuilds to
  perpetually rebuild all tablegen generated files

Pull in r373664 from upstream llvm trunk (by Nico Weber):

  Reland r349624: Let TableGen write output only if it changed, instead
  of doing so in cmake

  Move the write-if-changed logic behind a flag and don't pass it with
  the MSVC generator. msbuild doesn't have a restat optimization, so
  not doing write-if-change there doesn't have a cost, and it should
  fix whatever causes PR43385.

This should fix the scenario where an incremental build from before
r353358 (the clang 9.0.0 upgrade) to r353358 or later fails to update
the timestamp of the generated lib/clang/headers/arm_fp16.h header.

After such a build, installing world from read-only source and object
directories would attempt to generate the header again, leading to
"clang-tblgen: error opening arm_fp16.h.d:Read-only file system".

Reported by: avg, np
PR: 241402
MFC after: 1 month
X-MFC-With: r353358

4 years agonetpfil tests: Add missing copyright & license statements
kp [Tue, 29 Oct 2019 09:47:12 +0000 (09:47 +0000)]
netpfil tests: Add missing copyright & license statements

4 years agoTemporarily disable failing case in CI:
lwhsu [Tue, 29 Oct 2019 04:28:24 +0000 (04:28 +0000)]
Temporarily disable failing case in CI:

- lib.libexecinfo.backtrace_test.backtrace_fmt_basic

PR: 241562
Sponsored by: The FreeBSD Foundation

4 years agoAdd device IDs for the next generation of Intel HDA audio.
scottl [Mon, 28 Oct 2019 23:31:22 +0000 (23:31 +0000)]
Add device IDs for the next generation of Intel HDA audio.

MFC after: 3 days

4 years agoGrammar fix.
jlh [Mon, 28 Oct 2019 21:48:20 +0000 (21:48 +0000)]
Grammar fix.

Reported by: imp
Differential Revision: https://reviews.freebsd.org/D21880

4 years agoDocument the fact that Linux binaries depend on pty(4).
trasz [Mon, 28 Oct 2019 21:22:46 +0000 (21:22 +0000)]
Document the fact that Linux binaries depend on pty(4).

The source part of the review will be addressed in a different way.

Reviewed by: emaste, brooks
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21492

4 years agoBuilding head on stable/11 requires libzstd
sjg [Mon, 28 Oct 2019 20:45:29 +0000 (20:45 +0000)]
Building head on stable/11 requires libzstd

Add lib/libzstd to _elftoolchain_libs

tools/build/Makefile needs to create the install dir for libzstd
Since this would make the line too long, rework to use a list
in one per line format (easier to add in future)
and dispense with the .for loop

Reviewed by: emaste bapt
Differential Revision: https://reviews.freebsd.org/D220134

4 years agonetmap: enter NET_EPOCH on generic txsync
vmaffione [Mon, 28 Oct 2019 19:00:27 +0000 (19:00 +0000)]
netmap: enter NET_EPOCH on generic txsync

After r353292, netmap generic adapter on if_vlan interfaces panics on
asserting the NET_EPOCH. In more detail, this happens when
nm_os_generic_xmit_frame() is called, that is in the generic txsync
routine.
Fix the issue by entering the NET_EPOCH during the generic txsync.
We amortize the cost of entering/exiting over a whole batch of
transmissions.

PR: 241489
Reported by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>

4 years agoRemove bogus requirement from libexecinfo test
cem [Mon, 28 Oct 2019 17:12:45 +0000 (17:12 +0000)]
Remove bogus requirement from libexecinfo test

The bogus requirement was causing CI infrastructure (which does not mount
procfs) to skip the test.  Procfs has not been needed by libexecinfo on
FreeBSD (nor NetBSD) for years.  Both now use a sysctl to obtain the path to
the current process image.

X-MFC-With: r354126

4 years agoFix reset of the kernel stack pointer in TSS for !PTI case on pmap activation
kib [Mon, 28 Oct 2019 10:50:37 +0000 (10:50 +0000)]
Fix reset of the kernel stack pointer in TSS for !PTI case on pmap activation
after r354095.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 years agoFollow r354121 to fix some python3 errors in sys.netpfil.*
lwhsu [Sun, 27 Oct 2019 21:07:50 +0000 (21:07 +0000)]
Follow r354121 to fix some python3 errors in sys.netpfil.*

stderr:

Traceback (most recent call last):
  File "/usr/tests/sys/netpfil/common/pft_ping.py", line 135, in <module>
    main()
  File "/usr/tests/sys/netpfil/common/pft_ping.py", line 124, in main
    ping(args.sendif[0], args.to[0], args)
  File "/usr/tests/sys/netpfil/common/pft_ping.py", line 74, in ping
    raw = sp.raw(str(PAYLOAD_MAGIC))
  File "/usr/local/lib/python3.6/site-packages/scapy/compat.py", line 52, in raw
    return bytes(x)
TypeError: string argument without an encoding

MFC with: r354121
Sponsored by: The FreeBSD Foundation

4 years agoRemove trailing tab.
cy [Sun, 27 Oct 2019 18:27:25 +0000 (18:27 +0000)]
Remove trailing tab.

MFC after: 3 days

4 years agoloader: zio_checksum_verify should check byteswap
tsoome [Sun, 27 Oct 2019 08:35:29 +0000 (08:35 +0000)]
loader: zio_checksum_verify should check byteswap

We do have both native and byteswap checksum callbacks in place but the
selection is not wired.

MFC after: 1 week

4 years agolibexecinfo: Integrate NetBSD test into FreeBSD
cem [Sun, 27 Oct 2019 05:32:08 +0000 (05:32 +0000)]
libexecinfo: Integrate NetBSD test into FreeBSD

4 years agoUpgrade (scapy) py2 tests to work on py3.
bz [Sat, 26 Oct 2019 21:19:55 +0000 (21:19 +0000)]
Upgrade (scapy) py2 tests to work on py3.

In order to move python2 out of the test framework to avoid py2 vs. py3
confusions upgrade the remaining test cases using scapy to work with py3.
That means only one version of scapy needs to be installed in the CI system.
It also gives a path forward for testing i386 issues observed in the CI
system with some of these tests.

Fixes are:
- Use default python from environment (which is 3.x these days).
- properly ident some lines as common for the rest of the file to avoid
  errors.
- cast the calculated offset to an int as the division result is considered
  a float which is not accepted input.
- when comparing payload to a magic number make sure we always add the
  payload properly to the packet and do not try to compare string in
  the result but convert the data payload back into an integer.
- fix print formating.

Discussed with: lwhsu, kp (taking it off his todo :)
MFC after: 2 weeks

4 years agoCommit missing file from r354116
asomers [Sat, 26 Oct 2019 19:20:59 +0000 (19:20 +0000)]
Commit missing file from r354116

Pointy-hat-to: Me
Reported by: Dan Mack
MFC after: 2 weeks
MFC-With: 354116

4 years agoloader: rs_alloc() may return NULL
tsoome [Sat, 26 Oct 2019 18:29:02 +0000 (18:29 +0000)]
loader: rs_alloc() may return NULL

rs_alloc() in zfs reader code may return NULL, so we need to check the return value and error out if needed.
MFC after: 1 week

4 years agoProvide dummy definition of the amd64 struct pcb for -m32 compilation.
kib [Sat, 26 Oct 2019 18:22:52 +0000 (18:22 +0000)]
Provide dummy definition of the amd64 struct pcb for -m32 compilation.

I do not see a need in the proper x86/include/pcb.h header.

Reported and tested by: antoine
MFC after: 1 week

4 years agoarm64: rockchip: dts: Build the Khadas board DTS
manu [Sat, 26 Oct 2019 17:51:43 +0000 (17:51 +0000)]
arm64: rockchip: dts: Build the Khadas board DTS

We boot on thoses boards so build them.

Submitted by: s199p.wa1k9r@gmail.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22158

4 years agoMFZoL: Avoid retrieving unused snapshot props
asomers [Sat, 26 Oct 2019 17:11:02 +0000 (17:11 +0000)]
MFZoL:  Avoid retrieving unused snapshot props

This patch modifies the zfs_ioc_snapshot_list_next() ioctl to enable it
to take input parameters that alter the way looping through the list of
snapshots is performed. The idea here is to restrict functions that
throw away some of the snapshots returned by the ioctl to a range of
snapshots that these functions actually use. This improves efficiency
and execution speed for some rollback and send operations.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
Closes #8077
zfsonlinux/zfs@4c0883fb4af0d5565459099b98fcf90ecbfa1ca1

MFC after: 2 weeks

4 years agodtc: Allow multiple dts-v1 tag
manu [Sat, 26 Oct 2019 17:10:27 +0000 (17:10 +0000)]
dtc: Allow multiple dts-v1 tag

Some dts are including dtsi that also contain a /dts-v1/ tag at the
top. GNU DTC doesn't seems to have a problem with that so fix our
dtc to behave the same.

Reviewed by: kevans
MFC after: 1 week

4 years agoSync up with NetBSD libexecinfo changes 2014-2019
cem [Sat, 26 Oct 2019 06:59:59 +0000 (06:59 +0000)]
Sync up with NetBSD libexecinfo changes 2014-2019

Drop portions that are unlit or redundant with llvm-libunwind: builtin.c,
unwind.h, and unwind_arm_ehabi_stub.c.

This code should now work with -fPIE binaries, should we choose to build any
that way.

When backtrace() array is full, signal an error so the underlying
Itanium-style C++ exception handling library (llvm-libunwind) knows to stop
tracing instead of continuing.  (It should stop on its own when it finishes
unwinding, so this is mostly an extra seatbelt against an infinite loop bug
in the unwinder.)

4 years agoFix typo in cxgbe.4.
np [Fri, 25 Oct 2019 22:39:26 +0000 (22:39 +0000)]
Fix typo in cxgbe.4.

MFC after: 1 week

4 years agocxgbe(4): Use correct FetchBurstMin values for T6.
np [Fri, 25 Oct 2019 21:53:05 +0000 (21:53 +0000)]
cxgbe(4): Use correct FetchBurstMin values for T6.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoRISC-V: skip cpu-map when parsing elf_hwcap
mhorne [Fri, 25 Oct 2019 21:39:29 +0000 (21:39 +0000)]
RISC-V: skip cpu-map when parsing elf_hwcap

The fill_elf_hwcap() function expects to find only cpu nodes under the
/cpus entry of the device tree. Newer versions of QEMU insert a cpu-map
node which describes the CPU topology, breaking this function. To fix
this, simply skip any non-cpu entries.

Reviewed by: markj, kp, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22151

4 years agoarm64: rk3399: add SPI driver and include it in GENERIC config
gonzo [Fri, 25 Oct 2019 21:38:38 +0000 (21:38 +0000)]
arm64: rk3399: add SPI driver and include it in GENERIC config

SPI driver for Rockchip's RK3399 SoC. Implements PIO mode, CS selection,
SPI mode and frequency configuration.

Reviewed by: manu
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D22148

4 years agoArgs for buf_track() might be unused
rpokala [Fri, 25 Oct 2019 21:32:28 +0000 (21:32 +0000)]
Args for buf_track() might be unused

If neither FULL_BUF_TRACKING nor BUF_TRACKING are defined, then the body of
buf_track() becomes empty. Mark the arguments with "__unused" so the
compiler doesn't complain about unused arguments in that case.

Reported by: Bruce Leverett (Panasas)
Reviewed by: cem (on IRC)
MFC after: 1 month
Sponsored by: Panasas

4 years agoarm64: rk3399: Add clock and gate for SPI clocks
gonzo [Fri, 25 Oct 2019 21:21:21 +0000 (21:21 +0000)]
arm64: rk3399: Add clock and gate for SPI clocks

MFC after: 1 month

4 years agoPull in r372186 from upstream llvm trunk (by Eli Friedman):
dim [Fri, 25 Oct 2019 21:00:49 +0000 (21:00 +0000)]
Pull in r372186 from upstream llvm trunk (by Eli Friedman):

  [ARM] VFPv2 only supports 16 D registers.

  r361845 changed the way we handle "D16" vs. "D32" targets; there used
  to be a negative "d16" which removed instructions from the
  instruction set, and now there's a "d32" feature which adds
  instructions to the instruction set.  This is good, but there was an
  oversight in the implementation: the behavior of VFPv2 was changed.
  In particular, the "vfp2" feature was changed to imply "d32". This is
  wrong: VFPv2 only supports 16 D registers.

  In practice, this means if you specify -mfpu=vfpv2, the compiler will
  generate illegal instructions.

  This patch gets rid of "vfp2d16" and "vfp2d16sp", and fixes "vfp2"
  and "vfp2sp" so they don't imply "d32".

  Differential Revision: https://reviews.llvm.org/D67375

Pull in r372187 from upstream clang trunk (by Eli Friedman):

  [ARM] Update clang for removal of vfp2d16 and vfp2d16sp

  Matching fix for https://reviews.llvm.org/D67375 (r372186).

  Differential Revision: https://reviews.llvm.org/D67467

This should fix clang generating invalid opcodes for floating point
operations on armv6.

Requested by: mmel
MFC after: 3 days

4 years agoApply kernel module linker scripts to firmware files.
markj [Fri, 25 Oct 2019 20:15:04 +0000 (20:15 +0000)]
Apply kernel module linker scripts to firmware files.

Use a separate make variable to specify the linker script so that it is
only applied at link time and not during intermediate generation of .fwo
files.

This ensures that the .text padding inserted by the amd64 linker script
is applied to the stub module load handlers embedded in firmware
modules.

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

4 years agoamd64: move pcb out of kstack to struct thread.
kib [Fri, 25 Oct 2019 20:09:42 +0000 (20:09 +0000)]
amd64: move pcb out of kstack to struct thread.

This saves 320 bytes of the precious stack space.

The only negative aspect of the change I can think of is that the
struct thread increased by 320 bytes obviously, and that 320 bytes are
not swapped out anymore. I believe the freed stack space is much more
important than that.  Also, current struct thread size is 1392 bytes
on amd64, so UMA will allocate two thread structures per (4KB) slab,
which leaves a space for pcb without increasing zone memory use.

Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D22138

4 years agoFix use of uninitialised variable.
peterj [Fri, 25 Oct 2019 19:38:02 +0000 (19:38 +0000)]
Fix use of uninitialised variable.

The RK805 regs array was being allocated before it's required size was
known, causing the driver to use memory it didn't own.  That memory
was subsequently allocated and used elsewhere causing later fatal data
aborts in rk805_map().

Whilst I'm here, add a sanity check to catch unsupported PMICs (this
shouldn't ever get hit because the probe should have failed).

Reviewed by: manu
MFC after: 1 week
Sponsored by: Google

4 years agoProperly set VNET when nuking recvif from fragment queues.
bz [Fri, 25 Oct 2019 18:54:06 +0000 (18:54 +0000)]
Properly set VNET when nuking recvif from fragment queues.

In theory the eventhandler invoke should be in the same VNET as
the the current interface. We however cannot guarantee that for
all cases in the future.

So before checking if the fragmentation handling for this VNET
is active, switch the VNET to the VNET of the interface to always
get the one we want.

Reviewed by: hselasky
MFC after: 3 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D22153

4 years agoarm64: rockchip: Add RK3399 TypeC phy driver
manu [Fri, 25 Oct 2019 18:10:02 +0000 (18:10 +0000)]
arm64: rockchip: Add RK3399 TypeC phy driver

This is a driver for the USB3 PHY present in the RK3399.
While the phy support DP (Display Port) the driver doesn't has we have
no driver to test this with for now.
All the lane and pll configuration is just magic values from rockchip.
While the manual have some info on those registers it's really hard to
understand how to calculate those values (if there is a way).

MFC after: 1 month

4 years agoarm64: rockchip: Add rk_dwc3 driver
manu [Fri, 25 Oct 2019 18:08:59 +0000 (18:08 +0000)]
arm64: rockchip: Add rk_dwc3 driver

This is a simplebus like driver that attaches the dwc3 child node and
enable the clocks needed for the module.

MFC after: 1 month

4 years agoarm64: rk3399: Add clock and gate for usb3 clocks
manu [Fri, 25 Oct 2019 18:08:25 +0000 (18:08 +0000)]
arm64: rk3399: Add clock and gate for usb3 clocks

MFC after: 1 month

4 years agoflash: Add GigaDevice gd25q128 flash
manu [Fri, 25 Oct 2019 17:56:24 +0000 (17:56 +0000)]
flash: Add GigaDevice gd25q128 flash

Add this flash chip which is a 128Mb spi flash.

MFC after: 1 week

4 years agofrag6-test: update for r354046, conform to 8200 for overlapping fragments
bz [Fri, 25 Oct 2019 17:41:08 +0000 (17:41 +0000)]
frag6-test:  update for r354046, conform to 8200 for overlapping fragments

The change to conform to RFC 8200 for overlapping fragments now frees
the entire reassembly queue if the overlapping fragments are not an
exact match.
As a result we do see one less packet in the timeout statistics from
expiry.  No other statistics change as the event is not counted.
It can be argued that we should improve the statistics counters in
that case.
This test case update should have been committed alongside the original
commit.

Pointyhat to: bz
MFC after: 3 weeks
X-MFC with: r354046
Sponsored by: Netflix

4 years agoAdd couple more assertions to vm_pager_assert_in(). The bogus page is
glebius [Fri, 25 Oct 2019 16:59:54 +0000 (16:59 +0000)]
Add couple more assertions to vm_pager_assert_in().  The bogus page is
not allowed at ends of the request, and all non-bogus pages must be
consecutive.

Reviewed by: kib

4 years agosuperio: do not crash if failed to create the character device
avg [Fri, 25 Oct 2019 16:30:24 +0000 (16:30 +0000)]
superio: do not crash if failed to create the character device

MFC after: 1 week

4 years agofrag6: do not leak counter in error cases
bz [Fri, 25 Oct 2019 16:29:09 +0000 (16:29 +0000)]
frag6: do not leak counter in error cases

When allocating the IPv6 fragement packet queue entry we do checks
against counters and if we pass we increment one of the counters
to claim the spot.  Right after that we have two cases (malloc and MAC)
which can both fail in which case we free the entry but never released
our claim on the counter.  In theory this can lead to not accepting new
fragments after a long time, especially if it would be MAC "refusing"
them.
Rather than immediately subtracting the value in the error case, only
increment it after these two cases so we can no longer leak it.

MFC after: 3 weeks
Sponsored by: Netflix

4 years agosuperio_io.h: fix the copyright
avg [Fri, 25 Oct 2019 16:28:39 +0000 (16:28 +0000)]
superio_io.h: fix the copyright

MFC after: 1 week

4 years agosuperio: add a simple ioctl interface
avg [Fri, 25 Oct 2019 16:07:24 +0000 (16:07 +0000)]
superio: add a simple ioctl interface

MFC after: 1 week

4 years agoowc_gpiobus: add missing space in r354077
avg [Fri, 25 Oct 2019 15:46:54 +0000 (15:46 +0000)]
owc_gpiobus: add missing space in r354077

4 years agoowc_gpiobus_read_data: add recovery time to the read slot
avg [Fri, 25 Oct 2019 15:39:46 +0000 (15:39 +0000)]
owc_gpiobus_read_data: add recovery time to the read slot

Reviewed by: imp
MFC after: 2 weeks

4 years agoowc_gpiobus_read_data: compare times in sbintime_t units
avg [Fri, 25 Oct 2019 15:38:09 +0000 (15:38 +0000)]
owc_gpiobus_read_data: compare times in sbintime_t units

Previously the code used sbttous() before microseconds comparison in one
place, sbttons() and nanoseconds in another, division by SBT_1US and
microseconds in yet another.

Now the code consistently uses multiplication by SBT_1US to convert
microseconds to sbintime_t before comparing them with periods between
calls to sbinuptime().  This is fast, this is precise enough (below
0.03%) and the periods defined by the protocol cannot overflow.

Reviewed by: imp (D22108)
MFC after: 2 weeks

4 years agoRemove the arm4 ID register masks, they are not needed after r353641.
andrew [Fri, 25 Oct 2019 14:46:09 +0000 (14:46 +0000)]
Remove the arm4 ID register masks, they are not needed after r353641.

Sponsored by: DARPA, AFRL