]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r348797:
Hans Petter Selasky [Tue, 11 Jun 2019 08:52:48 +0000 (08:52 +0000)]
MFC r348797:
Fix for reading the configuration descriptor in libusb. Catch invalid
configuration descriptor reads early on to avoid issues with devices
that don't check for a valid USB configuration read request.

Submitted by: takahiro.kurosawa@gmail.com
PR: 238412

4 years agoMFC r348667:
Cy Schubert [Tue, 11 Jun 2019 03:07:23 +0000 (03:07 +0000)]
MFC r348667:

While working on a PR, more are discovered.
Remove more #ifdefs missed in r343701.

4 years agoMFC r348666:
Cy Schubert [Tue, 11 Jun 2019 03:06:36 +0000 (03:06 +0000)]
MFC r348666:

Clean up #ifdefs from old unsupported releases of FreeBSD.

4 years agoMFC r348332: Fix array out of bound panic introduced in r306219.
Alexander Motin [Tue, 11 Jun 2019 01:09:54 +0000 (01:09 +0000)]
MFC r348332: Fix array out of bound panic introduced in r306219.

As I see, different NICs in different configurations may have different
numbers of TX and RX queues.  The code was assuming 1:1 mapping between
event queues (interrupts) and TX/RX queues.  Since number of interrupts
is set to maximum of TX and RX queues, when those two are different, the
system is doomed.

I have no documentation or deep knowledge about this hardware, so this
change is based on general observations and code reading.  If some of my
guesses are wrong, please do better.  I just confirmed HP NC550SFP NICs
are working now.

4 years agoMFC r348541:
Konstantin Belousov [Mon, 10 Jun 2019 17:44:50 +0000 (17:44 +0000)]
MFC r348541:
efirt efi_enter(): Release acquired locks and restore FPU ownership if
efi_arch_enter() returned an error.

4 years agoMFC r348539:
Konstantin Belousov [Mon, 10 Jun 2019 17:43:33 +0000 (17:43 +0000)]
MFC r348539:
amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service.

4 years agoMFC r348533:
Konstantin Belousov [Mon, 10 Jun 2019 17:40:31 +0000 (17:40 +0000)]
MFC r348533:
Remove dead store.

4 years agoMFC r348536:
Konstantin Belousov [Mon, 10 Jun 2019 17:38:47 +0000 (17:38 +0000)]
MFC r348536:
Remove dead check.

4 years agoMFC r348544:
Konstantin Belousov [Mon, 10 Jun 2019 17:36:14 +0000 (17:36 +0000)]
MFC r348544:
hwpmc_intel: List all Silvermont ids.

4 years agoMFC r348569: [zfsboot] Fix boot env back compat (#190)
Kyle Evans [Mon, 10 Jun 2019 15:46:19 +0000 (15:46 +0000)]
MFC r348569: [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.

4 years agoMFC r348782:
Mark Johnston [Mon, 10 Jun 2019 15:44:09 +0000 (15:44 +0000)]
MFC r348782:
vmrun: Add a missing close-paren to the usage message.

4 years agoMFC r348510: bectl(8): Don't accept jid=0 from jail_getid
Kyle Evans [Mon, 10 Jun 2019 14:35:04 +0000 (14:35 +0000)]
MFC r348510: bectl(8): Don't accept jid=0 from jail_getid

This will trivially exist, but we don't want it - none of our jailed BEs
will have jid=0.

4 years agoMFC r348631:
Hans Petter Selasky [Mon, 10 Jun 2019 13:36:53 +0000 (13:36 +0000)]
MFC r348631:
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.

Sponsored by: Mellanox Technologies

4 years agoMFC r348604:
Hans Petter Selasky [Mon, 10 Jun 2019 13:16:49 +0000 (13:16 +0000)]
MFC r348604:
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.

Sponsored by: Mellanox Technologies

4 years agoMFC r348601:
Slava Shwartsman [Mon, 10 Jun 2019 09:03:08 +0000 (09:03 +0000)]
MFC r348601:
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
Sponsored by:   Mellanox Technologies

4 years agoMFC r348575:
Cy Schubert [Mon, 10 Jun 2019 05:09:34 +0000 (05:09 +0000)]
MFC r348575:

Properly define the fourth argument to ipf_check, the main entry point
into ipfilter. A proper definition simplifies dtrace scripts a little.

4 years agoMFC r348603:
Hans Petter Selasky [Sun, 9 Jun 2019 08:19:45 +0000 (08:19 +0000)]
MFC r348603:
Make sure the DMA tags get freed in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r347439:
Mark Johnston [Sun, 9 Jun 2019 03:31:07 +0000 (03:31 +0000)]
MFC r347439:
Atomically update the global gMsgId in libnetgraph.

PR: 234442

4 years agoMFC r348502:
Mark Johnston [Sun, 9 Jun 2019 03:29:26 +0000 (03:29 +0000)]
MFC r348502:
Add a vm_page_wired() predicate.

4 years agoMFC r348718:
Cy Schubert [Sun, 9 Jun 2019 01:26:56 +0000 (01:26 +0000)]
MFC r348718:

Whitespace adjustment.

4 years agoMFC r348496: Document max_chains bump to 16384 at r330049.
Alexander Motin [Sat, 8 Jun 2019 02:30:16 +0000 (02:30 +0000)]
MFC r348496: Document max_chains bump to 16384 at r330049.

4 years agoMFC of 348259
Kirk McKusick [Fri, 7 Jun 2019 22:24:57 +0000 (22:24 +0000)]
MFC of 348259

Proper draining of GEOM nop forced shutdown.

4 years agoMFC r348500:
Dimitry Andric [Fri, 7 Jun 2019 18:01:29 +0000 (18:01 +0000)]
MFC r348500:

Partially revert r271349, which disabled the msun cexp test #4 on i386.

Ensure the expected result is stored first in a volatile variable with
the desired type.  This makes all the tests succeed.

Slightly changed from the original pull request, but functionally the
same.

Obtained from: https://github.com/freebsd/freebsd/pull/401
Submitted by: Moritz Buhl <gh@moritzbuhl.de>
PR: 191676

4 years agoMFC r348457:
Mark Johnston [Fri, 7 Jun 2019 17:05:58 +0000 (17:05 +0000)]
MFC r348457:
Remove a redundant vm_page_remove() call.

4 years agoMFC r348476, r348630 (by alc):
Konstantin Belousov [Fri, 7 Jun 2019 10:09:43 +0000 (10:09 +0000)]
MFC r348476, r348630 (by alc):
Simplify flow of pmap_demote_pde_locked() and add more comprehensive
debugging checks.

4 years agoMFC r348235:
Andrey V. Elsukov [Fri, 7 Jun 2019 08:21:01 +0000 (08:21 +0000)]
MFC r348235:
  Add `missing` and `or-flush` options to "ipfw table <NAME> create"
  command to simplify firewall reloading.

  The `missing` option suppresses EEXIST error code, but does check that
  existing table has the same parameters as new one. The `or-flush` option
  implies `missing` option and additionally does flush for table if it
  is already exist.

  Submitted by: lev
  Differential Revision: https://reviews.freebsd.org/D18339

MFC r348301
  Remove unused token that was added in r348235.

4 years agoMFC 348542: Add 'device cxgbe' explicitly in the synopsis.
John Baldwin [Thu, 6 Jun 2019 20:03:23 +0000 (20:03 +0000)]
MFC 348542: Add 'device cxgbe' explicitly in the synopsis.

ccr depends on symbols exported by the cxgbe driver as well as having
a runtime dependency.  While the runtime depenency was noted in the
manpage already, the compile-time dependency wasn't as clear.

PR: 238265

4 years agoMFC 346931,346933: Note that ccr(4) now supports AES-CCM.
John Baldwin [Thu, 6 Jun 2019 19:48:27 +0000 (19:48 +0000)]
MFC 346931,346933: Note that ccr(4) now supports AES-CCM.

346931:
Note that ccr(4) now supports AES-CCM.

346933:
Rewrap some long lines.

Whitespace only change.

4 years agoMFC 348543: Warn about deprecated features on all major OS versions.
John Baldwin [Thu, 6 Jun 2019 19:40:12 +0000 (19:40 +0000)]
MFC 348543: Warn about deprecated features on all major OS versions.

4 years agoMFC r348153-r348155: gpioled: add a new hint for initial state
Andriy Gapon [Thu, 6 Jun 2019 11:42:26 +0000 (11:42 +0000)]
MFC r348153-r348155: gpioled: add a new hint for initial state

hint.gpioled.%d.state determines the initial state of the LED when the
driver takes control over it:
  0 - the LED is off
  1 - the LED is on
 -1 - the LED is kept as it was

While here, add a module version declaration.

4 years agoMFC r345411: intpm: change translation of HBA error status to smbus(4) errors
Andriy Gapon [Thu, 6 Jun 2019 11:38:53 +0000 (11:38 +0000)]
MFC r345411: intpm: change translation of HBA error status to smbus(4) errors

PIIX4_SMBHSTSTAT_ERR can be set for several reasons that, unfortunately,
cannot be distinguished, but the most typical case is a missing or hung
slave (SMB_ENOACK).

PIIX4_SMBHSTSTAT_FAIL means failed or killed / aborted transaction, so
it's previous mapping to SMB_ENOACK was not ideal.

After this change an smb(4) access to a missing slave results in ENXIO
rather than EIO.  To me, that seems to be more appropriate.

4 years agoMFC r344361: zpool.8: sort zpool status flags in the same order as in illumos manual
Andriy Gapon [Thu, 6 Jun 2019 11:36:58 +0000 (11:36 +0000)]
MFC r344361: zpool.8: sort zpool status flags in the same order as in illumos manual

4 years agoMFC r344360: zpool.8: document -D flag for zpool status
Andriy Gapon [Thu, 6 Jun 2019 11:35:23 +0000 (11:35 +0000)]
MFC r344360: zpool.8: document -D flag for zpool status

4 years agoMFC r344359: fix userland illumos taskq code to pass relative timeout to cv_timedwait
Andriy Gapon [Thu, 6 Jun 2019 11:32:39 +0000 (11:32 +0000)]
MFC r344359: fix userland illumos taskq code to pass relative timeout to cv_timedwait

Unlike illumos, FreeBSD cv_timedwait requires a relative timeout.  That
applies both to the kernel illumos compatibility code and to the
userland "fake kernel" code.

Sponsored by: Panzura

4 years agoMFC r348439:
Glen Barber [Thu, 6 Jun 2019 03:31:55 +0000 (03:31 +0000)]
MFC r348439:
 Increase the size of the Vagrant default image size, as the 3GB
 size is too small to bootstrap the firstboot_pkgs list.

 While here, add the growfs(8) startup script to /etc/rc.conf,
 as Vagrant images can be resized by modifying the Vagrantfile.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r348545:
Mark Johnston [Thu, 6 Jun 2019 03:04:33 +0000 (03:04 +0000)]
MFC r348545:
Typo.

4 years agoMFC r348431:
Mark Johnston [Thu, 6 Jun 2019 03:03:54 +0000 (03:03 +0000)]
MFC r348431:
elfcopy: Optimize for insertions at the end of the section list.

PR: 234949

4 years agoMFC r348430:
Mark Johnston [Thu, 6 Jun 2019 03:02:43 +0000 (03:02 +0000)]
MFC r348430:
elfcopy: Remove an unneeded memset.

4 years agoMFC r348443:
Mark Johnston [Thu, 6 Jun 2019 03:01:52 +0000 (03:01 +0000)]
MFC r348443:
readelf: Make -t imply -S, for compatibility with GNU binutils.

4 years agoMFC r348547:
Mark Johnston [Thu, 6 Jun 2019 03:01:05 +0000 (03:01 +0000)]
MFC r348547:
rpc.yppasswdd: Fix dirname(3) usage after r305952.

PR: 234972

4 years agoMFC r348444:
Mark Johnston [Thu, 6 Jun 2019 02:58:11 +0000 (02:58 +0000)]
MFC r348444:
libelftc: Add MLINKS.

4 years agoMFC r348417: Fix busy status leak in case of incorrect passthrough args.
Alexander Motin [Thu, 6 Jun 2019 01:16:04 +0000 (01:16 +0000)]
MFC r348417: Fix busy status leak in case of incorrect passthrough args.

4 years agoMFC r348065:
Allan Jude [Wed, 5 Jun 2019 20:31:09 +0000 (20:31 +0000)]
MFC r348065:

Correct the way remaining battery life is calculated

Previously, if a system had multiple batteries, the remaining life
percentage was calculated as the average of each battery's percent
remaining. This results in rather incorrect values when you consider the
case of the Thinkpad X270 that has a small 3 cell internally battery, and
a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%,
but battery 1 is at 10%, you do not infact have 55% of your capacity
remaining.

The new method calculates the percentage based on remaining capacity
out of total capacity, giving a much more accurate reading.

PR: 229818
Submitted by: Keegan Drake H.P. <kd-dev@pm.me>
Sponsored by: Klara Systems
Event: Waterloo Hackathon 2019

4 years agoMFC r348068, r348071
Allan Jude [Wed, 5 Jun 2019 20:27:26 +0000 (20:27 +0000)]
MFC r348068, r348071

r348068:
ZFS: Make deadman tunables no longer read-only

This allows the user to enable, disable, and adjust the I/O deadman at
runtime. This can be especially useful when a pool is backed by remote
storage (such as iscsi, ggated, etc).

PR: 221906
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD
Sponsored by: Klara Systems
Event: Waterloo Hackathon 2019

r348071:
Fix typo in r348068

Sponsored by: Klara Systems

5 years agoMFC r347953:
Allan Jude [Wed, 5 Jun 2019 19:46:35 +0000 (19:46 +0000)]
MFC r347953:

MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first

zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee

zfs_main: fix `zfs userspace` squashing unresolved entries

The `zfs userspace` squashes all entries with unresolved numeric
values into a single output entry due to the comparsion always
made by the string name which is empty in case of unresolved IDs.

Fix this by falling to a numerical comparison when either one
of string values is not found. This then compares any numerical
values after all with a name resolved.

Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reported by: clusteradm
Obtained from: ZFS-on-Linux

5 years agoMFC r345676:
Leandro Lupori [Wed, 5 Jun 2019 14:23:10 +0000 (14:23 +0000)]
MFC r345676:

powerpc64: Use medium code model in asm files for TOC references

Summary:
With a sufficiently large TOC, it's possible to index out of range, as
the immediate load instructions only permit 16-bit indices, allowing up
to 64kB range (signed) from the base pointer.  Allow +/- 2GB range, with
the medium code model TOC accesses in asm.

Patch originally by Brandon Bergren.  The issue appears to impact ELFv2
more than ELFv1.

Reviewed by:    luporl
Differential Revision: https://reviews.freebsd.org/D19708

5 years agoMFC r343744:
Leandro Lupori [Wed, 5 Jun 2019 14:19:54 +0000 (14:19 +0000)]
MFC r343744:

powerpc64: Add a trap stack area

Currently, the trap code switches to the the temporary stack in the dbtrap
section. It works in most cases, but in the beginning of the execution, the
temp stack is being used, as starting in the powerpc_init() code.

In this current scenario, the stack is being overwritten, which causes the
return of breakpoint() to take abnormal execution.

This current patchset create a small stack to use by the dbtrap: codepath
avoiding the corruption of the temporary stack.

PR:             224872
Submitted by:   breno.leitao_gmail.com
Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D14484

5 years agoMFC r348028:
Leandro Lupori [Wed, 5 Jun 2019 12:53:36 +0000 (12:53 +0000)]
MFC r348028:

stand/powerpc: Only build loader.kboot for powerpc64

kboot is only made for powerpc64 systems, not 32-bit systems.

This unbreaks the build for powerpcspe.

Reported by:    ngie

5 years agoMFC r348112:
Leandro Lupori [Wed, 5 Jun 2019 12:43:45 +0000 (12:43 +0000)]
MFC r348112:
Fix PPC64 kernel build with clang8 + lld8

This patch fixes the following lld link errors:

- unsupported dynamic relocations on read-only sections
- out-of-range TOC references

Submitted by: git_bdragon.rtk0.net
Reviewed by: jhibbits, luporl
Differential Revision: https://reviews.freebsd.org/D19352

5 years agoMFC r348025:
Leandro Lupori [Wed, 5 Jun 2019 12:38:58 +0000 (12:38 +0000)]
MFC r348025:
Unbreak the build when `ELF_VERBOSE` is defined after r348005

This change properly terminates the formatting string quote modification done
in r348005, which is triggered when `ELF_VERBOSE` is defined.

Reported by:  ci (amd64, gcc)

5 years agoMFC r348005:
Leandro Lupori [Wed, 5 Jun 2019 12:34:28 +0000 (12:34 +0000)]
MFC r348005:
[PowerPC64] stand: fix build using clang 8 as compiler

This change fixes "stand" build issues when using clang 8
as compiler.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20026

5 years agoMFC r348117: Allocate buffers smaller then ABD chunk size as linear.
Alexander Motin [Wed, 5 Jun 2019 00:51:51 +0000 (00:51 +0000)]
MFC r348117: Allocate buffers smaller then ABD chunk size as linear.

This allows to reduce memory waste by letting UMA to put multiple small
buffers into one memory page slab.  The page sharing means that UMA
may not be able to free memory page when some of buffers are freed, but
alternatively memory used by that buffer would just be wasted from the
beginning.

This change follows alike change in ZoL, but unlike Linux (according to
my understanding of it from comments) FreeBSD never shares slabs bigger
then one memory page, so this should be even less invasive then there.

5 years agoMFC r346570, r348440
Navdeep Parhar [Tue, 4 Jun 2019 21:06:34 +0000 (21:06 +0000)]
MFC r346570, r348440

r346570:
cxgbe/t4_tom: Add a "TCB history" feature that samples hardware state
for a tid and maintains a running history of some interesting events.

Service TCP_INFO queries from the history when the tid is being tracked
there.

r348440:
cxgbe/t4_tom: Do not attempt to look up entries in the TCB history if
it hasn't been initialized.

This fixes a bug in r346570 that could cause a panic when servicing
TCP_INFO for offloaded connections.

Sponsored by: Chelsio Communications

5 years agoMFC r348491:
Navdeep Parhar [Tue, 4 Jun 2019 20:37:00 +0000 (20:37 +0000)]
MFC r348491:

cxgbe/t4_tom: adjust the hardware receive window to match changes to the
receive sockbuf's high water mark.

Calculate rx credits on the spot instead of tracking sbused/sb_cc and
rx_credits in the toepcb.  The previous method worked when the high
water mark changed due to SB_AUTOSIZE but not when it was adjusted
directly (for example, by the soreserve in nfsrvd_addsock).

This fixes a connection hang while running iozone over an NFS mounted
share where nfsd's TCP sockets are being handled by t4_tom.

Sponsored by: Chelsio Communications

5 years agoMFC r348059: vt efifb: add suspend/resume calls
Ed Maste [Tue, 4 Jun 2019 18:11:12 +0000 (18:11 +0000)]
MFC r348059: vt efifb: add suspend/resume calls

Using the latest NVIDIA driver, upon resuming from suspend with X
running the display remained blank.  Additionally OpenGL applications
that were running triggered a number of error messages from the NVIDIA
driver.

This occurred because the vt efifb back-end did not signal the X server
to release the display before suspending (or to re-acquire it after
resuming).  The NVIDIA driver includes code for smoothly shutting down
and re-initializing the GPU, which was not getting called.

Since the NVIDIA driver doesn't currently support framebuffer devices
and vt is forced to fall back to the efifb back-end, add vd_suspend and
vd_resume members to connect the suspend/resume path.  This ensures the
X server is properly able to re-initialize the display.

PR: 237050
Submitted by: Erik Kurzinger <ekurzinger@nvidia.com>

5 years agoMFC r348364:
Ruslan Bukin [Tue, 4 Jun 2019 17:42:47 +0000 (17:42 +0000)]
MFC r348364:

Don't copy the data from bounce buffer back to the mbuf if channel does
not use bounce buffering.

Sponsored by: DARPA, AFRL

5 years agoMFC r347514:
Ruslan Bukin [Tue, 4 Jun 2019 17:39:46 +0000 (17:39 +0000)]
MFC r347514:

Add support for HiFive Unleashed -- the board with a multi-core RISC-V SoC
from SiFive, Inc.

The first core on this SoC (hart 0) is a 64-bit microcontroller.

o Pick a hart to run boot process using hart lottery.
  This allows to exclude hart 0 from running the boot process.
  (BBL releases hart 0 after the main harts, so it never wins the lottery).
o Renumber CPUs early on boot.
  Exclude non-MMU cores. Store the original hart ID in struct pcpu. This
  allows to find out the correct destination for IPIs and remote sfence
  calls.

Thanks to SiFive, Inc for the board provided.

Sponsored by: DARPA, AFRL

5 years agoMFC r340028 (by jhb):
Mark Johnston [Tue, 4 Jun 2019 17:37:50 +0000 (17:37 +0000)]
MFC r340028 (by jhb):
SBI calls expect a pointer to a u_long rather than a pointer.

5 years agoMFC r340027 (by jhb):
Mark Johnston [Tue, 4 Jun 2019 17:37:20 +0000 (17:37 +0000)]
MFC r340027 (by jhb):
Don't allow debuggers to modify SSTATUS, only to read it.

5 years agoMFC r344108:
Mark Johnston [Tue, 4 Jun 2019 17:31:59 +0000 (17:31 +0000)]
MFC r344108:
Implement per-CPU pmap activation tracking for RISC-V.

5 years agoMFC r344107:
Mark Johnston [Tue, 4 Jun 2019 17:31:29 +0000 (17:31 +0000)]
MFC r344107:
Implement pmap_clear_modify() for RISC-V.

5 years agoMFC r344106:
Mark Johnston [Tue, 4 Jun 2019 17:31:05 +0000 (17:31 +0000)]
MFC r344106:
Implement transparent 2MB superpage promotion for RISC-V.

5 years agoMFC r342733:
Mark Johnston [Tue, 4 Jun 2019 17:30:22 +0000 (17:30 +0000)]
MFC r342733:
Set PTE_U on PTEs created by pmap_enter_quick().

5 years agoMFC r340159 (by jhb):
Mark Johnston [Tue, 4 Jun 2019 17:29:47 +0000 (17:29 +0000)]
MFC r340159 (by jhb):
Rework setting PTE_D for kernel mappings.

5 years agoMFC r340030 (by jhb):
Mark Johnston [Tue, 4 Jun 2019 17:29:20 +0000 (17:29 +0000)]
MFC r340030 (by jhb):
Restrict setting PTE execute permissions on RISC-V.

5 years agoMFC r340029 (by jhb):
Mark Johnston [Tue, 4 Jun 2019 17:28:49 +0000 (17:28 +0000)]
MFC r340029 (by jhb):
Set PTE_A and PTE_D for user mappings in pmap_enter().

5 years agoMFC r342765:
Mark Johnston [Tue, 4 Jun 2019 17:25:45 +0000 (17:25 +0000)]
MFC r342765:
Fix dirty bit handling in pmap_remove_write().

5 years agoMFC r342764:
Mark Johnston [Tue, 4 Jun 2019 17:25:22 +0000 (17:25 +0000)]
MFC r342764:
Clear PGA_WRITEABLE in pmap_remove_pages().

5 years agoMFC r342736:
Mark Johnston [Tue, 4 Jun 2019 17:24:52 +0000 (17:24 +0000)]
MFC r342736:
Fix a use-after-free in the riscv pmap_release() implementation.

5 years agoMFC r342735:
Mark Johnston [Tue, 4 Jun 2019 17:24:26 +0000 (17:24 +0000)]
MFC r342735:
Synchronize access to the allpmaps list.

5 years agoMFC r342734:
Mark Johnston [Tue, 4 Jun 2019 17:23:58 +0000 (17:23 +0000)]
MFC r342734:
Fix some issues with the riscv pmap_protect() implementation.

5 years agoMFC r343529:
Mark Johnston [Tue, 4 Jun 2019 17:23:24 +0000 (17:23 +0000)]
MFC r343529:
Remove a redundant test.

5 years agoMFC r342732:
Mark Johnston [Tue, 4 Jun 2019 17:20:34 +0000 (17:20 +0000)]
MFC r342732:
Use regular stores to update PTEs in the riscv pmap layer.

5 years agoMFC r342766:
Mark Johnston [Tue, 4 Jun 2019 17:19:16 +0000 (17:19 +0000)]
MFC r342766:
Don't enable interrupts in init_secondary().

5 years agoMFC r347427:
Ruslan Bukin [Tue, 4 Jun 2019 15:42:30 +0000 (15:42 +0000)]
MFC r347427:

RISC-V ISA does not specify how to manage physical memory attributes (PMA).
So do nothing in pmap_page_set_memattr() and don't panic.

Sponsored by: DARPA, AFRL

5 years agoMFC r347351:
Ruslan Bukin [Tue, 4 Jun 2019 15:40:30 +0000 (15:40 +0000)]
MFC r347351:

Connect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build.

Sponsored by: DARPA, AFRL

5 years agoMFC r347344:
Ruslan Bukin [Tue, 4 Jun 2019 15:39:28 +0000 (15:39 +0000)]
MFC r347344:

Add driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller
found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoMFC r347342:
Ruslan Bukin [Tue, 4 Jun 2019 15:37:36 +0000 (15:37 +0000)]
MFC r347342:

Add driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found
in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoMFC r347337:
Ruslan Bukin [Tue, 4 Jun 2019 15:35:46 +0000 (15:35 +0000)]
MFC r347337:

o Implement a bounce buffer based on device reserved memory.
  Grab device reserved physical memory regions from FDT using standard
  "memory-region" property and use vmem(9) to allocate buffers from it.
  The same vmem could be used by DMA engine drivers to allocate memory for
  DMA descriptors.
  This is required for platforms that provide uncached memory region
  reserved exclusively for DMA operations.
o Change sleepable sx(9) lock type to non-sleepable mutex(9) since
  network drivers usually hold mutex during DMA operations. So we don't
  take sleepable lock after non-sleepable.

Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoMFC r347226:
Ruslan Bukin [Tue, 4 Jun 2019 15:33:52 +0000 (15:33 +0000)]
MFC r347226:

Disable interrupts first and then set spinlock_count to 1.
Otherwise interrupt can be generated just after setting spinlock_count
and before disabling interrupts.

Sponsored by: DARPA, AFRL

5 years agoMFC r347225:
Ruslan Bukin [Tue, 4 Jun 2019 15:32:56 +0000 (15:32 +0000)]
MFC r347225:

Provide a template for busdma code for RISC-V.

RISC-V ISA specifies no cache management instructions so leave cache
operations in cpufunc.h as no-op for now.

Note some new hardware comes with their own memory-mapped cache
management controller.

Tested on HiFive Unleashed board with cgem(4).

Sponsored by: DARPA, AFRL

5 years agoMFC r346994:
Ruslan Bukin [Tue, 4 Jun 2019 15:30:46 +0000 (15:30 +0000)]
MFC r346994:

Deactivate IRQ resource by calling to intr_deactivate_irq().
This is the part of INTRNG support that was missed.

Sponsored by: DARPA, AFRL

5 years agoMFC r346896:
Ruslan Bukin [Tue, 4 Jun 2019 15:28:32 +0000 (15:28 +0000)]
MFC r346896:

o Rewrite softdma_process_tx() of Altera SoftDMA engine driver
  so it does not require a bounce buffer. The only need for this was
  to align the buffer address. Implement unaligned access and we don't
  need to copy data twice.
o Remove contigmalloc-based bounce buffer from xDMA code since it is
  not suitable for arbitrary memory provided by platform, which is
  sometimes a dedicated piece of memory that is not managed by OS at all.

Sponsored by: DARPA, AFRL

5 years agoMFC r346634:
Ruslan Bukin [Tue, 4 Jun 2019 15:26:02 +0000 (15:26 +0000)]
MFC r346634:

Add support for Cadence network controller found in HiFive Unleashed board.

Sponsored by: DARPA, AFRL

5 years agoMFC r346633:
Ruslan Bukin [Tue, 4 Jun 2019 15:25:03 +0000 (15:25 +0000)]
MFC r346633:

Implement pic_pre_ithread(), pic_post_ithread().

Sponsored by: DARPA, AFRL

5 years agoMFC r345796:
Ruslan Bukin [Tue, 4 Jun 2019 15:18:41 +0000 (15:18 +0000)]
MFC r345796:

o Grab the number of devices supported by PLIC from FDT.
o Fix bug in PLIC_ENABLE macro when irq >= 32.

Tested on the real hardware, which is HiFive Unleashed board.

Thanks to SiFive, Inc. for the board provided.

Sponsored by: DARPA, AFRL

5 years agoMFC r345581:
Ruslan Bukin [Tue, 4 Jun 2019 15:15:37 +0000 (15:15 +0000)]
MFC r345581:

Grab timer frequency from FDT.

RISC-V timer has no dedicated DTS node and we have to get timer
frequency from cpus node.

Tested on Government Furnished Equipment (GFE) cores synthesized
on Xilinx VCU118.

Sponsored by: DARPA, AFRL

5 years agoMFC r344252:
Ruslan Bukin [Tue, 4 Jun 2019 15:13:48 +0000 (15:13 +0000)]
MFC r344252:

Avoid orphan sections between __bss_start and .(s)bss.

Ensure __bss_start is associated with the next section
in case orphan sections are placed directly after .sdata,
as has been seen to happen with LLD.

Sponsored by: DARPA, AFRL

5 years agoMFC 339774:
Ruslan Bukin [Tue, 4 Jun 2019 15:11:14 +0000 (15:11 +0000)]
MFC 339774:

o Add pmap lock around pmap_fault_fixup() to ensure other thread will not
  modify l3 pte after we loaded old value and before we stored new value.
o Preset A(accessed), D(dirty) bits for kernel mappings.

Sponsored by: DARPA, AFRL

5 years agoMFC r347999:
Martin Matuska [Tue, 4 Jun 2019 10:28:50 +0000 (10:28 +0000)]
MFC r347999:

Install missing data file for
lib.libarchive.functional_test.test_read_format_zip_utf8_paths

5 years agoMFC r347990:
Martin Matuska [Tue, 4 Jun 2019 10:20:56 +0000 (10:20 +0000)]
MFC r347990:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #795: XAR - do not try to add xattrs without an allocated name
  PR #812: non-recursive option for extract and list
  PR #958: support reading metadata from compressed files
  PR #999: add --exclude-vcs option to bsdtar
  Issue #1062: treat empty archives with a GNU volume header as valid
  PR #1074: Handle ZIP files with trailing 0s in the extra fields
            (Android APK archives)
  PR #1109: Ignore padding in Zip extra field data (Android APK archives)
  PR #1167: fix problems related to unreadable directories
  Issue #1168: fix handling of strtol() and strtoul()
  PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter
  PR #1174: ZIP reader - fix of MSZIP signature parsing
  PR #1175: gzip filter - fix reading files larger than 4GB from memory
  PR #1177: gzip filter - fix memory leak with repeated header reads
  PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field
  PR #1181: RAR5 - fix merge_block() recursion
            (OSS-Fuzz 12999, 13029, 13144, 13478, 13490)
  PR #1183: fix memory leak when decompressing ZIP files with LZMA
  PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817
    OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables
    OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations
    OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables
  PR #1186: RAR5 - fix invalid type used for dictionary size mask
            (OSS-Fuzz 14537)
  PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555)
  PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories
            (OSS-Fuzz 14574)
  PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds
  OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry
  OSS-Fuzz 14331: RAR5 - fix maximum owner name length
  OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check

  Additional RAR5 reader changes:
    - support symlinks, hardlinks, file owner, file group, versioned files
    - change ARCHIVE_FORMAT_RAR_V5 to 0x100000
    - set correct mode for readonly directories
    - support readonly, hidden and system Windows file attributes

5 years agoMFC r348320:
Cy Schubert [Tue, 4 Jun 2019 03:04:30 +0000 (03:04 +0000)]
MFC r348320:

Contuation of r343701, removal of irrelevant #ifdefs.

5 years agoMFC r348338:
Johannes Lundberg [Tue, 4 Jun 2019 01:00:30 +0000 (01:00 +0000)]
MFC r348338:
pseudofs: Ignore unsupported commands in vop_setattr.

Users of pseudofs (e.g. lindebugfs), should be able to receive
input from command line via commands like "echo 1 > /path/to/file".
Currently this fails because sh tries to truncate the file first and
vop_setattr returns not supported error for this. This patch simply
ignores the error and returns 0 instead.

Reviewed by: imp (mentor), asomers
Approved by: imp (mentor), asomers
Differential Revision: D20451

5 years agoMFC 348206,348231,348454: GELI crypto deprecation warnings.
John Baldwin [Mon, 3 Jun 2019 21:03:28 +0000 (21:03 +0000)]
MFC 348206,348231,348454: GELI crypto deprecation warnings.

348206:
Add deprecation warnings for weaker algorithms to geli(4).

- Triple DES has been formally deprecated in Kerberos (RFC 8429)
  and is soon to be deprecated in IPsec (RFC 8221).
- Blowfish is deprecated.  FreeBSD doesn't support its successor
  (Twofish).
- MD5 is generally considered a weak digest that has known attacks.

geli refuses to create new volumes using these algorithms via 'geli
init'.  It also warns when attaching to existing volumes or creating
temporary volumes via 'geli onetime' .  The plan is to fully remove
support for these algorithms in FreeBSD 13.

Note that none of these algorithms have ever been the default
algorithm used by geli(8).  Users would have had to explicitly select
these algorithms when creating volumes in the past.

348231:
Correct the argument passed to g_eli_algo2str()

348454:
Remove tests for the deprecated algorithms in r348206

The tests are failing because the return value and output have changed, but
before test code structure adjusted, removing these test cases help people
be able to focus on more important cases.

Relnotes: yes

5 years agoMFC r348003, r348011:
Mark Johnston [Mon, 3 Jun 2019 16:59:56 +0000 (16:59 +0000)]
MFC r348003, r348011:
Add a man page for DEFINE_IFUNC.

5 years agoMFC r348509: jail_getid(3): add special-case immediate return for jid 0
Kyle Evans [Mon, 3 Jun 2019 15:28:37 +0000 (15:28 +0000)]
MFC r348509: jail_getid(3): add special-case immediate return for jid 0

As depicted in the comment: jid 0 always exists, but the lookup will fail as
it does not appear in the kernel's alljails list being a special jail. Some
callers will expect/rely on this, and we have no reason to lie because it
does always exist.

Approved by: re (early MFC)

5 years agoMFC r348306:
Konstantin Belousov [Mon, 3 Jun 2019 15:10:37 +0000 (15:10 +0000)]
MFC r348306:
Correct some inconsistencies in the earliest created kernel page
tables which affect demotion.

5 years agoMFC r348312:
Cy Schubert [Mon, 3 Jun 2019 04:38:07 +0000 (04:38 +0000)]
MFC r348312:

style(9)

5 years agoMFC r348311:
Cy Schubert [Mon, 3 Jun 2019 04:36:57 +0000 (04:36 +0000)]
MFC r348311:

Fix indentation and while at it simplfy the code.

Reported by: lwhsu@

5 years agoMFC r348310:
Cy Schubert [Mon, 3 Jun 2019 04:35:28 +0000 (04:35 +0000)]
MFC r348310:

Remove compile-time tests for unsupported versions of FreeBSD.