]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agorelease: arm: Format FAT partition as FAT16
manu [Thu, 17 May 2018 16:21:12 +0000 (16:21 +0000)]
release: arm: Format FAT partition as FAT16

r332674 raised the size of the FAT partition from 2MB to 41MB for some
boards. But we format them in FAT12 and this size appears to be to big
for FAT12 and some SoC bootrom cannot cope with that.
Format the msdosfs partition as FAT16,

PR: 228285
MFC after: soon

6 years agoMark usfs(4) as obsolete; users are advised to use cfumass(4) instead.
trasz [Thu, 17 May 2018 15:21:19 +0000 (15:21 +0000)]
Mark usfs(4) as obsolete; users are advised to use cfumass(4) instead.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoFix off-by-one in usb_decode_str_desc(). Previously it would decode
trasz [Thu, 17 May 2018 15:19:29 +0000 (15:19 +0000)]
Fix off-by-one in usb_decode_str_desc().  Previously it would decode
one character too many.  Note that this function is only used to decode
string descriptors generated by the kernel itself.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoRetire vxge(4).
sbruno [Thu, 17 May 2018 14:55:41 +0000 (14:55 +0000)]
Retire vxge(4).

This driver was merged to HEAD one week prior to Exar publicly announcing they
had left the Ethernet market. It is not known to be used and has various code
quality issues spotted by Brooks and Hiren. Retire it in preparation for
FreeBSD 12.0.

Submitted by: kbowling
Reviewed by: brooks imp
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15442

6 years agoaw_spi: Fix some silly clock mistake
manu [Thu, 17 May 2018 14:51:22 +0000 (14:51 +0000)]
aw_spi: Fix some silly clock mistake

The module uses the mod clock and not the ahb one.
We need to set the mod clock to twice the speed requested as the smallest
divider in the controller is 2.
The clock test function weren't calculating the register value best on the
best div but on the max one.
The cdr2 test function was using the cdr1 formula.

Pointy Hat: manu

6 years agoPull in r322325 from upstream llvm trunk (by Matthias Braun):
dim [Thu, 17 May 2018 14:38:58 +0000 (14:38 +0000)]
Pull in r322325 from upstream llvm trunk (by Matthias Braun):

  PeepholeOpt cleanup/refactor; NFC

  - Less unnecessary use of `auto`
  - Add early `using RegSubRegPair(AndIdx) =` to avoid countless
    `TargetInstrInfo::` qualifications.
  - Use references instead of pointers where possible.
  - Remove unused parameters.
  - Rewrite the CopyRewriter class hierarchy:
     - Pull out uncoalescable copy rewriting functionality into
       PeepholeOptimizer class.
     - Use an abstract base class to make it clear that rewriters are
       independent.
  - Remove unnecessary \brief in doxygen comments.
  - Remove unused constructor and method from ValueTracker.
  - Replace UseAdvancedTracking of ValueTracker with DisableAdvCopyOpt
    use.

Even though upstream marked this as "No Functional Change", it does
contain some functional changes, and these fix a compiler hang for one
particular source file in the devel/godot port.

PR: 228261
MFC after: 3 days

6 years agoAdd initial man page for Microchip USB 3 Gigabit Ethernet controller
emaste [Thu, 17 May 2018 14:26:12 +0000 (14:26 +0000)]
Add initial man page for Microchip USB 3 Gigabit Ethernet controller

Sponsored by: The FreeBSD Foundation

6 years agoAdd driver for Microchip LAN78xx USB3-GigE controller
emaste [Thu, 17 May 2018 14:04:59 +0000 (14:04 +0000)]
Add driver for Microchip LAN78xx USB3-GigE controller

This driver supports two Microchip USB-Ethernet controllers:

LAN7800 USB 3.1 to 10/100/1000 Mbps Ethernet
LAN7515 USB 2 to 10/100/1000 Mbps Ethernet with built-in USB hub

The LAN7515 is the Ethernet controller on the Raspberry Pi 3B+.
At present there is no datasheet for the LAN7515, but it is effectively
a USB 2 hub combined with a LAN7800 controller.  A comprehensive LAN7800
datasheet is at http://www.microchip.com/wwwproducts/en/LAN7800.

This driver is based on the structure of the smsc(4) driver which
supports Microchip/SMSC's LAN95xx family.  (Microchip acquired SMSC
in May 2012.)  The Linux lan78xx driver served as a reference for some
functionality and registers.

The 'muge' driver name comes from "Microchip USB Gigabit Ethernet".
I made some style adjustments and minor edits to Arshan's submission.
It will be connected to the build after additional review and testing.

Thanks to Microchip for providing a number of Evaluation Boards (EVBs)
for development and testing.

Submitted by: Arshan Khanifar
Reviewed by: hselasky (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15168

6 years agoAdd missing newline to end of -c usage string .
rgrimes [Thu, 17 May 2018 12:18:41 +0000 (12:18 +0000)]
Add missing newline to end of -c usage string .

Pointy hat: me
Submitted by: novel
Approved by: bde(mentor), grehan (maintainer)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15421

6 years agoaw_spi: Fix manpages
manu [Thu, 17 May 2018 11:53:04 +0000 (11:53 +0000)]
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

6 years agoaw_spi: Add manpage for this driver
manu [Thu, 17 May 2018 10:25:49 +0000 (10:25 +0000)]
aw_spi: Add manpage for this driver

6 years agoalwinner: Add missing files in r333708
manu [Thu, 17 May 2018 10:25:01 +0000 (10:25 +0000)]
alwinner: Add missing files in r333708

6 years agoallwinner: Add h3 spi driver
manu [Thu, 17 May 2018 10:19:52 +0000 (10:19 +0000)]
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.

6 years agofix a problem with bad performance after wakeup caused by r333321
avg [Thu, 17 May 2018 10:16:20 +0000 (10:16 +0000)]
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

6 years agomx25l: Add mx25l1606e
manu [Thu, 17 May 2018 10:13:18 +0000 (10:13 +0000)]
mx25l: Add mx25l1606e

This is a 16Mbits spi flash arranged in 32x64k blocks or 512x4k
sectors.

6 years agocxgbe(4): Fix s->neq miscalculation in r333698.
np [Thu, 17 May 2018 06:04:50 +0000 (06:04 +0000)]
cxgbe(4): Fix s->neq miscalculation in r333698.

6 years agoFix a race in vm_page_pagequeue_lockptr().
markj [Thu, 17 May 2018 04:27:08 +0000 (04:27 +0000)]
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

6 years agoFix netdump configuration when VIMAGE is enabled.
markj [Thu, 17 May 2018 04:08:57 +0000 (04:08 +0000)]
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

6 years agoFix powerpc64 LINT
mmacy [Thu, 17 May 2018 03:19:31 +0000 (03:19 +0000)]
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

6 years agoFix i386 build
mmacy [Thu, 17 May 2018 02:54:30 +0000 (02:54 +0000)]
Fix i386 build

Move epoch_section to after td_emuldata, but note the 3 surrounding LP64 holes
while I'm here.

Approved by: sbruno

6 years agoPlug a memory leak and potential NULL-pointer dereference introduced in r331214.
lstewart [Thu, 17 May 2018 02:46:27 +0000 (02:46 +0000)]
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

6 years agocxgbe(4): Allocate offload Tx queues when a card has resources
np [Thu, 17 May 2018 01:42:18 +0000 (01:42 +0000)]
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

6 years agoepoch(9): make recursion lighter weight
mmacy [Thu, 17 May 2018 01:13:40 +0000 (01:13 +0000)]
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

6 years agocxgbe(4): Add NIC_ETHOFLD to the NIC capabilities allowed by the driver
np [Thu, 17 May 2018 00:52:48 +0000 (00:52 +0000)]
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

6 years agoepoch(9): Guarantee forward progress on busy sections
mmacy [Thu, 17 May 2018 00:45:35 +0000 (00:45 +0000)]
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

6 years agoFix warning found by Coverity.
mckusick [Wed, 16 May 2018 23:42:02 +0000 (23:42 +0000)]
Fix warning found by Coverity.

CID 1009353:  Error handling issues  (CHECKED_RETURN)

6 years agoRevert change made in base r171522
mckusick [Wed, 16 May 2018 23:30:03 +0000 (23:30 +0000)]
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

6 years agohwpmc: Implement per-thread counters for PMC sampling
mmacy [Wed, 16 May 2018 22:29:20 +0000 (22:29 +0000)]
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

6 years agoFix !netmap build post r333686
mmacy [Wed, 16 May 2018 22:25:47 +0000 (22:25 +0000)]
Fix !netmap build post r333686

Approved by: sbruno

6 years ago2018 this time.
imp [Wed, 16 May 2018 21:07:12 +0000 (21:07 +0000)]
2018 this time.

6 years agoWork around lack of TX IRQs in iflib for netmap
shurd [Wed, 16 May 2018 21:03:22 +0000 (21:03 +0000)]
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

6 years agoSet label when setting up USB LUNs, it looks nicer this way.
trasz [Wed, 16 May 2018 20:44:08 +0000 (20:44 +0000)]
Set label when setting up USB LUNs, it looks nicer this way.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoChange the cfumass rc script to stop pretending the USB LUN is a virtual
trasz [Wed, 16 May 2018 20:39:15 +0000 (20:39 +0000)]
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

6 years agoteken: Unbreak syscons' use of teken
cem [Wed, 16 May 2018 18:12:49 +0000 (18:12 +0000)]
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@

6 years agocxgbe(4): Fall back to a failsafe configuration built into the firmware
np [Wed, 16 May 2018 17:55:16 +0000 (17:55 +0000)]
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

6 years agoInclude kernel modules for MALTA kernels.
jhb [Wed, 16 May 2018 17:54:40 +0000 (17:54 +0000)]
Include kernel modules for MALTA kernels.

Sponsored by: DARPA / AFRL

6 years agoA belated note crediting the FreeBSD Foundation for sponsoring
zec [Wed, 16 May 2018 16:57:11 +0000 (16:57 +0000)]
A belated note crediting the FreeBSD Foundation for sponsoring
technical work circa ten years ago...

MFC after: 3 days

6 years agoExport a breakpoint() function to userland for riscv.
jhb [Wed, 16 May 2018 16:56:35 +0000 (16:56 +0000)]
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

6 years agoMerge upstream patch to unbreak tunnel forwarding.
des [Wed, 16 May 2018 14:04:39 +0000 (14:04 +0000)]
Merge upstream patch to unbreak tunnel forwarding.

Reported by: cy@

6 years agoAdd note about LD=ld.lld being a temporary requirement when building
imp [Wed, 16 May 2018 13:52:24 +0000 (13:52 +0000)]
Add note about LD=ld.lld being a temporary requirement when building
the kernel the traditional way.

6 years agoForward Reply-Message attributes to the user, unless suppressed by the
des [Wed, 16 May 2018 13:47:30 +0000 (13:47 +0000)]
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

6 years agoClean up vt source whitespace issues
emaste [Wed, 16 May 2018 11:19:03 +0000 (11:19 +0000)]
Clean up vt source whitespace issues

6 years agovt(4): Resume vt_timer() in vtterm_post_input() only
dumbbell [Wed, 16 May 2018 10:08:50 +0000 (10:08 +0000)]
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

6 years agoteken, vt(4): New callbacks to lock the terminal once
dumbbell [Wed, 16 May 2018 09:01:02 +0000 (09:01 +0000)]
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

6 years agofollowup to r332730/r332752: set kdb_why to "trap" for fatal traps
avg [Wed, 16 May 2018 06:52:08 +0000 (06:52 +0000)]
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

6 years agoAttempt to fix build by removing EOF backslash-newline
emaste [Wed, 16 May 2018 03:17:37 +0000 (03:17 +0000)]
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

6 years agoAdd intel-ucode-split to tools README
emaste [Wed, 16 May 2018 03:08:06 +0000 (03:08 +0000)]
Add intel-ucode-split to tools README

6 years agomakefs: ANSIfy
emaste [Wed, 16 May 2018 02:58:05 +0000 (02:58 +0000)]
makefs: ANSIfy

6 years agoSort mlx5tool correctly in usr.sbin/Makefile
emaste [Wed, 16 May 2018 02:51:30 +0000 (02:51 +0000)]
Sort mlx5tool correctly in usr.sbin/Makefile

6 years agoClarify that boot_mute / boot -m mutes kernel console only
emaste [Wed, 16 May 2018 02:15:18 +0000 (02:15 +0000)]
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

6 years agointel-ucode-split: list platform ids based on processor_flags
emaste [Wed, 16 May 2018 01:55:52 +0000 (01:55 +0000)]
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.

6 years agointel-ucode-split: exit on unknown ucode header version
emaste [Wed, 16 May 2018 01:41:36 +0000 (01:41 +0000)]
intel-ucode-split: exit on unknown ucode header version

6 years agoRegen src.conf.5 after r333658
emaste [Wed, 16 May 2018 01:34:36 +0000 (01:34 +0000)]
Regen src.conf.5 after r333658

6 years agoForce WITHOUT_FREEBSD_UPDATE when WITHOUT_PORTSNAP is set
emaste [Wed, 16 May 2018 01:33:48 +0000 (01:33 +0000)]
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

6 years agointel-ucode-split: add a -v verbose flag
emaste [Wed, 16 May 2018 01:08:11 +0000 (01:08 +0000)]
intel-ucode-split: add a -v verbose flag

And be quiet by default.

Sponsored by: The FreeBSD Foundation

6 years agoUnhook DEBUG_BUFRING from INVARIANTS
gallatin [Tue, 15 May 2018 23:55:38 +0000 (23:55 +0000)]
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

6 years agoFix stale dependencies on libcasper libraries.
bdrewery [Tue, 15 May 2018 23:46:49 +0000 (23:46 +0000)]
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

6 years agocxgbe(4): Add support for two more flash parts.
np [Tue, 15 May 2018 22:26:09 +0000 (22:26 +0000)]
cxgbe(4): Add support for two more flash parts.

Obtained from: Chelsio Communications
MFC after: 2 days
Sponsored by: Chelsio Communications

6 years agoHold the reference count until the CCB is released
imp [Tue, 15 May 2018 22:22:10 +0000 (22:22 +0000)]
Hold the reference count until the CCB is released

When a disk disappears and the periph is invalidated, any I/Os that
are pending with the controller can cause a crash when they
complete. Move to holding the softc reference count taken in dastart()
until the I/O is complete rather than only until xpt_action()
returns. (This approach was suggested by Ken Merry.) This extends
the method used in da to ada, nda, and mda.

Sponsored by: Netflix
Submitted by: Chuck Silvers

6 years agocxgbe(4): Claim some more T5 and T6 boards.
np [Tue, 15 May 2018 21:54:59 +0000 (21:54 +0000)]
cxgbe(4): Claim some more T5 and T6 boards.

MFC after: 2 days
Sponsored by: Chelsio Communications

6 years agoAdd a tool to split Intel microcode into one file per Platform Id
emaste [Tue, 15 May 2018 21:51:29 +0000 (21:51 +0000)]
Add a tool to split Intel microcode into one file per Platform Id

Intel now releases microcode updates in files named after
<family>-<model>-<stepping>.  In some cases a single file may include
microcode for multiple Platform Ids for the same family, model, and
stepping.  Our current microcode update tooling (/usr/sbin/cpucontrol)
only processes the first microcode update in the file.

This tool splits combined files into individual files with one microcode
update each, named as
<family>-<model>-<stepping>.<platform_id_mask>.

Adding this to tools/ for experimentation and testing.  In the future
we'll want to have cpucontrol or other tooling work directly with the
Intel-provided microcode files.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15433

6 years agoHold the reference count until the CCB is released
imp [Tue, 15 May 2018 21:25:35 +0000 (21:25 +0000)]
Hold the reference count until the CCB is released

When a disk disappears and the periph is invalidated, any I/Os that
are pending with the controller can cause a crash when they
complete. Move to holding the softc reference count taken in dastart()
until the I/O is complete rather than only until xpt_action()
returns. (This approach was suggested by Ken Merry.)

Sponsored by: Netflix
Submitted by: Chuck Silvers
Differential Revision: https://reviews.freebsd.org/D15435

6 years ago- If present, take advantage of the R/W cache of eMMC revision 1.5 and
marius [Tue, 15 May 2018 21:15:09 +0000 (21:15 +0000)]
- If present, take advantage of the R/W cache of eMMC revision 1.5 and
  later devices. These caches work akin to the ones found in HDDs/SSDs
  that ada(4)/da(4) also enable if existent, but likewise increase the
  likelihood of data loss in case of a sudden power outage etc. On the
  other hand, write performance is up to twice as high for e. g. 1 GiB
  files depending on the actual chip and transfer mode employed.
  For maximum data integrity, the usage of eMMC caches can be disabled
  via the hw.mmcsd.cache tunable.
- Get rid of the NOP mmcsd_open().

6 years agoRestore style(9) conformance after r320844 (actually requested pre-
marius [Tue, 15 May 2018 21:07:11 +0000 (21:07 +0000)]
Restore style(9) conformance after r320844 (actually requested pre-
commit) and bring the r320844 additions in line with existing bits.

6 years agoEnd grace for the NFSv4 server if all mounts do ReclaimComplete.
rmacklem [Tue, 15 May 2018 20:28:50 +0000 (20:28 +0000)]
End grace for the NFSv4 server if all mounts do ReclaimComplete.

The NFSv4 protocol requires that the server only allow reclaim of state
and not issue any new open/lock state for a grace period after booting.
The NFSv4.0 protocol required this grace period to be greater than the
lease duration (over 2minutes). For NFSv4.1, the client tells the server
that it has done reclaiming state by doing a ReclaimComplete operation.
If all NFSv4 clients are NFSv4.1, the grace period can end once all the
clients have done ReclaimComplete, shortening the time period considerably.
This patch does this. If there are any NFSv4.0 mounts, the grace period
will still be over 2minutes.
This change is only an optimization and does not affect correct operation.

Tested by: andreas.nagy@frequentis.com
MFC after: 2 months

6 years agoUnwrap a line that no longer requires wrapping.
brooks [Tue, 15 May 2018 20:14:38 +0000 (20:14 +0000)]
Unwrap a line that no longer requires wrapping.

6 years agoRemove stray tabs from in_lltable_dump_entry().
brooks [Tue, 15 May 2018 20:13:00 +0000 (20:13 +0000)]
Remove stray tabs from in_lltable_dump_entry().

6 years agoUnwrap some not-so-long lines now that extra tabs been removed.
brooks [Tue, 15 May 2018 17:59:46 +0000 (17:59 +0000)]
Unwrap some not-so-long lines now that extra tabs been removed.

6 years agoRemove stray tabs in in6_lltable_dump_entry(). NFC.
brooks [Tue, 15 May 2018 17:57:46 +0000 (17:57 +0000)]
Remove stray tabs in in6_lltable_dump_entry().  NFC.

6 years agovmmdev: return EFAULT when trying to read beyond VM system memory max address
antoine [Tue, 15 May 2018 17:20:58 +0000 (17:20 +0000)]
vmmdev: return EFAULT when trying to read beyond VM system memory max address

Currently, when using dd(1) to take a VM memory image, the capture never ends,
reading zeroes when it's beyond VM system memory max address.
Return EFAULT when trying to read beyond VM system memory max address.

Reviewed by: imp, grehan, anish
Approved by: grehan
Differential Revision: https://reviews.freebsd.org/D15156

6 years agocalibrate lapic timer in native_lapic_setup
avg [Tue, 15 May 2018 16:56:30 +0000 (16:56 +0000)]
calibrate lapic timer in native_lapic_setup

The idea is to calibrate the LAPIC timer just once and only on boot,
given that [at present] the timer constants are global and shared
between all processors.

My primary motivation is to fix a panic that can happen when dynamically
switching to lapic timer.  The panic is caused by a recursion on
et_hw_mtx when printing the calibration results to console.  See the
review for the details of the panic.

Also, the code should become slightly simpler and easier to read.  The
previous code was racy too.  Multiple processors could start calibrating
the global constants concurrently, although that seems to have been
benign.

Reviewed by: kib, mav, jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15422

6 years agoCheck that ifma_protospec != NULL in inm_lookup
shurd [Tue, 15 May 2018 16:54:41 +0000 (16:54 +0000)]
Check that ifma_protospec != NULL in inm_lookup

If ifma_protospec is NULL when inm_lookup() is called, there
is a dereference in a NULL struct pointer. This ensures that struct is
not NULL before comparing the address.

Reported by: dumbbell
Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15440

6 years agoIncrease the number of pages we allocate in the arm64 early boot. We are
andrew [Tue, 15 May 2018 16:44:35 +0000 (16:44 +0000)]
Increase the number of pages we allocate in the arm64 early boot. We are
already close to the limit so increasing the kernel size may cause it to
fail to boot when it runs past the end of allocated memory.

Reported by: manu
Sponsored by: DARPA, AFRL

6 years agoAllow freebsd32 __sysctl(2) to return ENOMEM.
brooks [Tue, 15 May 2018 16:24:58 +0000 (16:24 +0000)]
Allow freebsd32 __sysctl(2) to return ENOMEM.

This is required by programs like sockstat that read variably sized
sysctls such as kern.file.  The normal path has no such restriction and
the restriction was added without comment along with initial support for
freebsd32 in 2002 (r100384).

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15438

6 years agoAdd new USB HID driver for Super Nintendo gamepads.
hselasky [Tue, 15 May 2018 15:36:34 +0000 (15:36 +0000)]
Add new USB HID driver for Super Nintendo gamepads.

Differential Revision: https://reviews.freebsd.org/D15385
Submitted by: johalun@gmail.com (Johannes Lundberg)
Sponsored by: Mellanox Technologies

6 years agoFix sysctl description.
trasz [Tue, 15 May 2018 15:11:52 +0000 (15:11 +0000)]
Fix sysctl description.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoigb(4):
sbruno [Tue, 15 May 2018 13:30:59 +0000 (13:30 +0000)]
igb(4):
I210 restore functionality if pxeboot rom is enabled on this device.

r333345 attempted to determine if this code was needed or it was some kind
of work around for a problem.  Turns out, its definitely a work around for
hardware locking and synchronization that manifests itself if the option
Rom is enabled and is selected as a boot device (there was a PXE attempt).

Reviewed by: mmacy
Differential Revision: https://reviews.freebsd.org/D15439

6 years agoFix 'zpool create -t <tempname>'
avg [Tue, 15 May 2018 13:27:29 +0000 (13:27 +0000)]
Fix 'zpool create -t <tempname>'

Creating a pool with a temporary name fails when we also specify custom
dataset properties: this is because we mistakenly call
zfs_set_prop_nvlist() on the "real" pool name which, as expected,
cannot be found because the SPA is present in the namespace with the
temporary name.

Fix this by specifying the correct pool name when setting the dataset
properties.

Author: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Obtained from: ZFS on Linux, zfsonlinux/zfs@4ceb8dd6fdfdde
MFC after: 1 week

6 years agoAdd support for setting type of service, TOS, for outgoing RDMA connections
hselasky [Tue, 15 May 2018 07:46:24 +0000 (07:46 +0000)]
Add support for setting type of service, TOS, for outgoing RDMA connections
in the krping kernel test utility.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agovq_getchain() can return -1 if some descriptor(s) are invalid and prints
araujo [Tue, 15 May 2018 05:55:29 +0000 (05:55 +0000)]
vq_getchain() can return -1 if some descriptor(s) are invalid and prints
a diagnostic message. So we do a sanity checking on the return value
of vq_getchain().

Spotted by: gcc49
Reviewed by: avg
MFC after: 4 weeks
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15388

6 years agocxgbetool(8): Provide user interface for hashfilters, hardware NAT, and
np [Tue, 15 May 2018 04:31:11 +0000 (04:31 +0000)]
cxgbetool(8): Provide user interface for hashfilters, hardware NAT, and
other filtering related features that were recently added to the driver.

Sponsored by: Chelsio Communications

6 years agocxgbe(4): Filtering related features and fixes.
np [Tue, 15 May 2018 04:24:38 +0000 (04:24 +0000)]
cxgbe(4): Filtering related features and fixes.

- Driver support for hardware NAT.
- Driver support for swapmac action.
- Validate a request to create a hashfilter against the filter mask.
- Add a hashfilter config file for T5.

Sponsored by: Chelsio Communications

6 years agosubr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer
emaste [Tue, 15 May 2018 00:50:09 +0000 (00:50 +0000)]
subr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer

Approved by: jeff

6 years agoLet mmcsd_ioctl() ensure appropriate privileges via priv_check(9).
marius [Mon, 14 May 2018 21:57:45 +0000 (21:57 +0000)]
Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9).

6 years agoThe broken DDR52 support of Intel Bay Trail eMMC controllers rumored
marius [Mon, 14 May 2018 21:46:06 +0000 (21:46 +0000)]
The broken DDR52 support of Intel Bay Trail eMMC controllers rumored
in the commit log of r321385 has been confirmed via the public VLI54
erratum. Thus, stop advertising DDR52 for these controllers.
Note that this change should hardly make a difference in practice as
eMMC chips from the same era as these SoCs most likely support HS200
at least, probably even up to HS400ES.

6 years agoReplace rmlock with epoch in lagg
shurd [Mon, 14 May 2018 20:06:49 +0000 (20:06 +0000)]
Replace rmlock with epoch in lagg

Use the new epoch based reclamation API. Now the hot paths will not
block at all, and the sx lock is used for the softc data.  This fixes LORs
reported where the rwlock was obtained when the sxlock was held.

Submitted by: mmacy
Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15355

6 years agoMake the common interrupt entry point labels local labels.
jhb [Mon, 14 May 2018 17:27:53 +0000 (17:27 +0000)]
Make the common interrupt entry point labels local labels.

Kernel debuggers depend on symbol names to find stack frames with a
trapframe rather than a normal stack frame.  The labels used for the
shared interrupt entry point for the PTI and non-PTI cases did not
match the existing patterns confusing debuggers.  Add the '.L' prefix
to mark these symbols as local so they are not visible in the symbol
table.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agosctp_get_mbuf_for_msg() should honor the allinone parameter.
tuexen [Mon, 14 May 2018 15:16:51 +0000 (15:16 +0000)]
sctp_get_mbuf_for_msg() should honor the allinone parameter.

When it is not required that the buffer is not a chain, return
a chain. This is based on a patch provided by Irene Ruengeler.

6 years agoEnsure that the MTU's used are multiple of 4.
tuexen [Mon, 14 May 2018 13:50:17 +0000 (13:50 +0000)]
Ensure that the MTU's used are multiple of 4.

The length of SCTP packets is always a multiple of 4. Therefore,
ensure that the MTUs used are also a multiple of 4.

Thanks to Irene Ruengeler for providing an earlier version of this
patch.

MFC after: 1 week

6 years agohwpmc: don't reference domain index with no memory backing it
mmacy [Mon, 14 May 2018 06:11:25 +0000 (06:11 +0000)]
hwpmc: don't reference domain index with no memory backing it

On multi-socket the domain will be correctly set for a given CPU
regardless of whether or not NUMA is enabled.

Approved by: sbruno

6 years agoHandle thread-local storage (TLS) segments correctly when
phil [Mon, 14 May 2018 05:21:18 +0000 (05:21 +0000)]
Handle thread-local storage (TLS) segments correctly when
copying (objcopy) and displaying (readelf) them.

PR: 227552
Submitted by: kaiw (maintainer)
Reported by: jachmann@unitix.org
Reviewed by: phil
MFC after: 1 day

6 years agoFinal fix for alignment issues with the page table first patched with
nwhitehorn [Mon, 14 May 2018 04:00:52 +0000 (04:00 +0000)]
Final fix for alignment issues with the page table first patched with
r333273 and partially reverted with r333594.

Older CPUs implement addition of offsets into the page table by a
bitwise OR rather than actual addition, which only works if the table is
aligned at a multiple of its own size (they also require it to be aligned
at a multiple of 256KB). Newer ones do not have that requirement, but it
hardly matters to enforce it anyway.

The original code was failing on newer systems with huge amounts of RAM
(> 512 GB), in which the page table was 4 GB in size. Because the
bootstrap memory allocator took its alignment parameter as an int, this
turned into a 0, removing any alignment constraint at all and making
the MMU fail. The first round of this patch (r333273) fixed this case by
aligning it at 256 KB, which broke older CPUs. Fix this instead by widening
the alignment parameter.

6 years agopmc: don't add pmc owner to list until setup is complete
mmacy [Mon, 14 May 2018 01:08:47 +0000 (01:08 +0000)]
pmc: don't add pmc owner to list until setup is complete

Once a pmc owner is added to the pmc_ss_owners list it is
visible for all to see. We don't want this to happen until
setup is complete.

Reported by: mjg
Approved by: sbruno

6 years agopmc: fix buildworld
mmacy [Mon, 14 May 2018 00:56:33 +0000 (00:56 +0000)]
pmc: fix buildworld

hid ck_queue.h from user

Approved by: sbruno

6 years agohwpmc: fix load/unload race and vm map LOR
mmacy [Mon, 14 May 2018 00:21:04 +0000 (00:21 +0000)]
hwpmc: fix load/unload race and vm map LOR

- fix load/unload race by allocating the per-domain list structure at boot

- fix long extant vm map LOR by replacing pmc_sx sx_slock with global_epoch
  to protect the liveness of elements of the pmc_ss_owners list

Reported by: pho
Approved by: sbruno

6 years agoepoch(9): allow sx locks to be held across epoch_wait()
mmacy [Mon, 14 May 2018 00:14:00 +0000 (00:14 +0000)]
epoch(9): allow sx locks to be held across epoch_wait()

The INVARIANTS checks in epoch_wait() were intended to
prevent the block handler from returning with locks held.
What it in fact did was preventing anything except Giant
from being held across it. Check that the number of locks
held has not changed instead.

Approved by: sbruno@

6 years agoRevert changes to hash table alignment in r333273, which booting on all G5
nwhitehorn [Sun, 13 May 2018 23:56:43 +0000 (23:56 +0000)]
Revert changes to hash table alignment in r333273, which booting on all G5
systems, pending further analysis.

6 years agoFix the eir_server_scope reply argument for NFSv4.1 ExchangeID.
rmacklem [Sun, 13 May 2018 23:38:01 +0000 (23:38 +0000)]
Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID.

In the reply to an ExchangeID operation, the NFSv4.1 server returns a
"scope" value (eir_server_scope). If this value is the same, it indicates
that two servers share state, which is never the case for FreeBSD servers.
As such, the value needs to be unique and it was without this patch.
However, I just found out that it is not supposed to change when the
server reboots and without this patch, it did change.
This patch fixes eir_server_scope so that it does not change when the
server is rebooted.
The only affect not having this patch has is that Linux clients don't
reclaim opens and locks after a server reboot, which meant they lost
any byte range locks held before the server rebooted.
It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not
affected by this bug.

MFC after: 1 week

6 years agoepoch(9): cleanups, additional debug checks, and add global_epoch
mmacy [Sun, 13 May 2018 23:24:48 +0000 (23:24 +0000)]
epoch(9): cleanups, additional debug checks, and add global_epoch

- GC the _nopreempt routines
    - to really benefit we'd need a separate routine
    - they're not currently in use
    - they complicate the API for no benefit at this time

- check that we're actually in a epoch section at exit

- handle epoch_call() early in boot

- Fix copyright declaration language

Approved by: sbruno@

6 years agoAdd epoch(9) man page
mmacy [Sun, 13 May 2018 23:16:04 +0000 (23:16 +0000)]
Add epoch(9) man page

Reviewed by: gallatin@
Approved by: sbruno@