]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMerge upstream patch to unbreak tunnel forwarding.
Dag-Erling Smørgrav [Wed, 16 May 2018 14:04:39 +0000 (14:04 +0000)]
Merge upstream patch to unbreak tunnel forwarding.

Reported by: cy@

6 years agoImport upstream commit cfb1d9b, which fixes tunnel forwarding.
Dag-Erling Smørgrav [Wed, 16 May 2018 13:59:58 +0000 (13:59 +0000)]
Import upstream commit cfb1d9b, which fixes tunnel forwarding.

6 years agoAdd note about LD=ld.lld being a temporary requirement when building
Warner Losh [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
Dag-Erling Smørgrav [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
Ed Maste [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
Jean-Sébastien Pédron [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
Jean-Sébastien Pédron [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
Andriy Gapon [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
Ed Maste [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
Ed Maste [Wed, 16 May 2018 03:08:06 +0000 (03:08 +0000)]
Add intel-ucode-split to tools README

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

6 years agoSort mlx5tool correctly in usr.sbin/Makefile
Ed Maste [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
Ed Maste [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
Ed Maste [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
Ed Maste [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
Ed Maste [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
Ed Maste [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
Ed Maste [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
Andrew 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.
Bryan Drewery [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.
Navdeep Parhar [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
Warner Losh [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.
Navdeep Parhar [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
Ed Maste [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
Warner Losh [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 Strobl [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 Strobl [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.
Rick Macklem [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 Davis [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 Davis [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 Davis [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 Davis [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 Brodin [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
Andriy Gapon [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
Stephen Hurd [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 Turner [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 Davis [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.
Hans Petter Selasky [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.
Edward Tomasz Napierala [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):
Sean Bruno [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>'
Andriy Gapon [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
Hans Petter Selasky [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
Marcelo 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
Navdeep Parhar [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.
Navdeep Parhar [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
Ed Maste [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 Strobl [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 Strobl [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
Stephen Hurd [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.
John Baldwin [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.
Michael 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.
Michael 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
Matt Macy [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 Shafer [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
Nathan Whitehorn [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
Matt Macy [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
Matt Macy [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
Matt Macy [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()
Matt Macy [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
Nathan Whitehorn [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.
Rick Macklem [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
Matt Macy [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
Matt Macy [Sun, 13 May 2018 23:16:04 +0000 (23:16 +0000)]
Add epoch(9) man page

Reviewed by: gallatin@
Approved by: sbruno@

6 years agoRegen after r333588
Sevan Janiyan [Sun, 13 May 2018 23:04:35 +0000 (23:04 +0000)]
Regen after r333588

6 years agoTypo
Sevan Janiyan [Sun, 13 May 2018 22:58:40 +0000 (22:58 +0000)]
Typo

Submitted by: jrm@
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D14836

6 years agoFix PMC_IN_TRAP_HANDLER() for i386 after the 4/4 split.
Konstantin Belousov [Sun, 13 May 2018 20:10:02 +0000 (20:10 +0000)]
Fix PMC_IN_TRAP_HANDLER() for i386 after the 4/4 split.

Sponsored by: The FreeBSD Foundation

6 years agoFix directory blocks checksumming.
Fedor Uporov [Sun, 13 May 2018 19:48:30 +0000 (19:48 +0000)]
Fix directory blocks checksumming.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoFix on-disk inode checksum calculation logic.
Fedor Uporov [Sun, 13 May 2018 19:29:35 +0000 (19:29 +0000)]
Fix on-disk inode checksum calculation logic.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoFix EXT2FS_DEBUG definition usage.
Fedor Uporov [Sun, 13 May 2018 19:19:10 +0000 (19:19 +0000)]
Fix EXT2FS_DEBUG definition usage.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoGet rid of vm_pageout_page_queued().
Mark Johnston [Sun, 13 May 2018 13:00:59 +0000 (13:00 +0000)]
Get rid of vm_pageout_page_queued().

vm_page_queue(), added in r333256, generalizes vm_pageout_page_queued(),
so use it instead.  No functional change intended.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D15402

6 years agoFix a slow leak of session structures in the NFSv4.1 server.
Rick Macklem [Sun, 13 May 2018 12:42:53 +0000 (12:42 +0000)]
Fix a slow leak of session structures in the NFSv4.1 server.

For a fairly rare case of a client doing an ExchangeID after a hard reboot,
the old confirmed clientid still exists, but some clients use a new
co_verifier. For this case, the server was not freeing up the sessions on
the old confirmed clientid.
This patch fixes this case. It also adds two LIST_INIT() macros, which are
actually no-ops, since the structure is malloc()d with M_ZERO so the pointer
is already set to NULL.
It should have minimal impact, since the only way I could exercise this
code path was by doing a hard power cycle (pulling the plus) on a machine
running Linux with a NFSv4.1 mount on the server.
Originally spotted during testing of the ESXi 6.5 client.

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

6 years agoThe NFSv4.1 server should return NFSERR_BACKCHANBUSY instead of NFS_OK.
Rick Macklem [Sun, 13 May 2018 12:29:09 +0000 (12:29 +0000)]
The NFSv4.1 server should return NFSERR_BACKCHANBUSY instead of NFS_OK.

When an NFSv4.1 session is busy due to a callback being in progress,
nfsrv_freesession() should return NFSERR_BACKCHANBUSY instead of NFS_OK.
The only effect this has is that the DestroySession operation will report
the failure for this case and this probably has little or no effect on a
client. Spotted by inspection and no failures related to this have been
reported.

MFC after: 2 months

6 years agoAdd implementations for clog(3), clogf(3), and clog(3).
Konstantin Belousov [Sun, 13 May 2018 09:54:34 +0000 (09:54 +0000)]
Add implementations for clog(3), clogf(3), and clog(3).

PR: 216863
Submitted by: bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu>
MFC after: 2 weeks

6 years agoDetect and optimize reads from the hole on UFS.
Konstantin Belousov [Sun, 13 May 2018 09:47:28 +0000 (09:47 +0000)]
Detect and optimize reads from the hole on UFS.

- Create getblkx(9) variant of getblk(9) which can return error.
- Add GB_NOSPARSE flag for getblk()/getblkx() which requests that BMAP
  was performed before the buffer is created, and EJUSTRETURN returned
  in case the requested block does not exist.
- Make ffs_read() use GB_NOSPARSE to avoid instantiating buffer (and
  allocating the pages for it), copying from zero_region instead.

The end result is less page allocations and buffer recycling when a
hole is read, which is important for some benchmarks.

Requested and reviewed by: jeff
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D14917

6 years agohwpmc/epoch - don't reference domain if NUMA is not set
Matt Macy [Sat, 12 May 2018 20:00:29 +0000 (20:00 +0000)]
hwpmc/epoch - don't reference domain if NUMA is not set

It appears that domain information is set correctly independent
of whether or not NUMA is defined. However, there is no memory
backing secondary domains leading to allocation failure.

Reported by: pho@, np@
Approved by: sbruno@

6 years agoIf the sole non-option command line argument is "none", remove any
Dag-Erling Smørgrav [Sat, 12 May 2018 18:07:53 +0000 (18:07 +0000)]
If the sole non-option command line argument is "none", remove any
pre-existing forwarder configuration and set Unbound up to recurse.

PR: 222902
MFC after: 1 week

6 years agoRename all Unbound binaries and man pages from unbound* to local-unbound*.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:10:36 +0000 (17:10 +0000)]
Rename all Unbound binaries and man pages from unbound* to local-unbound*.

PR: 222902

6 years agoSupport If-Modified-Since for https as well as http.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:04:40 +0000 (17:04 +0000)]
Support If-Modified-Since for https as well as http.

PR: 224426
Submitted by: zsnafzig@edu.uwaterloo.ca
MFC after: 1 week

6 years agoPreserve if-modified-since timestamps across redirects.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:02:27 +0000 (17:02 +0000)]
Preserve if-modified-since timestamps across redirects.

PR: 224426
MFC after: 1 week

6 years agoDTrace aarch64: Avoid calling unwind_frame() in the probe context.
Mark Johnston [Sat, 12 May 2018 15:35:26 +0000 (15:35 +0000)]
DTrace aarch64: Avoid calling unwind_frame() in the probe context.

unwind_frame() may be instrumented by FBT, leading to recursion into
dtrace_probe(). Manually inline unwind_frame() as we do with stack
unwinding code for other architectures.

Submitted by: Domagoj Stolfa
Reviewed by: manu
MFC after: 1 week
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D15359

6 years agocpucontrol: improve Intel microcode revision check
Ed Maste [Sat, 12 May 2018 15:34:35 +0000 (15:34 +0000)]
cpucontrol: improve Intel microcode revision check

According to the Intel SDM (Volme 3, 9.11.7) the BIOS signature MSR
should be zeroed before executing cpuid (although in practice it does
not seem to matter).

PR: 192487
Submitted by: Dan Lukes
Reported by: Henrique de Moraes Holschuh
MFC after: 3 days

6 years agoUpgrade Unbound to 1.7.1.
Dag-Erling Smørgrav [Sat, 12 May 2018 15:20:39 +0000 (15:20 +0000)]
Upgrade Unbound to 1.7.1.

6 years agoUpgrade Unbound to 1.7.0. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 15:04:05 +0000 (15:04 +0000)]
Upgrade Unbound to 1.7.0.  More to follow.

6 years agoUpgrade Unbound to 1.6.8. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:57:42 +0000 (14:57 +0000)]
Upgrade Unbound to 1.6.8.  More to follow.

6 years agoNo reason to keep this around.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:51:53 +0000 (14:51 +0000)]
No reason to keep this around.

6 years agoUpgrade Unbound to 1.6.7. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:51:18 +0000 (14:51 +0000)]
Upgrade Unbound to 1.6.7.  More to follow.

6 years agoUpgrade Unbound to 1.6.6. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:48:38 +0000 (14:48 +0000)]
Upgrade Unbound to 1.6.6.  More to follow.

6 years agoUpgrade Unbound to 1.6.5. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:39:41 +0000 (14:39 +0000)]
Upgrade Unbound to 1.6.5.  More to follow.

6 years agoUpgrade Unbound to 1.6.4. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:36:58 +0000 (14:36 +0000)]
Upgrade Unbound to 1.6.4.  More to follow.

6 years agoUpgrade Unbound to 1.6.3. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:19:14 +0000 (14:19 +0000)]
Upgrade Unbound to 1.6.3.  More to follow.

6 years agoUpgrade Unbound to 1.6.2. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:15:39 +0000 (14:15 +0000)]
Upgrade Unbound to 1.6.2.  More to follow.

6 years agoUpgrade Unbound to 1.6.1. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:04:48 +0000 (14:04 +0000)]
Upgrade Unbound to 1.6.1.  More to follow.

6 years agoUpgrade Unbound to 1.6.1. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:04:30 +0000 (14:04 +0000)]
Upgrade Unbound to 1.6.1.  More to follow.

6 years agoaw_mmc: Rework regulator handling
Emmanuel Vadot [Sat, 12 May 2018 13:14:01 +0000 (13:14 +0000)]
aw_mmc: Rework regulator handling

Don't enable regulator on attach but dealt with them on power_up/power_off
Only set the voltage for the signaling regulator since I don't have boards
that can change the supply voltage.
Enable 1.8v signaling voltage.

6 years agoaw_mmc: Do not fully init the controller in attach
Emmanuel Vadot [Sat, 12 May 2018 13:13:34 +0000 (13:13 +0000)]
aw_mmc: Do not fully init the controller in attach

Only do a reset of the controller at attach and init it at power_up.
We use to enable some interrupts in reset, only enable the interrupts
we are interested in when doing a request.
While here remove the regulators handling in power_on as it is very wrong
and will be dealt with in another commit.

Tested on: A31, A64

6 years agoaw_mmc: Remove hardware reset
Emmanuel Vadot [Sat, 12 May 2018 13:12:59 +0000 (13:12 +0000)]
aw_mmc: Remove hardware reset

From all the BSP (Board Source Package) source that I've looked at it seems
that it's never done, remove it.

Tested On: A31, A64

6 years agoaw_mmc: Read interrupt register value before writing to it
Emmanuel Vadot [Sat, 12 May 2018 13:12:26 +0000 (13:12 +0000)]
aw_mmc: Read interrupt register value before writing to it

Reported by: jmcneill

6 years agoUpgrade Unbound to 1.6.0. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 12:57:34 +0000 (12:57 +0000)]
Upgrade Unbound to 1.6.0.  More to follow.

6 years agoUpgrade LDNS to 1.7.0.
Dag-Erling Smørgrav [Sat, 12 May 2018 12:00:18 +0000 (12:00 +0000)]
Upgrade LDNS to 1.7.0.

I've been holding back on this because 1.7.0 requires OpenSSL 1.1.0 or
newer for full DANE support.  But we can't wait forever, and nothing in
base uses DANE anyway, so here we go.

6 years agoVendor import of Unbound 1.7.1.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:56:52 +0000 (11:56 +0000)]
Vendor import of Unbound 1.7.1.