Commit graph

232559 commits

Author SHA1 Message Date
Emmanuel Vadot d411a1b82c aw_spi: Fix manpages
Somehow two copies of the man was in the file, remove one.
Replace an occurence of 'SD/MMC' that was left from copy/paste.
Remove space before ':'

Reported by:	0mp
2018-05-17 11:53:04 +00:00
Emmanuel Vadot dbb434b19f aw_spi: Add manpage for this driver 2018-05-17 10:25:49 +00:00
Emmanuel Vadot de80d00f0f alwinner: Add missing files in r333708 2018-05-17 10:25:01 +00:00
Emmanuel Vadot 3076898a56 allwinner: Add h3 spi driver
This driver is compatible with H3/H5/A64.
Test was done on the OrangePi-PC2 board (H5 based), which have a mx25l1606e
spi flash on it, by writing u-boot image, reading it and booting from the spi.
There is still room for improvement especially on reading using the controller
automatic burst which will avoid us to write dummy data to the TX FIFO.
DMA is also not supported as we currently don't support the DMA controller on
those SoCs
Only add a kernel module for it.
2018-05-17 10:19:52 +00:00
Andriy Gapon 7973b47369 fix a problem with bad performance after wakeup caused by r333321
This change reverts a "while here" part of r333321 that moved clearing
of suspended_cpus to an earlier place.

Apparently, there can be a problem when modifying (shared) memory before
restoring proper cache attributes.  So, to be safe, move the clearing to
the old place.

Many thanks to Johannes Lundberg for bisecting the changes to that
particular commit and then bisecting the commit to the particular
change.

Reported by:	many
Debugged by:	Johannes Lundberg <johalun0@gmail.com>
MFC after:	1 week
X-MFC with:	r333321
2018-05-17 10:16:20 +00:00
Emmanuel Vadot bb5125a411 mx25l: Add mx25l1606e
This is a 16Mbits spi flash arranged in 32x64k blocks or 512x4k
sectors.
2018-05-17 10:13:18 +00:00
Navdeep Parhar d88a0442bb cxgbe(4): Fix s->neq miscalculation in r333698. 2018-05-17 06:04:50 +00:00
Mark Johnston ba2b3349e1 Fix a race in vm_page_pagequeue_lockptr().
The value of m->queue must be cached after comparing it with PQ_NONE,
since it may be concurrently changing.

Reported by:	glebius
Reviewed by:	jeff
Differential Revision:	https://reviews.freebsd.org/D15462
2018-05-17 04:27:08 +00:00
Mark Johnston b35822d9d0 Fix netdump configuration when VIMAGE is enabled.
We need to set the current vnet before iterating over the global
interface list. Because the dump device may only be set from the host,
only proceed with configuration if the thread belongs to the default
vnet. [1]

Also fix a resource leak that occurs if the priv_check() in set_dumper()
fails.

Reported by:	mmacy, sbruno [1]
Reviewed by:	sbruno
X-MFC with:	r333283
Differential Revision:	https://reviews.freebsd.org/D15449
2018-05-17 04:08:57 +00:00
Matt Macy 73e37d1deb Fix powerpc64 LINT
vm_object_reserve() == true is impossible on power. Make conditional
on VM_LEVEL_0_ORDER being defined.

Reviewed by:	jeff
Approved by:	sbruno
2018-05-17 03:19:31 +00:00
Matt Macy 03b7d7a3c3 Fix i386 build
Move epoch_section to after td_emuldata, but note the 3 surrounding LP64 holes
while I'm here.

Approved by:	sbruno
2018-05-17 02:54:30 +00:00
Lawrence Stewart 9891578a40 Plug a memory leak and potential NULL-pointer dereference introduced in r331214.
Each TCP connection that uses the system default cc_newreno(4) congestion
control algorithm module leaks a "struct newreno" (8 bytes of memory) at
connection initialisation time. The NULL-pointer dereference is only germane
when using the ABE feature, which is disabled by default.

While at it:

- Defer the allocation of memory until it is actually needed given that ABE is
  optional and disabled by default.

- Document the ENOMEM errno in getsockopt(2)/setsockopt(2).

- Document ENOMEM and ENOBUFS in tcp(4) as being synonymous given that they are
  used interchangeably throughout the code.

- Fix a few other nits also accidentally omitted from the original patch.

Reported by:	Harsh Jain on freebsd-net@
Tested by:	tjh@
Differential Revision:	https://reviews.freebsd.org/D15358
2018-05-17 02:46:27 +00:00
Navdeep Parhar eff62dba61 cxgbe(4): Allocate offload Tx queues when a card has resources
provisioned for NIC_ETHOFLD and the kernel has option RATELIMIT.

It is possible to use the chip's offload queues for normal NIC Tx and
not just TOE Tx.  The difference is that these queues support out of
order processing of work requests and have a per-"flowid" mechanism for
tracking credits between the driver and hardware.  This allows Tx for
any number of flows bound to different rate limits to be submitted to a
single Tx queue and the work requests for slow flows won't cause HOL
blocking for the rest.

Sponsored by:	Chelsio Communications
2018-05-17 01:42:18 +00:00
Matt Macy fdf71aeb54 epoch(9): make recursion lighter weight
There isn't any real work to do except bump td_epochnest when recursing.
Skip the additional work in this case.

Approved by:	sbruno
2018-05-17 01:13:40 +00:00
Navdeep Parhar 93c0bfb85b cxgbe(4): Add NIC_ETHOFLD to the NIC capabilities allowed by the driver
by default.

This is the first of a series of commits that will add support for
RATELIMIT kernel option to the base if_cxgbe driver, for use with
ordinary NIC traffic "flows".  RATELIMIT is already supported by t4_tom
for the fully-offloaded TCP connections that it handles.

Sponsored by:	Chelsio Communications
2018-05-17 00:52:48 +00:00
Matt Macy b8205686b4 epoch(9): Guarantee forward progress on busy sections
Add epoch section to struct thread. We can use this to
ennable epoch counter to advance even if a section is
perpetually occupied by a thread.

Approved by:	sbruno
2018-05-17 00:45:35 +00:00
Kirk McKusick 8ab507588b Fix warning found by Coverity.
CID 1009353:  Error handling issues  (CHECKED_RETURN)
2018-05-16 23:42:02 +00:00
Kirk McKusick 4111ab7088 Revert change made in base r171522
(https://svnweb.freebsd.org/base?view=revision&revision=304232)
converting clrbuf() (which clears the entire buffer) to vfs_bio_clrbuf()
(which clears only the new pages that have been added to the buffer).

Failure to properly remove pages from the buffer cache can make
pages that appear not to need clearing to actually have bad random
data in them. See for example base r304232
(https://svnweb.freebsd.org/base?view=revision&revision=304232)
which noted the need to set B_INVAL and B_NOCACHE as well as clear
the B_CACHE flag before calling brelse() to release the buffer.

Rather than trying to find all the incomplete brelse() calls, it
is simpler, though more slightly expensive, to simply clear the
entire buffer when it is newly allocated.

PR: 213507
Submitted by: Damjan Jovanovic
Reviewed by:  kib
2018-05-16 23:30:03 +00:00
Matt Macy 6161b98c99 hwpmc: Implement per-thread counters for PMC sampling
This implements per-thread counters for PMC sampling. The thread
descriptors are stored in a list attached to the process descriptor.
These thread descriptors can store any per-thread information necessary
for current or future features. For the moment, they just store the counters
for sampling.

The thread descriptors are created when the process descriptor is created.
Additionally, thread descriptors are created or freed when threads
are started or stopped. Because the thread exit function is called in a
critical section, we can't directly free the thread descriptors. Hence,
they are freed to a cache, which is also used as a source of allocations
when needed for new threads.

Approved by:	sbruno
Obtained from:	jtl
Sponsored by:	Juniper Networks, Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15335
2018-05-16 22:29:20 +00:00
Matt Macy 2aa6f526de Fix !netmap build post r333686
Approved by:	sbruno
2018-05-16 22:25:47 +00:00
Warner Losh 6e258ed363 2018 this time. 2018-05-16 21:07:12 +00:00
Stephen Hurd 5ee36c68e1 Work around lack of TX IRQs in iflib for netmap
When poll() is called via netmap, txsync is initially called,
and if there are no available buffers to reclaim, it waits for the driver
to notify of new buffers. Since the TX IRQ is generally not used in iflib
drivers, this ends up causing a timeout.

Work around this by having the reclaim DELAY(1) if it's initially unable
to reclaim anything, then schedule the tx task, which will spin by
continuously rescheduling itself until some buffers are reclaimed. In
general, the delay is enough to allow some buffers to be reclaimed, so
spinning is minimized.

Reported by:	Johannes Lundberg <johalun0@gmail.com>
Reviewed by:	sbruno
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15455
2018-05-16 21:03:22 +00:00
Edward Tomasz Napierala 57b1f8183c Set label when setting up USB LUNs, it looks nicer this way.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-16 20:44:08 +00:00
Edward Tomasz Napierala 463b6ed54f Change the cfumass rc script to stop pretending the USB LUN is a virtual
CD; for some reason OSX can't deal with it.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-16 20:39:15 +00:00
Conrad Meyer 4812c5c5e4 teken: Unbreak syscons' use of teken
Only vt(4) initializes these callbacks non-NULL at this time, so invoke the
function pointers conditionally.

Broken in r333669.

Submitted by:	bde@
2018-05-16 18:12:49 +00:00
Navdeep Parhar 47ae7a7e4f cxgbe(4): Fall back to a failsafe configuration built into the firmware
if an error is reported while pre-processing the configuration file that
the driver attempted to use.

Also, allow the user to explicitly use the built-in configuration with
hw.cxgbe.config_file="built-in"

MFC after:	2 days
Sponsored by:	Chelsio Communications
2018-05-16 17:55:16 +00:00
John Baldwin 964b24b42d Include kernel modules for MALTA kernels.
Sponsored by:	DARPA / AFRL
2018-05-16 17:54:40 +00:00
Marko Zec cf103f7ef1 A belated note crediting the FreeBSD Foundation for sponsoring
technical work circa ten years ago...

MFC after:	3 days
2018-05-16 16:57:11 +00:00
John Baldwin ca75fa17ee Export a breakpoint() function to userland for riscv.
As a result, enable tests using breakpoint() on riscv.

Reviewed by:	br
Differential Revision:	https://reviews.freebsd.org/D15191
2018-05-16 16:56:35 +00:00
Dag-Erling Smørgrav f2a2dfa729 Merge upstream patch to unbreak tunnel forwarding.
Reported by:	cy@
2018-05-16 14:04:39 +00:00
Dag-Erling Smørgrav 3d0e42005d Import upstream commit cfb1d9b, which fixes tunnel forwarding. 2018-05-16 13:59:58 +00:00
Warner Losh eb8831b95c Add note about LD=ld.lld being a temporary requirement when building
the kernel the traditional way.
2018-05-16 13:52:24 +00:00
Dag-Erling Smørgrav 716eff476a Forward Reply-Message attributes to the user, unless suppressed by the
new no_reply_message option.

MFC after:	1 week
Sponsored by:	The University of Oslo
2018-05-16 13:47:30 +00:00
Ed Maste c9a1264c61 Clean up vt source whitespace issues 2018-05-16 11:19:03 +00:00
Jean-Sébastien Pédron 4e5a8fdbff vt(4): Resume vt_timer() in vtterm_post_input() only
There is no need to try to resume it after each smaller operations
(putchar, cursor_position, copy, fill).

The resume function already checks if the timer is armed before doing
anything, but it uses an atomic cmpset which is expensive. And resuming
the timer at the end of input processing is enough.

While here, we also skip timer resume if the input is for another
windows than the currently displayed one. I.e. if `ttyv0` is currently
displayed, any changes to `ttyv1` shouldn't resume the timer (which
would refresh `ttyv0`).

By doing the same benchmark as r333669, I get:
  * vt(4), before r333669:  1500 ms
  * vt(4), with this patch:  760 ms
  * syscons(4):              700 ms
2018-05-16 10:08:50 +00:00
Jean-Sébastien Pédron 547e74a8be teken, vt(4): New callbacks to lock the terminal once
... to process input, instead of inside each smaller operations such as
appending a character or moving the cursor forward.

In other words, before we were doing (oversimplified):

  teken_input()
    <for each input character>
      vtterm_putchar()
        VTBUF_LOCK()
        VTBUF_UNLOCK()
      vtterm_cursor_position()
        VTBUF_LOCK()
        VTBUF_UNLOCK()

Now, we are doing:

  vtterm_pre_input()
    VTBUF_LOCK()
  teken_input()
    <for each input character>
      vtterm_putchar()
      vtterm_cursor_position()
  vtterm_post_input()
    VTBUF_UNLOCK()

The situation was even worse when the vtterm_copy() and vtterm_fill()
callbacks were involved.

The new callbacks are:
  * struct terminal_class->tc_pre_input()
  * struct terminal_class->tc_post_input()

They are called in teken_input(), surrounding the while() loop.

The goal is to improve input processing speed of vt(4). As a benchmark,
here is the time taken to write a text file of 360 000 lines (26 MiB) on
`ttyv0`:

  * vt(4), unmodified:      1500 ms
  * vt(4), with this patch: 1200 ms
  * syscons(4):              700 ms

This is on a Haswell laptop with a GENERIC-NODEBUG kernel.

At the same time, the locking is changed in the vt_flush() function
which is responsible to draw the text on screen. So instead of
(indirectly) using VTBUF_LOCK() just to read and reset the dirty area
of the internal buffer, the lock is held for about the entire function,
including the drawing part.

The change is mostly visible while content is scrolling fast: before,
lines could appear garbled while scrolling because the internal buffer
was accessed without locks (once the scrolling was finished, the output
was correct). Now, the scrolling appears correct.

In the end, the locking model is closer to what syscons(4) does.

Differential Revision:	https://reviews.freebsd.org/D15302
2018-05-16 09:01:02 +00:00
Andriy Gapon c9c4d38aa8 followup to r332730/r332752: set kdb_why to "trap" for fatal traps
This change updates arm, arm64 and mips achitectures.  Additionally, it
removes redundant checks for kdb_active where it already results in
kdb_reenter() and adds kdb_reenter() calls where they were missing.

Some architectures check the return value of kdb_trap(), but some don't.
I haven't changed any of that.

Some trap handling routines have a return code.  I am not sure if I
provided correct ones for returns after kdb_reenter().  kdb_reenter
should never return unless kdb_jmpbufp is NULL for some reason.

Only compile tested for all affected architectures.  There can be bugs
resulting from my poor understanding of architecture specific details.

Reported by:	jhb
Reviewed by:	jhb, eadler
MFC after:	4 weeks
Differential Revision: https://reviews.freebsd.org/D15431
2018-05-16 06:52:08 +00:00
Ed Maste d6b97a6497 Attempt to fix build by removing EOF backslash-newline
GCC complains:
In file included from .../sys/dev/usb/input/uhid.c:77:
.../usb_rdesc.h:280:37: error: backslash-newline at end of file
2018-05-16 03:17:37 +00:00
Ed Maste 36730a25a6 Add intel-ucode-split to tools README 2018-05-16 03:08:06 +00:00
Ed Maste ab6f27aac1 makefs: ANSIfy 2018-05-16 02:58:05 +00:00
Ed Maste 4fa9985611 Sort mlx5tool correctly in usr.sbin/Makefile 2018-05-16 02:51:30 +00:00
Ed Maste 408c1ff8f4 Clarify that boot_mute / boot -m mutes kernel console only
Perhaps RB_MUTE could mute user startup (rc) output as well, but right
now it mutes only kernel console output, so make the documentation match
reality.

PR:		228193
Sponsored by:	The FreeBSD Foundation
2018-05-16 02:15:18 +00:00
Ed Maste 608ea6b412 intel-ucode-split: list platform ids based on processor_flags
The Intel CPU "Platform Id" is a 3-bit integer reported by a given MSR.
Intel microcode updates have an 8-bit field to indicate Platform Id
compatibility - one bit in the mask for each of the possible Platform Id
values.  To simplify interpretation, report the Platform Id mask also as
a list.
2018-05-16 01:55:52 +00:00
Ed Maste 3d3f60c97d intel-ucode-split: exit on unknown ucode header version 2018-05-16 01:41:36 +00:00
Ed Maste 45b8de2d18 Regen src.conf.5 after r333658 2018-05-16 01:34:36 +00:00
Ed Maste 1069f41bb8 Force WITHOUT_FREEBSD_UPDATE when WITHOUT_PORTSNAP is set
freebsd-update depends on phttpget from portsnap. We could move phttpget
out of portsnap and build it as long as WITHOUT_FREEBSD_UPDATE and
WITHOUT_PORTSNAP are not both set, but for now just make the dependency
explicit.

PR:		228220
Reported by:	Dries Michiels
Sponsored by:	The FreeBSD Foundation
2018-05-16 01:33:48 +00:00
Ed Maste 60561279cf intel-ucode-split: add a -v verbose flag
And be quiet by default.

Sponsored by:	The FreeBSD Foundation
2018-05-16 01:08:11 +00:00
Andrew Gallatin 9a6981ef5b Unhook DEBUG_BUFRING from INVARIANTS
Some of the DEBUG_BUFRING checks are racy, and can lead to
spurious assertions when run under high load.  Unhook these
from INVARIANTS until the author can fix or remove them.

Reviewed by:	mmacy
Sponsored by:	Netflix
2018-05-15 23:55:38 +00:00
Bryan Drewery b3a8db007a Fix stale dependencies on libcasper libraries.
Libcasper and its modules have no static libraries so don't define
paths to them.  This fixes LIBADD automatically adding DPADD
entries for casper.

Reported by:	sbruno
Sponsored by:	Dell EMC Isilon
2018-05-15 23:46:49 +00:00
Navdeep Parhar b6ce1d5b1d cxgbe(4): Add support for two more flash parts.
Obtained from:	Chelsio Communications
MFC after:	2 days
Sponsored by:	Chelsio Communications
2018-05-15 22:26:09 +00:00