]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFHead @348740
asomers [Thu, 6 Jun 2019 16:20:50 +0000 (16:20 +0000)]
MFHead @348740

Sponsored by: The FreeBSD Foundation

4 years agoDon't refer to the cpu variable in a KASSERT before initializing it.
ian [Thu, 6 Jun 2019 15:18:23 +0000 (15:18 +0000)]
Don't refer to the cpu variable in a KASSERT before initializing it.

4 years ago[skip ci] Better comments for vlrureclaim
asomers [Thu, 6 Jun 2019 15:11:36 +0000 (15:11 +0000)]
[skip ci] Better comments for vlrureclaim

Sponsored by: The FreeBSD Foundation

4 years ago[skip ci] Fix the comment for cache_purge(9)
asomers [Thu, 6 Jun 2019 15:07:49 +0000 (15:07 +0000)]
[skip ci] Fix the comment for cache_purge(9)

Sponsored by: The FreeBSD Foundation

4 years agoAdd a testing facility to manually reclaim a vnode
asomers [Thu, 6 Jun 2019 15:04:50 +0000 (15:04 +0000)]
Add a testing facility to manually reclaim a vnode

Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it
will be reclaimed, as long as it isn't already or doomed. The purpose is to
gain test coverage for vnode reclamation, which is otherwise hard to
achieve.

Add the debug.ftry_reclaim_vnode sysctl.  It does the same thing, except
that its argument is a file descriptor instead of a pathname.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20519

4 years agoAdd myself (arrowd) to calendar.freebsd.
arrowd [Thu, 6 Jun 2019 08:43:23 +0000 (08:43 +0000)]
Add myself (arrowd) to calendar.freebsd.

Approved by: bapt

4 years agoAdd my birthday to calendar
0mp [Thu, 6 Jun 2019 08:12:49 +0000 (08:12 +0000)]
Add my birthday to calendar

Requested by: mckusick

4 years agor347382 added receiver side DSACK support for the TCP base stack.
tuexen [Thu, 6 Jun 2019 07:49:03 +0000 (07:49 +0000)]
r347382 added receiver side DSACK support for the TCP base stack.
The corresponding changes for the RACK stack where missed and are added
by this commit.

Reviewed by: Richard Scheffenegger, rrs@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20372

4 years agoDon't make the efifat thing if NOFAT is defined.
imp [Thu, 6 Jun 2019 03:07:10 +0000 (03:07 +0000)]
Don't make the efifat thing if NOFAT is defined.

4 years agoWhitespace adjustment.
cy [Thu, 6 Jun 2019 03:02:25 +0000 (03:02 +0000)]
Whitespace adjustment.

MFC after: 3 days

4 years agozpool.8: the comment property is not read-only
allanjude [Thu, 6 Jun 2019 01:32:00 +0000 (01:32 +0000)]
zpool.8: the comment property is not read-only

The comment property was listed in the man page twice, once under the list
of read-only properties, and again (correctly), under the list of user
editable properties.

PR: 238355
Reported by: Michael Zuo <muh.muhten@gmail.com>
Sponsored by: Klara Systems

4 years agoUse parse_integer to avoid sign extension.
jhb [Wed, 5 Jun 2019 23:37:50 +0000 (23:37 +0000)]
Use parse_integer to avoid sign extension.

Coverity warned about gdb_write_mem sign extending the result of
parse_byte shifted left by 24 bits when generating a 32-bit memory
write value for MMIO.  Simplify the code by using parse_integer
instead of unrolled parse_byte calls.

CID: 1401600
Reviewed by: cem
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20508

4 years agotail: disable capsicum in rescue mode
oshogbo [Wed, 5 Jun 2019 22:55:00 +0000 (22:55 +0000)]
tail: disable capsicum in rescue mode

All rescue application are not capsicumized.

Reported by: jenkins

4 years agotail: fix style nit introduced in the r348708
oshogbo [Wed, 5 Jun 2019 22:47:37 +0000 (22:47 +0000)]
tail: fix style nit introduced in the r348708

4 years agogeli: build warning fixes
oshogbo [Wed, 5 Jun 2019 22:46:18 +0000 (22:46 +0000)]
geli: build warning fixes

Submitted by: Aaron Prieger <aprieger@llnw.com>
Reviewed by: sbruno
Differential Revision: https://reviews.freebsd.org/D11068

4 years agotail: capsicumize
oshogbo [Wed, 5 Jun 2019 22:40:49 +0000 (22:40 +0000)]
tail: capsicumize

Submitted by: Nik Sultana <sultana@seas.upenn.edu>
Differential Revision: https://reviews.freebsd.org/D20393

4 years agounlink: add missing function to unlink.2 man page
oshogbo [Wed, 5 Jun 2019 22:36:19 +0000 (22:36 +0000)]
unlink: add missing function to unlink.2 man page

4 years agoDTrace: create an amd64 test suit
oshogbo [Wed, 5 Jun 2019 22:32:26 +0000 (22:32 +0000)]
DTrace: create an amd64 test suit

Create two tests checking if we can read urgs registers and if the
rax register returns a correct number.

Reviewed by: markj
Discussed with: lwhsu
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20364

4 years agodtrace: 64-bits registers support
oshogbo [Wed, 5 Jun 2019 22:29:05 +0000 (22:29 +0000)]
dtrace: 64-bits registers support

The registers in ilumos and FreeBSD have a different number.
In the illumos, last 32-bits register defined is SS an in FreeBSD is GS.
This off-by-one caused the uregs array to returns the wrong 64-bits register
on amd64.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20363

4 years agoIn vm_map_entry_set_vnode_text(), tolerate tmpfs mappings for which
kib [Wed, 5 Jun 2019 20:21:17 +0000 (20:21 +0000)]
In vm_map_entry_set_vnode_text(), tolerate tmpfs mappings for which
vnode is no longer resident.

Mapping of tmpfs file does not bump use count on the vnode, because
backing object has swap type.  As result, even during normal
operations, and of course on forced unmount, we might end up with text
mapping from tmpfs node which has no vnode in memory.  In this case,
there is no v_writecount to clear (this was done during reclaim), and
no reason to assert that the vnode is present.

Restructure the code to silently ignore OBJ_SWAP objects with
OBJ_TMPFS_NODE flag set, but OBJ_TMPFS flag clear.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agofusefs: simplify fuse_write_biobackend. No functional change.
asomers [Wed, 5 Jun 2019 20:18:56 +0000 (20:18 +0000)]
fusefs: simplify fuse_write_biobackend.  No functional change.

Sponsored by: The FreeBSD Foundation

4 years agosha.3: clarify admonition against use in NEW signature schemes
allanjude [Wed, 5 Jun 2019 20:18:08 +0000 (20:18 +0000)]
sha.3: clarify admonition against use in NEW signature schemes

Reported by: cem, cperciva (grammar)

4 years agoManually clear text references on reclaim for nullfs and tmpfs.
kib [Wed, 5 Jun 2019 20:16:25 +0000 (20:16 +0000)]
Manually clear text references on reclaim for nullfs and tmpfs.

Both filesystems do no use vnode_pager_dealloc() which would handle
this case otherwise.  Nullfs because vnode vm_object handle never
points to nullfs vnode.  Tmpfs because its vm_object is never vnode
object at all.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years ago[ath] [fix] athani compilation was broken by recent ath change
mizhka [Wed, 5 Jun 2019 19:55:30 +0000 (19:55 +0000)]
[ath] [fix] athani compilation was broken by recent ath change

 * This commit is going to fix build of AR724x on 13-CURRENT with additional
tools like athani. See r344841

4 years agoSupport MSI-X for passthrough devices with a separate PBA BAR.
jhb [Wed, 5 Jun 2019 19:30:32 +0000 (19:30 +0000)]
Support MSI-X for passthrough devices with a separate PBA BAR.

pci_alloc_msix() requires both the table and PBA BARs to be allocated
by the driver.  ppt was only allocating the table BAR so would fail
for devices with the PBA in a separate BAR.  Fix this by allocating
the PBA BAR before pci_alloc_msix() if it is stored in a separate BAR.

While here, release BARs after calling pci_release_msi() instead of
before.  Also, don't call bus_teardown_intr() in error handling code
if bus_setup_intr() has just failed.

Reported by: gallatin
Tested by: gallatin
Reviewed by: rgrimes, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20525

4 years agoDon't simulate PBA access if the PBA is in a separate BAR.
jhb [Wed, 5 Jun 2019 19:29:02 +0000 (19:29 +0000)]
Don't simulate PBA access if the PBA is in a separate BAR.

bhyve has to virtualize the MSI-X table to trap reads and writes to
that table and map those to virtual interrupts that it maps real host
interrupts on to.  For the pending-bit-array (PBA), bhyve passes
accesses from the guest directly to the hardware.

bhyve's virtualization of the MSI-X table is done by intercepting all
reads and writes to the BAR holding the MSI-X table.  However, if the
PBA is stored in the same BAR as the MSI-X table, accesses to the PBA
portion of this BAR have to be forwarded to the real BAR.

However, in the case that the PBA was stored in a separate BAR and
it's offset in that separate BAR overlapped with the portion of the
MSI-X table BAR that the table used, the handlers for the table BAR
would incorrectly think that some accesses were PBA reads and writes.
This caused a crash in bhyve when it indirected a NULL pointer.  Fix
this case by never trying to handle PBA access if the PBA lives in a
separate BAR.

Reported by: gallatin
Tested by: gallatin
Reviewed by: markj, Patrick Mooney
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20523

4 years agoAdd my birthday entry.
pkubaj [Wed, 5 Jun 2019 16:01:05 +0000 (16:01 +0000)]
Add my birthday entry.

4 years agovtfontcvt: exit on error if the input font has too many glyphs
emaste [Wed, 5 Jun 2019 15:23:48 +0000 (15:23 +0000)]
vtfontcvt: exit on error if the input font has too many glyphs

The kernel has a limit of 131072 glyphs in a font; add the same check to
vtfontcvt so that we won't create a font file that the kernel will not
load.

PR: 205707
Submitted by: Dmitry Wagin
MFC after: 2 weeks

4 years agoUse CLANG knob to remove llvm-symbolizer man page
emaste [Wed, 5 Jun 2019 14:08:39 +0000 (14:08 +0000)]
Use CLANG knob to remove llvm-symbolizer man page

r348504 moved llvm-symbolizer from the CLANG_EXTRAS knob to CLANG, but
the man page was still in the CLANG_EXTRAS section in
OptionalObsoleteFiles.inc.

Reported by: jhb
MFC after: 3 days
MFC with: r348504

4 years agofirst step towards enforcing must-succeed semantics for bus accessors
avg [Wed, 5 Jun 2019 13:18:00 +0000 (13:18 +0000)]
first step towards enforcing must-succeed semantics for bus accessors

Unlike BUS_READ_IVAR / BUS_WRITE_IVAR, bus accessors do not have a
return code.  It is assumed that there is a tight coupling between a bus
driver and a driver for a device on the bus with respect to instance
variables that the bus defines for its children.  So, the driver is
supposed to have only valid accesses to the variables and, thus, the
accessors must always succeed.

Of course, programming errors sometimes happen.  At present, such errors
go completely unnoticed.  The idea of this change is to start catching
them.  As a first step, there will be a warning about a failed accessor
call.  This is to give developers a heads-up.  I plan to replace the
printf with a KASSERT a week later, so that the warning is harder to
ignore.

Reviewed by: cem, imp, ian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20458

4 years agoanother occurrence where a very large dma mapping can cause integer overflow
tychon [Wed, 5 Jun 2019 13:08:21 +0000 (13:08 +0000)]
another occurrence where a very large dma mapping can cause integer overflow

Submitted by: rlibby
Sponsored by: Dell EMC Isilon

4 years agoInitialize V_nat64out methods explicitly.
ae [Wed, 5 Jun 2019 09:25:40 +0000 (09:25 +0000)]
Initialize V_nat64out methods explicitly.

It looks like initialization of static variable doesn't work for
VIMAGE and this leads to panic.

Reported by: olivier
MFC after: 1 week

4 years agoOnly respond to the PCIe Attention Button if a device is already plugged in.
cperciva [Wed, 5 Jun 2019 04:58:42 +0000 (04:58 +0000)]
Only respond to the PCIe Attention Button if a device is already plugged in.

Prior to this commit, if PCIEM_SLOT_STA_ABP and PCIEM_SLOT_STA_PDC are
asserted simultaneously, FreeBSD sets a 5 second "hardware going away" timer
and then processes the "presence detect" change. In the (physically
challenging) case that someone presses the "attention button" and inserts
a new PCIe device at exactly the same moment, this results in FreeBSD
recognizing that the device is present, attaching it, and then detaching it
5 seconds later.

On EC2 "bare metal" hardware this is the precise sequence of events which
takes place when a new EBS volume is attached; virtual machines have no
difficulty effecting physically implausible simultaneity.

This patch changes the handling of PCIEM_SLOT_STA_ABP to only detach a
device if the presence of a device was detected *before* the interrupt
which reports the Attention Button push.

Reported by: Matt Wilson
Reviewed by: jhb
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D20499

4 years agoAdd myself to committers-src.dot and calendar.freebsd
scottph [Wed, 5 Jun 2019 04:01:31 +0000 (04:01 +0000)]
Add myself to committers-src.dot and calendar.freebsd

Approved by: jhb (mentor)

4 years agoAdd self to calendar, per mckusick's request
meta [Wed, 5 Jun 2019 03:40:34 +0000 (03:40 +0000)]
Add self to calendar, per mckusick's request

4 years agoEliminate unused uuid parameters from gptread and gptread_table. We
imp [Wed, 5 Jun 2019 02:34:58 +0000 (02:34 +0000)]
Eliminate unused uuid parameters from gptread and gptread_table.  We
only need it for the gptfind() function, where it's used.

4 years agomove llvm-ar and llvm-nm to appropriate location in OptionalObsoleteFiles.inc
emaste [Wed, 5 Jun 2019 00:55:22 +0000 (00:55 +0000)]
move llvm-ar and llvm-nm to appropriate location in OptionalObsoleteFiles.inc

After r348610 `make delete-old` was still removing llvm-ar and llvm-nm
(and associated man pages).

Reported by: jhb
Sponsored by: The FreeBSD Foundation

4 years agoufs_module.c can't currently be compiled with -Wcast-align, but the
imp [Wed, 5 Jun 2019 00:08:30 +0000 (00:08 +0000)]
ufs_module.c can't currently be compiled with -Wcast-align, but the
code is safe enough. Turn off the warning for now until I can find the
right construct to silence it in the code.

4 years agoDon't shadow a global zfsmount variable.
imp [Wed, 5 Jun 2019 00:04:21 +0000 (00:04 +0000)]
Don't shadow a global zfsmount variable.

4 years agoAdd self to calendar, per Kirk's request
adridg [Tue, 4 Jun 2019 21:54:34 +0000 (21:54 +0000)]
Add self to calendar, per Kirk's request

4 years agoRather than using the legacy IP struct fields in the union for the
bz [Tue, 4 Jun 2019 20:53:35 +0000 (20:53 +0000)]
Rather than using the legacy IP struct fields in the union for the
port number, properly access them by their IPv6 names.
This will make it easier to slice up and compile out address families
in the future.

No functional change intended.

MFC after: 6 weeks

4 years agoAdd myself to committers-src.dot and calendar.freebsd
vmaffione [Tue, 4 Jun 2019 19:59:43 +0000 (19:59 +0000)]
Add myself to committers-src.dot and calendar.freebsd

Reviewed by: mckusick
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20518

4 years agovtfontcvt: zero memory allocated by xmalloc
emaste [Tue, 4 Jun 2019 19:39:06 +0000 (19:39 +0000)]
vtfontcvt: zero memory allocated by xmalloc

PR: 205707
Submitted by: Dmitry Wagin

4 years agoWhile working on a PR, more are discovered.
cy [Tue, 4 Jun 2019 19:37:51 +0000 (19:37 +0000)]
While working on a PR, more are discovered.
Remove more #ifdefs missed in r343701.

MFC after: 1 week

4 years agoClean up #ifdefs from old unsupported releases of FreeBSD.
cy [Tue, 4 Jun 2019 19:25:32 +0000 (19:25 +0000)]
Clean up #ifdefs from old unsupported releases of FreeBSD.

MFC after: 1 week

4 years agoAdd birthday entry.
dougm [Tue, 4 Jun 2019 19:16:05 +0000 (19:16 +0000)]
Add birthday entry.

4 years agoAdd my birthday entry, per Kirk's request
sef [Tue, 4 Jun 2019 19:06:33 +0000 (19:06 +0000)]
Add my birthday entry, per Kirk's request

4 years agofusefs: remove debugging code that accidentally snuck into r348365
asomers [Tue, 4 Jun 2019 19:06:24 +0000 (19:06 +0000)]
fusefs: remove debugging code that accidentally snuck into r348365

Sponsored by: The FreeBSD Foundation

4 years agovtfontcvt: include width and height in verbose info
emaste [Tue, 4 Jun 2019 18:55:02 +0000 (18:55 +0000)]
vtfontcvt: include width and height in verbose info

PR: 205707
Submitted by: Dmitry Wagin

4 years agovtfontcvt: rework height/width setting
emaste [Tue, 4 Jun 2019 18:49:49 +0000 (18:49 +0000)]
vtfontcvt: rework height/width setting

Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
consistently use set_height and set_width.

PR: 205707
Submitted by: Dmitry Wagin

4 years agoRemove an outdated header comment for vm_page.c.
markj [Tue, 4 Jun 2019 18:38:27 +0000 (18:38 +0000)]
Remove an outdated header comment for vm_page.c.

The listed rules were incomplete and outdated.  There is a much more
comprehensive comment in vm_page.h.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20503

4 years agoUse newly minted efi_devpath_same_disk() instead of
imp [Tue, 4 Jun 2019 18:36:12 +0000 (18:36 +0000)]
Use newly minted efi_devpath_same_disk() instead of
efi_devpath_match(). This fixes a regression in r347193.

Reported by: Tomoaki AOKI
Differential Revision: https://reviews.freebsd.org/D20513

4 years agoIntroduce efi_devpath_same_disk
imp [Tue, 4 Jun 2019 18:36:07 +0000 (18:36 +0000)]
Introduce efi_devpath_same_disk

This is like efi_devpath_match, but allows differing device media
paths. Those just specify the partition information.

Differential Revision: https://reviews.freebsd.org/D20513

4 years agoelfcopy: Use libelftc's string table routines to build .shstrtab.
markj [Tue, 4 Jun 2019 18:34:05 +0000 (18:34 +0000)]
elfcopy: Use libelftc's string table routines to build .shstrtab.

This replaces some hand-rolled routines and is substantially faster
since libelftc uses a hash table for lookups and insertions, whereas
elfcopy would perform a linear scan of the table.

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20473

4 years agovtfontcvt: unwrap a line per style(9)
emaste [Tue, 4 Jun 2019 18:31:52 +0000 (18:31 +0000)]
vtfontcvt: unwrap a line per style(9)

PR: 205707
Submitted by: Dmitry Wagin

4 years agolibelftc: Fix some minor style bugs.
markj [Tue, 4 Jun 2019 18:31:08 +0000 (18:31 +0000)]
libelftc: Fix some minor style bugs.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20472

4 years agoelfcopy: Use elf_getscn() instead of iterating over all sections.
markj [Tue, 4 Jun 2019 18:29:08 +0000 (18:29 +0000)]
elfcopy: Use elf_getscn() instead of iterating over all sections.

When removing a section, we would loop over all sections looking for
a corresponding relocation section.  With r348652 it is much faster
to just use elf_getscn().

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20471

4 years agovtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants
emaste [Tue, 4 Jun 2019 18:26:42 +0000 (18:26 +0000)]
vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants

PR: 205707
Reported by: Dmitry Wagin
MFC after: 1 month

4 years agolibelf: Use a red-black tree to manage the section list.
markj [Tue, 4 Jun 2019 18:26:29 +0000 (18:26 +0000)]
libelf: Use a red-black tree to manage the section list.

The tree is indexed by section number.  This speeds up elf_getscn()
and its callers, which previously had to traverse a linked list. In
particular, since .shstrtab is often the last section in a file,
elf_strptr() would have to traverse the entire list.

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20443

4 years agoIn usb(4) fix a lost completion event issue towards libusb(3). It may happen
hselasky [Tue, 4 Jun 2019 16:40:18 +0000 (16:40 +0000)]
In usb(4) fix a lost completion event issue towards libusb(3). It may happen
if a USB transfer is cancelled that we need to fake a completion event.
Implement missing support in ugen_fs_copy_out() to handle this.

This fixes issues with webcamd(8) and firefox.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoThe changes to pmap_demote_pde_locked()'s control flow in r348476 resulted
alc [Tue, 4 Jun 2019 16:21:14 +0000 (16:21 +0000)]
The changes to pmap_demote_pde_locked()'s control flow in r348476 resulted
in the loss of a KASSERT that guarded against the invalidation a wired
mapping.  Restore this KASSERT.

Remove an unnecessary KASSERT from pmap_demote_pde_locked().  It guards
against a state that was already handled at the start of the function.

Reviewed by: kib
X-MFC with: r348476

4 years agodaemon(8): Don't block SIGTERM during restart delay
cem [Tue, 4 Jun 2019 16:07:01 +0000 (16:07 +0000)]
daemon(8): Don't block SIGTERM during restart delay

I believe this was introduced in the original '-r' commit, r231911 (2012).
At the time, the scope was limited to a 1 second sleep.  r332518 (2018)
added '-R', which increased the potential duration of the affected interval
(from 1 to N seconds) by permitting arbitrary restart intervals.

Instead, handle SIGTERM normally during restart-sleep, when the monitored
process is not running, and shut down promptly.

(I noticed this behavior when debugging a child process that exited quickly
under the 'daemon -r -R 30' environment.  'kill <daemonpid>' had no
immediate effect and the monitor process slept until the next restart
attempt.  This was annoying.)

Reviewed by: allanjude, imp, markj
Differential Revision: https://reviews.freebsd.org/D20509

4 years agoelf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits
emaste [Tue, 4 Jun 2019 15:44:31 +0000 (15:44 +0000)]
elf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits

To support Intel CET IBT/Shadow Stack.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agostyle(9) / tidying for r348611
emaste [Tue, 4 Jun 2019 13:45:30 +0000 (13:45 +0000)]
style(9) / tidying for r348611

MFC with: r348611
Event: Waterloo Hackathon 2019

4 years agoExpose the kernel's build-ID through sysctl
emaste [Tue, 4 Jun 2019 13:07:10 +0000 (13:07 +0000)]
Expose the kernel's build-ID through sysctl

After our migration (of certain architectures) to lld the kernel is built
with a unique build-ID.  Make it available via a sysctl and uname(1) to
allow the user to identify their running kernel.

Submitted by: Ali Mashtizadeh <ali_mashtizadeh.com>
MFC after: 2 weeks
Relnotes: Yes
Event: Waterloo Hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20326

4 years agobuild llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)
emaste [Tue, 4 Jun 2019 13:00:49 +0000 (13:00 +0000)]
build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)

To facilitate experimentation with LTO we require an ar that supports
LLVM IR, and to a lesser degree also an nm.  As a first step always
install llvm-ar and llvm-nm.

Sponsored by: The FreeBSD Foundation

4 years agoMakefile.inc1: clean up stale dependency hacks
emaste [Tue, 4 Jun 2019 12:56:20 +0000 (12:56 +0000)]
Makefile.inc1: clean up stale dependency hacks

Carrying on from r339607, remove ad-hoc dependency cleanup for changes
prior to June 2018.

Sponsored by: The FreeBSD Foundation

4 years agoIn xhci(4) there is no stream ID in the completion TRB.
hselasky [Tue, 4 Jun 2019 09:01:02 +0000 (09:01 +0000)]
In xhci(4) there is no stream ID in the completion TRB.
Instead iterate all the stream IDs in stream mode to find
the matching USB transfer.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoMake sure the DMA tags get freed in mlx5en(4).
hselasky [Tue, 4 Jun 2019 08:06:51 +0000 (08:06 +0000)]
Make sure the DMA tags get freed in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoDon't increment cl after increment.
delphij [Tue, 4 Jun 2019 07:02:20 +0000 (07:02 +0000)]
Don't increment cl after increment.

MFC after: 3 days

4 years agoFix prio vs. nonprio tagged traffic in RDMACM
slavash [Tue, 4 Jun 2019 06:21:31 +0000 (06:21 +0000)]
Fix prio vs. nonprio tagged traffic in RDMACM

In current RDMACM implementation RDMACM server will not find a GID
index when the request was prio-tagged and the sever is non
prio-tagged and vise-versa.
According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should
be considered as untagged. Treat RDMACM request the same.

Reviewed by:    hselasky, kib
MFC after:      3 Days
Sponsored by:   Mellanox Technologies

4 years agovirtio(4): Add PNP match metadata for virtio devices
cem [Tue, 4 Jun 2019 02:37:11 +0000 (02:37 +0000)]
virtio(4): Add PNP match metadata for virtio devices

Register MODULE_PNP_INFO for virtio devices using the newbus PNP information
provided by the previous commit.  Matching can be quite simple; existing
probe routines only matched on bus (implicit) and device_type.  The same
matching criteria are retained exactly, but is now also available to
devmatch(8).

Reviewed by: bryanv, markj; imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D20407

4 years agovirtio(4): Expose PNP metadata through newbus
cem [Tue, 4 Jun 2019 02:34:59 +0000 (02:34 +0000)]
virtio(4): Expose PNP metadata through newbus

Expose the same fields and widths from both vtio buses, even though they
don't quite line up; several virtio drivers can attach to both buses,
and sharing a PNP info table for both seems more convenient.

In practice, I doubt any virtio driver really needs to match on anything
other than bus and device_type (eliminating the unused entries for
vtmmio), and also in practice device_type is << 2^16 (so far, values
range from 1 to 20).  So it might be fine to only expose a 16-bit
device_type for PNP purposes.  On the other hand, I don't see much harm
in overkill here.

Reviewed by: bryanv, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D20406

4 years agovirtio_random(4): Fix random(4) integration
cem [Tue, 4 Jun 2019 00:01:37 +0000 (00:01 +0000)]
virtio_random(4): Fix random(4) integration

random(4) masks unregistered entropy sources.  Prior to this revision,
virtio_random(4) did not correctly register a random_source and did not
function as a source of entropy.

Random source registration for loadable pure sources requires registering a
poll callback, which is invoked periodically by random(4)'s harvestq
kthread.  The periodic poll makes virtio_random(4)'s periodic entropy
collection redundant, so this revision removes the callout.

The current random source API is somewhat limiting, so simply fail to attach
any virtio_random devices if one is already registered as a source.  This
scenario is expected to be uncommon.

While here, handle the possibility of short reads from the hypervisor random
device gracefully / correctly.  It is not clear why a hypervisor would
return a short read or if it is allowed by spec, but we may as well handle
it.

Reviewed by: bryanv (earlier version), markm
Security: yes (note: many other "pure" random sources remain broken)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20419

4 years agostyle.9: Codify tolerance for eliding blank lines
cem [Mon, 3 Jun 2019 23:57:29 +0000 (23:57 +0000)]
style.9: Codify tolerance for eliding blank lines

Consensus seems to be that eliding blank lines for functions with no local
variables is acceptable.  Codify that explicitly in the style document.

Reported by: jhb
Reviewed by: delphij, imp, vangyzen (earlier version); rgrimes
With feedback from: kib
Differential Revision: https://reviews.freebsd.org/D20448

4 years agofusefs: respect RLIMIT_FSIZE
asomers [Mon, 3 Jun 2019 23:24:07 +0000 (23:24 +0000)]
fusefs: respect RLIMIT_FSIZE

Sponsored by: The FreeBSD Foundation

4 years agoEmulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.
jhb [Mon, 3 Jun 2019 23:17:35 +0000 (23:17 +0000)]
Emulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.

Writes are ignored and reads always return zero.

Submitted by: José Albornoz <jojo@eljojo.net> (write-only version)
Reviewed by: Patrick Mooney, cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19506

4 years agor348590 had mention of "-I" in a comment that no longer applied to the patch.
rmacklem [Mon, 3 Jun 2019 23:07:46 +0000 (23:07 +0000)]
r348590 had mention of "-I" in a comment that no longer applied to the patch.

Take "-I" out of the comment line, since the patch no longer uses the "-I"
option.

MFC after: 1 month

4 years agoModify mountd so that it incrementally updates the kernel exports upon a reload.
rmacklem [Mon, 3 Jun 2019 22:58:51 +0000 (22:58 +0000)]
Modify mountd so that it incrementally updates the kernel exports upon a reload.

Without this patch, mountd would delete/load all exports from the exports
file(s) when it receives a SIGHUP. This works fine for small exports file(s),
but can take several seconds to do when there are large numbers (10000+) of
exported file systems. Most of this time is spent doing the system calls
that delete/export each of these file systems. When the "-S" option
has been specified (the default these days), the nfsd threads are suspended
for several seconds while the reload is done.

This patch changes mountd so that it only does system calls for file systems
where the exports have been changed/added/deleted as compared to the exports
done for the previous load/reload of the exports file(s).
Basically, when SIGHUP is posted to mountd, it saves the exportlist structures
from the previous load and creates a new set of structures from the current
exports file(s). Then it compares the current with the previous and only does
system calls for cases that have been changed/added/deleted.
The nfsd threads do not need to be suspended until the comparison step is
being done. This results in a suspension period of milliseconds for a server
with 10000+ exported file systems.

There is some code using a LOGDEBUG() macro that allow runtime debugging
output via syslog(LOG_DEBUG,...) that can be enabled by creating a file
called /var/log/mountd.debug. This code is expected to be replaced with
code that uses dtrace by cy@ in the near future, once issues w.r.t. dtrace
in stable/12 have been resolved.

The patch should not change the usage of the exports file(s), but improves
the performance of reloading large exports file(s) where there are only a
small number of changes done to the file(s).

Tested by: pen@lysator.liu.se
PR: 237860
Reviewed by: kib
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D20487

4 years agoPut back MTREE_CMD here for now. Doh, not my day, perhaps.
sobomax [Mon, 3 Jun 2019 21:40:42 +0000 (21:40 +0000)]
Put back MTREE_CMD here for now. Doh, not my day, perhaps.

Reported by: markj, mav

4 years agoMFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
mav [Mon, 3 Jun 2019 20:55:52 +0000 (20:55 +0000)]
MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()

illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb

Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Pavel Zakharov <pavel.zakharov@delphix.com>

This is irrelevant to FreeBSD, just to reduce divergence.

4 years agoMFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
mav [Mon, 3 Jun 2019 20:49:20 +0000 (20:49 +0000)]
MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects

illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agofusefs: don't require FUSE_EXPORT_SUPPORT for async invalidation
asomers [Mon, 3 Jun 2019 20:45:32 +0000 (20:45 +0000)]
fusefs: don't require FUSE_EXPORT_SUPPORT for async invalidation

In r348560 I thought that FUSE_EXPORT_SUPPORT was required for cases where
the node to be invalidated (or the parent of the entry to be invalidated)
wasn't cached.  But I realize now that that's not the case.  During entry
invalidation, if the parent isn't in the vfs hash table, then it must've
been reclaimed.  And since fuse_vnop_reclaim does a cache_purge, that means
the entry to be invalidated has already been removed from the namecache.
And during inode invalidation, if the inode to be invalidated isn't in the
vfs hash table, then it too must've been reclaimed.  In that case it will
have no buffer cache to invalidate.

Sponsored by: The FreeBSD Foundation

4 years agoMFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly
mav [Mon, 3 Jun 2019 20:40:32 +0000 (20:40 +0000)]
MFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly

illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b

Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Paul Dagnelie <pcd@delphix.com>

4 years agoMFV r348578: 9962 zil_commit should omit cache thrash
mav [Mon, 3 Jun 2019 20:24:40 +0000 (20:24 +0000)]
MFV r348578: 9962 zil_commit should omit cache thrash

illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoMFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush
mav [Mon, 3 Jun 2019 20:05:43 +0000 (20:05 +0000)]
MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush

illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoProperly define the fourth argument to ipf_check, the main entry point
cy [Mon, 3 Jun 2019 19:37:14 +0000 (19:37 +0000)]
Properly define the fourth argument to ipf_check, the main entry point
into ipfilter. A proper definition simplifies dtrace scripts a little.

MFC after: 1 week

4 years agoMFV r348573: 9993 zil writes can get delayed in zio pipeline
mav [Mon, 3 Jun 2019 19:25:53 +0000 (19:25 +0000)]
MFV r348573: 9993 zil writes can get delayed in zio pipeline

illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     George Wilson <george.wilson@delphix.com>

4 years agovery large dma mappings can cause integer overflow
tychon [Mon, 3 Jun 2019 19:19:35 +0000 (19:19 +0000)]
very large dma mappings can cause integer overflow

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20505

4 years agoMFV r348568: 9466 add JSON output support to channel programs
mav [Mon, 3 Jun 2019 19:15:06 +0000 (19:15 +0000)]
MFV r348568: 9466 add JSON output support to channel programs

illumos/illumos-gate@5267591016146502784860802129b16dab6f135c

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Alek Pinchuk <apinchuk@datto.com>

4 years ago[zfsboot] Fix boot env back compat (#190)
imp [Mon, 3 Jun 2019 19:10:46 +0000 (19:10 +0000)]
[zfsboot] Fix boot env back compat (#190)

* Fix boot env back compat

zfsboot must try zfsloader before loader in order to remain compatible
with boot environments created prior to zfs functionality being rolled
into loader proper.

* Improve comments in zfsboot

Explain the significance of the load path order, and put the comment
about looping through the paths in the appropriate scope.

Obtained From:  TrueNAS commit 4c60c62fcf0b6b6eac98ee8d46e7bbea64bc86f5
Submitted by: Ryan Moeller <ryan@freqlabs.com>

4 years agoMFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal
mav [Mon, 3 Jun 2019 19:03:24 +0000 (19:03 +0000)]
MFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal

illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Serapheim Dimitropoulos <serapheim@delphix.com>

4 years agoMFC r348554: 9688 aggsum_fini leaks memory
mav [Mon, 3 Jun 2019 19:00:24 +0000 (19:00 +0000)]
MFC r348554: 9688 aggsum_fini leaks memory

illumos/illumos-gate@29bf2d68bef208274f5a54a14cc80c4a8cb76f53

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Paul Dagnelie <pcd@delphix.com>

4 years agoMFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()
mav [Mon, 3 Jun 2019 18:32:56 +0000 (18:32 +0000)]
MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()

illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agoMFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool
mav [Mon, 3 Jun 2019 17:56:44 +0000 (17:56 +0000)]
MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool

illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Serapheim Dimitropoulos <serapheim@delphix.com>

4 years agoMFV r348551: 9862 fix typo in comment in vdev_impl.h
mav [Mon, 3 Jun 2019 17:44:47 +0000 (17:44 +0000)]
MFV r348551: 9862 fix typo in comment in vdev_impl.h

illumos/illumos-gate@84927f52bd837f6e4882a19e43fd026f1828d910

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Allan Jude <allanjude@freebsd.org>

4 years agoMFV r348550: 1700 Add SCSI UNMAP support
mav [Mon, 3 Jun 2019 17:43:32 +0000 (17:43 +0000)]
MFV r348550: 1700 Add SCSI UNMAP support

illumos/illumos-gate@047c81d31d0f571d6652e97143cd15281de61e84

Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Saso Kiselkov <saso.kiselkov@nexenta.com>

This is irrelevant to FreeBSD, just a diff reduction.

4 years agoMFV r348548: 9617 too-frequent TXG sync causes excessive write inflation
mav [Mon, 3 Jun 2019 17:40:11 +0000 (17:40 +0000)]
MFV r348548: 9617 too-frequent TXG sync causes excessive write inflation

illumos/illumos-gate@7928f4baf4ab3230557eb6289be68aa7a3003f38

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agofusefs: support asynchronous cache invalidation
asomers [Mon, 3 Jun 2019 17:34:01 +0000 (17:34 +0000)]
fusefs: support asynchronous cache invalidation

Protocol 7.12 adds a way for the server to notify the client that it should
invalidate an inode's data cache and/or attributes.  This commit implements
that mechanism.  Unlike Linux's implementation, ours requires that the file
system also supports FUSE_EXPORT_SUPPORT (NFS-style lookups).  Otherwise the
invalidation operation will return EINVAL.

Sponsored by: The FreeBSD Foundation

4 years agoMFV r348537: 8601 memory leak in get_special_prop()
mav [Mon, 3 Jun 2019 17:29:57 +0000 (17:29 +0000)]
MFV r348537: 8601 memory leak in get_special_prop()

illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     John Gallagher <john.gallagher@delphix.com>