]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDocument r324175, ng_iface(4) system crash fix.
gjb [Tue, 5 Jun 2018 21:41:14 +0000 (21:41 +0000)]
Document r324175, ng_iface(4) system crash fix.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r323447, support for multiple realtime clocks.
gjb [Tue, 5 Jun 2018 21:41:13 +0000 (21:41 +0000)]
Document r323447, support for multiple realtime clocks.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r322340, fdescfs(5) updates for Linux-specific /dev/fd
gjb [Tue, 5 Jun 2018 21:41:12 +0000 (21:41 +0000)]
Document r322340, fdescfs(5) updates for Linux-specific /dev/fd
and /proc/self/fd behavior.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r321519, boot code and loader check for unsupported ZFS
gjb [Tue, 5 Jun 2018 21:41:11 +0000 (21:41 +0000)]
Document r321519, boot code and loader check for unsupported ZFS
feature flags.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r321007, msul support in Linuxulator.
gjb [Tue, 5 Jun 2018 21:41:10 +0000 (21:41 +0000)]
Document r321007, msul support in Linuxulator.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r330733, zfsd(8) updated to work with any GEOM provider.
gjb [Tue, 5 Jun 2018 21:41:09 +0000 (21:41 +0000)]
Document r330733, zfsd(8) updated to work with any GEOM provider.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoFix missing "_max" in the r326322 entry.
gjb [Tue, 5 Jun 2018 21:41:08 +0000 (21:41 +0000)]
Fix missing "_max" in the r326322 entry.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r326322, p1003_1b.aio_listio_max is now a tunable.
gjb [Tue, 5 Jun 2018 21:41:06 +0000 (21:41 +0000)]
Document r326322, p1003_1b.aio_listio_max is now a tunable.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMerge r334562 from stable/11 to releng/11.2. r334562 MFC'd the
np [Mon, 4 Jun 2018 20:34:53 +0000 (20:34 +0000)]
Merge r334562 from stable/11 to releng/11.2.  r334562 MFC'd the
following revisions to stable/11: r333650, r333652, r333682, r334406,
r334409-r334410, and r334489.

r333650:
cxgbe(4): Claim some more T5 and T6 boards.

r333652:
cxgbe(4): Add support for two more flash parts.

r333682:
cxgbe(4): Fall back to a failsafe configuration built into the firmware
if an error is reported while pre-processing the configuration file that
the driver attempted to use.

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

r334406:
cxgbe(4): Consider all supported speeds when building the ifmedia list
for a port.  Fix other related issues while here:
- Require port lock for access to link_config.
- Allow 100Mbps operation by tracking the speed in Mbps.  Yes, really.
- New port flag to indicate that the media list is immutable.  It will
  be used in future refinements.

This also fixes a bug where the driver reports incorrect media with
recent firmwares.

r334409:
cxgbe(4): Implement ifm_change callback.

r334410:
cxgbe(4): Use ifm for ifmedia just like the rest of the kernel.

No functional change.

r334489:
cxgbe(4): Include full duplex mediaopt in media that can be reported as
active.  Always report full duplex in active media.

Approved by: re@ (gjb@, kib@)
Sponsored by: Chelsio Communications

5 years agoSwitch releng/11.2 back to RC1 following r334469.
gjb [Fri, 1 Jun 2018 01:35:54 +0000 (01:35 +0000)]
Switch releng/11.2 back to RC1 following r334469.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoSwitch the dvd1 pkg(8) configuration to use the quarterly branch,
gjb [Fri, 1 Jun 2018 01:34:37 +0000 (01:34 +0000)]
Switch the dvd1 pkg(8) configuration to use the quarterly branch,
as part of the BETA->RC switch.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoRename releng/11.2 back to BETA3 temporarily, as I missed a file
gjb [Fri, 1 Jun 2018 01:33:48 +0000 (01:33 +0000)]
Rename releng/11.2 back to BETA3 temporarily, as I missed a file
that needs updating when branching, because I am an idiot.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoCopy stable/11@r334458 to releng/11.2 as part of the 11.2-RELEASE
gjb [Fri, 1 Jun 2018 00:22:49 +0000 (00:22 +0000)]
Copy stable/11@r334458 to releng/11.2 as part of the 11.2-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r334068 (phil):
gjb [Thu, 31 May 2018 23:55:59 +0000 (23:55 +0000)]
MFC r334068 (phil):
 Import libxo-0.9.0:
  - Add xo_format_is_numeric() with improved logic to decide if format
    strings are numeric, so json output quotes them
  - Convert docs to sphinx/rst
  - update tests

PR: 221676
Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

5 years agoAkin r302691 in head, synchronize the build stripping for the disc1
marius [Thu, 31 May 2018 23:48:27 +0000 (23:48 +0000)]
Akin r302691 in head, synchronize the build stripping for the disc1
image with that of the bootonly image (but similarly modulo games
and groff(1)) as the amd64 disc1 image is overflowing. This also
removes the redundant MK_LLDB.

This is a direct commit to stable/11 rather than a MFC of r302691 as
the the disc1 image stripping previously has been directly modified
in stable/11 by r303027.

Approved by: re (gjb)

5 years agoMFC: r327364, r334293
marius [Thu, 31 May 2018 22:20:31 +0000 (22:20 +0000)]
MFC: r327364, r334293

- Add AHCI/XHCI device IDs found on AMD 1950X+X399 system
- Describe Fresco Logic FL1100 USB 3.0 controllers.

Approved by: re (gjb)

5 years agoMFC r334310, r334337:
gjb [Thu, 31 May 2018 20:01:58 +0000 (20:01 +0000)]
MFC r334310, r334337:

 r334310 (imp):
  Teach ufs_module.c about bsd labels and probe 'a' partition.

  If the check for a UFS partition at offset 0 on the disk fails, check
  to see if there's a BSD disklabel at block 1 (standard) or at offset
  512 (install images assume 512 sector size). If found, probe for UFS
  on the 'a' partition.

  This fixes UEFI booting images from a BSD labeled MBR slice when the
  'a' partiton isn't at offset 0. This is a stop-gap fix since we plan
  on removing boot1.efi in FreeBSD 12. We can't easily do that for 11.2,
  however, hence the short MFC window.

 r334337 (emaste):
  switch amd64 memstick installer images to MBR

  A good number of BIOSes have trouble booting from GPT in non-UEFI
  mode.

  With this change amd64 memsticks remain dual-mode (booting from either
  UEFI or CSM); the partitioning type is just switched from GPT to MBR.

PR: 227954

Note, there are two changes specific to stable/11 where there is code
that had diverged from head and never merged back.  The two changes are
an include in stand/efi/boot1/ufs_module.c, replacing sys/disk/bsd.h
with sys/disklabel.h and replacing BSD_MAGIC with DISKMAGIC in the
same file.  The latter two are direct commits to stable/11 in order to
avoid unexpected regressions at this point of the 11.2 cycle.  Thank
you to imp@ for pointing out what changes needed to be made.

Approved by: re (marius)

Sponsored by: The FreeBSD Foundation

5 years agoMFC r333176:
tuexen [Thu, 31 May 2018 16:48:08 +0000 (16:48 +0000)]
MFC r333176:

Fix in the documentation that the default hop limit is not 30, but
the value of the sysctl variable net.inet6.ip6.hlim.
This is true since
https://svnweb.freebsd.org/base?view=revision&revision=122574

The default of 30 (which was correct up to r122574) was incorrectly
documented in
https://svnweb.freebsd.org/base?view=revision&revision=130268

Thanks to Timo Voelker for makeing me aware of the inconsistency
between to code and the documentation.

Approved by: re@ (marius)

5 years agoMFC r333382:
tuexen [Thu, 31 May 2018 16:14:45 +0000 (16:14 +0000)]
MFC r333382:

When reporting ERROR or ABORT chunks, don't use more data
that is guaranteed to be contigous.
Thanks to Felix Weinrank for finding and reporting this bug
by fuzzing the usrsctp stack.

MFC r333386:

Fix two typos reported by N. J. Mann, which were introduced in
https://svnweb.freebsd.org/changeset/base/333382 by me.

Approved by: re@ (marius)

5 years agoMFC r334176:
brooks [Thu, 31 May 2018 16:01:10 +0000 (16:01 +0000)]
MFC r334176:

Indicate the brk/sbrk are deprecated and not portable.

More firmly suggest mmap(2) instead.

Include the history of arm64 and riscv shipping without brk/sbrk.

Mention that sbrk(0) produces unreliable results.

Approved by: re (kib)
Reviewed by: emaste, Marcin Cieślak
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15535

5 years agoMFC r333186:
tuexen [Thu, 31 May 2018 16:00:03 +0000 (16:00 +0000)]
MFC r333186:

Send an ICMPv6 PacketTooBig message in case of forwading a packet which
is too big for the outgoing interface and no firewall is involed.
This problem was introduced in
https://svnweb.freebsd.org/changeset/base/324996
Thanks to Irene Ruengeler for finding the bug and testing the fix.

Approved by: re

5 years agoMFC r329276,r329451,r330294,r330414,r330415,r330418,r331109,r332394,r332398,
mjg [Thu, 31 May 2018 15:58:28 +0000 (15:58 +0000)]
MFC r329276,r329451,r330294,r330414,r330415,r330418,r331109,r332394,r332398,
    r333831:

    rwlock: diff-reduction of runlock compared to sx sunlock

==

    Undo LOCK_PROFILING pessimisation after r313454 and r313455

    With the option used to compile the kernel both sx and rw shared ops would
    always go to the slow path which added avoidable overhead even when the
    facility is disabled.

    Furthermore the increased time spent doing uncontested shared lock acquire
    would be bogusly added to total wait time, somewhat skewing the results.

    Restore old behaviour of going there only when profiling is enabled.

    This change is a no-op for kernels without LOCK_PROFILING (which is the
    default).

==

    sx: fix adaptive spinning broken in r327397

    The condition was flipped.

    In particular heavy multithreaded kernel builds on zfs started suffering
    due to nested sx locks.

    For instance make -s -j 128 buildkernel:

    before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total
    after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total

==

    locks: fix a corner case in r327399

    If there were exactly rowner_retries/asx_retries (by default: 10) transitions
    between read and write state and the waiters still did not get the lock, the
    next owner -> reader transition would result in the code correctly falling
    back to turnstile/sleepq where it would incorrectly think it was waiting
    for a writer and decide to leave turnstile/sleepq to loop back. From this
    point it would take ts/sq trips until the lock gets released.

    The bug sometimes manifested itself in stalls during -j 128 package builds.

    Refactor the code to fix the bug, while here remove some of the gratituous
    differences between rw and sx locks.

==

    sx: don't do an atomic op in upgrade if it cananot succeed

    The code already pays the cost of reading the lock to obtain the waiters
    flag. Checking whether there is more than one reader is not a problem and
    avoids dirtying the line.

    This also fixes a small corner case: if waiters were to show up between
    reading the flag and upgrading the lock, the operation would fail even
    though it should not. No correctness change here though.

==

    mtx: tidy up recursion handling in thread lock

    Normally after grabbing the lock it has to be verified we got the right one
    to begin with. However, if we are recursing, it must not change thus the
    check can be avoided. In particular this avoids a lock read for non-recursing
    case which found out the lock was changed.

    While here avoid an irq trip of this happens.

==

    locks: slightly depessimize lockstat

    The slow path is always taken when lockstat is enabled. This induces
    rdtsc (or other) calls to get the cycle count even when there was no
    contention.

    Still go to the slow path to not mess with the fast path, but avoid
    the heavy lifting unless necessary.

    This reduces sys and real time during -j 80 buildkernel:
    before: 3651.84s user 1105.59s system 5394% cpu 1:28.18 total
    after: 3685.99s user 975.74s system 5450% cpu 1:25.53 total
    disabled: 3697.96s user 411.13s system 5261% cpu 1:18.10 total

    So note this is still a significant hit.

    LOCK_PROFILING results are not affected.

==

    rw: whack avoidable re-reads in try_upgrade

==

    locks: extend speculative spin waiting for readers to drain

    Now that 10 years have passed since the original limit of 10000 was
    committed, bump it a little bit.

    Spinning waiting for writers is semi-informed in the sense that we always
    know if the owner is running and base the decision to spin on that.
    However, no such information is provided for read-locking. In particular
    this means that it is possible for a write-spinner to completely waste cpu
    time waiting for the lock to be released, while the reader holding it was
    preempted and is now waiting for the spinner to go off cpu.

    Nonetheless, in majority of cases it is an improvement to spin instead of
    instantly giving up and going to sleep.

    The current approach is pretty simple: snatch the number of current readers
    and performs that many pauses before checking again. The total number of
    pauses to execute is limited to 10k. If the lock is still not free by
    that time, go to sleep.

    Given the previously noted problem of not knowing whether spinning makes
    any sense to begin with the new limit has to remain rather conservative.
    But at the very least it should also be related to the machine. Waiting
    for writers uses parameters selected based on the number of activated
    hardware threads. The upper limit of pause instructions to be executed
    in-between re-reads of the lock is typically 16384 or 32678. It was
    selected as the limit of total spins. The lower bound is set to
    already present 10000 as to not change it for smaller machines.

    Bumping the limit reduces system time by few % during benchmarks like
    buildworld, buildkernel and others. Tested on 2 and 4 socket machines
    (Broadwell, Skylake).

    Figuring out how to make a more informed decision while not pessimizing
    the fast path is left as an exercise for the reader.

==

    fix uninitialized variable warning in reader locks

Approved by: re (marius)

5 years agoMFC SVN r334261-334262,334359: dwatch(1) touch-ups
dteske [Wed, 30 May 2018 18:27:48 +0000 (18:27 +0000)]
MFC SVN r334261-334262,334359: dwatch(1) touch-ups

r334261: Guard against error when given -t "*..."
r334262: Eliminate ANSI dimming in developer mode
r334359: Fix "-t test" for post-processing profiles

Bump FreeBSD_version directly in stable/11 for ports IGNORE (as in r334290)

Reviewed by: gjb
Approved by: re (gjb)
Sponsored by: Smule, Inc.

5 years agoMFC 333606: Make the common interrupt entry point labels local labels.
jhb [Tue, 29 May 2018 13:54:34 +0000 (13:54 +0000)]
MFC 333606: 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.

Approved by: re (kib)

5 years agoMFC r334038:
kib [Tue, 29 May 2018 13:24:42 +0000 (13:24 +0000)]
MFC r334038:
Enable IBRS when entering an interrupt handler from usermode.

Approved by: re (marius)

5 years agoMFC r334027: xen-blkback: do not use state 3
royger [Tue, 29 May 2018 07:51:24 +0000 (07:51 +0000)]
MFC r334027: xen-blkback: do not use state 3

Linux will not connect to a backend that's in state 3
(XenbusStateInitialised), it needs to be in state 2
(XenbusStateInitWait) for Linux to attempt to connect to the
backend.

Approved by: re (kib)

5 years agoMFC r333990, r333992:
kib [Mon, 28 May 2018 10:55:09 +0000 (10:55 +0000)]
MFC r333990, r333992:
Add missed barrier for pm_gen/pm_active interaction.

Approved by: re (marius)

5 years agor334229 mismerged and broke kernel options CAM_IOSCHED_DYNAMIC.
sbruno [Sun, 27 May 2018 23:52:41 +0000 (23:52 +0000)]
r334229 mismerged and broke kernel options CAM_IOSCHED_DYNAMIC.

Fix that on this holiday weekend.

Approved by: re (implicit)

5 years agoActivate Wake On Lan features for Ice Lake and Cannon Lake devices.
sbruno [Sat, 26 May 2018 20:02:39 +0000 (20:02 +0000)]
Activate Wake On Lan features for Ice Lake and Cannon Lake devices.

This is a direct commit to stable/11 as its not needed in -current.

PR: 228302
Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Approved by: re (kib)

5 years agoMFC r334111:
kib [Sat, 26 May 2018 14:31:54 +0000 (14:31 +0000)]
MFC r334111:
Note that PT_SETSTEP is auto-cleared.

Approved by: re (marius)

5 years agoMFC r323829
sbruno [Fri, 25 May 2018 23:18:06 +0000 (23:18 +0000)]
MFC r323829
  cam iosched: Add a handler for the quanta sysctl to enforce valid
               values

MFC r323831
    cam iosched: Schedule cam_iosched_ticker() quanta times per second

PR: 221956 221957
Submitted by: imp
Approved by: re (marius)

5 years agoMFC r334050, r334051:
markj [Fri, 25 May 2018 19:16:05 +0000 (19:16 +0000)]
MFC r334050, r334051:
Flush caches before initiating a microcode update on Intel CPUs.

Approved by: re (gjb, kib)

5 years agoMFC r334064:
kib [Fri, 25 May 2018 18:07:20 +0000 (18:07 +0000)]
MFC r334064:
Fix UP build.

Approved by: re (gjb)

5 years agoMFC r333392-r333393, r333427
cy [Fri, 25 May 2018 06:25:33 +0000 (06:25 +0000)]
MFC r333392-r333393, r333427

r333392:
Fix memory leak. (CID 1199373).

r333393:
Document intentional fallthrough. (CID 976535)

r333427:
Fix style error introduced in r333393.

Reported by: jhb, imp, phk

Approved by: re (delphij)

5 years agoUpdate stable/11 to BETA3 as part of the 11.2-RELEASE cycle.
gjb [Fri, 25 May 2018 00:00:00 +0000 (00:00 +0000)]
Update stable/11 to BETA3 as part of the 11.2-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC: r333955
marius [Thu, 24 May 2018 23:11:25 +0000 (23:11 +0000)]
MFC: r333955

- Unbreak booting sparc64 kernels after the metadata unification in
  r329190 (MFCed to stable/11 in r332150); sparc64 kernels are always
  64-bit but with that revision in place, the loader was treating them
  as 32-bit ones.
- In order to reduce the likelihood of this kind of breakage in the
  future, #ifdef out md_load() on sparc64 and make md_load_dual() -
  which is currently local to metadata.c anyway - static.
- Make md_getboothowto() - also local to metadata.c - static.
- Get rid of the unused DTB pointer on sparc64.

Approved by: re (kib)

5 years agoMFC: r333792
shurd [Thu, 24 May 2018 18:53:29 +0000 (18:53 +0000)]
MFC: r333792

Avoid spurious warnings when hardware LRO is enabled by not attempting
to configure invalid VNICs.

Approved by: re (gjb)
Submitted by:   bhargava.marreddy@broadcom.com
Sponsored by:   Broadcom Limited

5 years agoMFC r334004:
kib [Thu, 24 May 2018 13:17:24 +0000 (13:17 +0000)]
MFC r334004:
Add Intel Spec Store Bypass Disable control.

This also includes the i386/include/pcpu.h part of the r334018.

Security: CVE-2018-3639
Approved by: re (gjb)

5 years agoMFC r334004:
kib [Thu, 24 May 2018 12:14:14 +0000 (12:14 +0000)]
MFC r334004:
Add definition for Intel Speculative Store Bypass Disable MSR bits.

Security: CVE-2018-3639
Approved by: re (gjb)

5 years agoMFC r334003:
kib [Thu, 24 May 2018 11:59:33 +0000 (11:59 +0000)]
MFC r334003:
Preserve other bits in IA32_SPEC_CTL MSR when changing the IBRS and
STIBP states.

Approved by: re (gjb)

5 years agoMFC r333986:
ae [Thu, 24 May 2018 11:02:21 +0000 (11:02 +0000)]
MFC r333986:
  Remove check for matching the rulenum, ruleid and rule pointer from
  dyn_lookup_ipv[46]_state_locked(). These checks are remnants of not
  ready to be committed code, and they are there by accident.
  Due to the race these checks can lead to creating of duplicate states
  when concurrent threads in the same time will try to add state for two
  packets of the same flow, but in reverse directions and matched by
  different parent rules.

  Reported by: lev

MFC r334039:
  Restore the ability to keep states after parent rule deletion.

  This feature is disabled by default and was removed when dynamic states
  implementation changed to be lockless. Now it is reimplemented with small
  differences - when dyn_keep_states sysctl variable is enabled,
  dyn_match_ipv[46]_state() function doesn't match child states of deleted
  rule. And thus they are keept alive until expired. ipfw_dyn_lookup_state()
  function does check that state was not orphaned, and if so, it returns
  pointer to default_rule and its position in the rules map. The main visible
  difference is that orphaned states still have the same rule number that
  they have before parent rule deleted, because now a state has many fields
  related to rule and changing them all atomically to point to default_rule
  seems hard enough.

  Reported by: <lantw44 at gmail.com>
Approved by: re (kib)

5 years agoMFC r333892:
kib [Tue, 22 May 2018 14:36:46 +0000 (14:36 +0000)]
MFC r333892:
Fix PCID+PTI pmap operations on Xen/HVM.

Approved by: re (marius)

5 years agoMFC r333891:
kib [Tue, 22 May 2018 14:25:40 +0000 (14:25 +0000)]
MFC r333891:
Fix IBRS handling around MWAIT.

Approved by: re (marius)

5 years agoMFC r333896:
kib [Tue, 22 May 2018 14:08:54 +0000 (14:08 +0000)]
MFC r333896:
Style.

Approved by: re (marius)

5 years agoMFC r333099: Included opt_stack.h in Makefile, to fix module build outside kernel...
ram [Tue, 22 May 2018 10:23:12 +0000 (10:23 +0000)]
MFC r333099: Included opt_stack.h in Makefile, to fix module build outside kernel build environment.

PR: 227823
Reported by: eugen
Approved by: re

5 years agoMFC r333492:
ken [Mon, 21 May 2018 18:59:34 +0000 (18:59 +0000)]
MFC r333492:
  ------------------------------------------------------------------------
  r333492 | ken | 2018-05-11 08:50:26 -0600 (Fri, 11 May 2018) | 10 lines

  Clear out the entire structure, not just the size of a pointer to it.

  sys/dev/ocs/ocs_os.c:
   In ocs_thread_create(), use sizeof(*thread) (instead of
   sizeof(thread)) as the size argument to memset so that we clear
   out the entire thread structure instead of just a few bytes of it.

  Submitted by: jtl

  ------------------------------------------------------------------------

Approved by: re (marius, gjb)

5 years agoMFC r333715:
dim [Sun, 20 May 2018 16:03:21 +0000 (16:03 +0000)]
MFC r333715:

Pull in r322325 from upstream llvm trunk (by Matthias Braun):

  PeepholeOpt cleanup/refactor; NFC

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

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

Approved by: re (kib)
PR: 228261

5 years agoMFC r333623:
hselasky [Sat, 19 May 2018 19:09:41 +0000 (19:09 +0000)]
MFC r333623:
Add support for setting type of service, TOS, for outgoing RDMA connections
in the krping kernel test utility.

Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoMFC r333534:
kib [Sat, 19 May 2018 18:02:46 +0000 (18:02 +0000)]
MFC r333534:
Add a test for vm86(2).

Approved by: re (gjb)

5 years agoUpdate stable/11 to BETA2 as part of the 11.2-RELEASE cycle.
gjb [Fri, 18 May 2018 14:59:04 +0000 (14:59 +0000)]
Update stable/11 to BETA2 as part of the 11.2-RELEASE cycle.

As 11.2-BETA2 needs to be rebuilt, this commit marks the real point
in time for the rename.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r315733, r315737, r315740, r330054:
gjb [Fri, 18 May 2018 14:57:58 +0000 (14:57 +0000)]
MFC r315733, r315737, r315740, r330054:

 r315733 (imp):
  Impelemnt ttys onifexists in init.

  Implement a new init(8) option in /etc/ttys. If this option is present
  on the entry in /etc/ttys, the entry will be active if and only if it
  exists.  If the name starts with a '/', it will be considered an
  absolute path. If not, it will be a path relative to /dev.

  This allows one to turn off video console getty that aren't present
  (while running a getty on them even when they aren't the system
  console). Likewise with serial ports.

  It differs from onifconsole in only requiring the device exist rather
  than it be listed as one of the system consoles.

 r315737 (ngie):
  Unbreak world by adding sys/stat.h for stat(2)

 r315740 (imp):
  Simplify the code a little.

 r330054 (trasz):
  Improve missing tty handling in init(8).  This removes a check that did
  nothing - it was checking for ENXIO, which, with devfs, is no longer
  returned - and was badly placed anyway, and replaces it with similar
  one that works, and is done just before starting getty, instead of being
  done when rereading ttys(5).

  From the practical point of view, this makes init(8) handle disappearing
  terminals (eg /dev/ttyU*) gracefully, without unneccessary getty restarts
  and resulting error messages.

Reported by: Bart Ender, Andre Albsmeier
PR: 228315
Blocks: 11.2-BETA2
Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

5 years agoRevert r333774, which renames stable/11 from BETA1 to BETA2 in
gjb [Fri, 18 May 2018 14:57:06 +0000 (14:57 +0000)]
Revert r333774, which renames stable/11 from BETA1 to BETA2 in
order to address an issue what was discovered with the BETA2
builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r333497:
ae [Fri, 18 May 2018 10:17:13 +0000 (10:17 +0000)]
MFC r333497:
  Apply the change from r272770 to if_ipsec(4) interface.

  It is guaranteed that if_ipsec(4) interface is used only for tunnel
  mode IPsec, i.e. decrypted and decapsulated packet has its own IP header.
  Thus we can consider it as new packet and clear the protocols flags.
  This allows ICMP/ICMPv6 properly handle errors that may cause this packet.

  PR: 228108
Approved by: re (kib)

5 years agoUpdate stable/11 to BETA2 as part of the 11.2-RELEASE cycle.
gjb [Thu, 17 May 2018 23:59:56 +0000 (23:59 +0000)]
Update stable/11 to BETA2 as part of the 11.2-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC: r333600 (phil)
marius [Thu, 17 May 2018 21:49:34 +0000 (21:49 +0000)]
MFC: r333600 (phil)

Handle thread-local storage (TLS) segments correctly when
copying (objcopy) and displaying (readelf) them.

PR: 227552
Submitted by: kaiw (maintainer)
Approved by: re (gjb)

5 years agoMFC: r333614
marius [Thu, 17 May 2018 21:23:14 +0000 (21:23 +0000)]
MFC: r333614

Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9).

Approved by: re (gjb, kib)

5 years agoMFC: r333613
marius [Thu, 17 May 2018 21:22:19 +0000 (21:22 +0000)]
MFC: r333613

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.

Approved by: re (gjb, kib)

5 years agoDocument r333410, i386 memory stick installer images now use MBR.
gjb [Thu, 17 May 2018 18:59:12 +0000 (18:59 +0000)]
Document r333410, i386 memory stick installer images now use MBR.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoFurther expand on the description of r333006, noting the ISO images
gjb [Thu, 17 May 2018 18:40:06 +0000 (18:40 +0000)]
Further expand on the description of r333006, noting the ISO images
can now be used to write to a memory stick, as well as a CD.

Suggested by: benno
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r333738, vxge(4) deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:05 +0000 (18:40 +0000)]
Document r333738, vxge(4) deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r333412, lmc(4) deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:04 +0000 (18:40 +0000)]
Document r333412, lmc(4) deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r333367, nxge(4) deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:03 +0000 (18:40 +0000)]
Document r333367, nxge(4) deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r333171, ixgb(4) deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:02 +0000 (18:40 +0000)]
Document r333171, ixgb(4) deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r332519, various GEOM classes deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:01 +0000 (18:40 +0000)]
Document r332519, various GEOM classes deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r331882, cm(4) and fpa(4) deprecation in FreeBSD 12.
gjb [Thu, 17 May 2018 18:40:00 +0000 (18:40 +0000)]
Document r331882, cm(4) and fpa(4) deprecation in FreeBSD 12.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r333229:
kib [Thu, 17 May 2018 17:40:06 +0000 (17:40 +0000)]
MFC r333229:
Add helper macros to hide some boring repeatable ceremonies to define
ifuncs on x86.

Approved by: re (marius)

5 years agoMFC r333079 (imp):
gjb [Thu, 17 May 2018 17:00:49 +0000 (17:00 +0000)]
MFC r333079 (imp):
 No need to make objects here.

 This fixes polluting the src checkout when building arm64/aarch64.

Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r333737:
manu [Thu, 17 May 2018 17:00:07 +0000 (17:00 +0000)]
MFC r333737:

release: arm: Format FAT partition as FAT16

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

PR:             228285
Approved by: re (marius)

5 years agoMFC r333499
sbruno [Thu, 17 May 2018 16:32:38 +0000 (16:32 +0000)]
MFC r333499

Add deprecation notice for vxge.

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

Submitted by: kbowling
Reported by: rgrimes
Approved by: re (gjb)
Relnotes: yes

5 years agoDocument r333312, tzdata version 2018e.
gjb [Thu, 17 May 2018 15:53:46 +0000 (15:53 +0000)]
Document r333312, tzdata version 2018e.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r332929, pwd_mkdb(8) deprecation notice when legacy (-l)
gjb [Thu, 17 May 2018 15:53:45 +0000 (15:53 +0000)]
Document r332929, pwd_mkdb(8) deprecation notice when legacy (-l)
mode is used.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r332460, makefs(8) default block and fragment sizes
gjb [Thu, 17 May 2018 15:53:44 +0000 (15:53 +0000)]
Document r332460, makefs(8) default block and fragment sizes
synced with newfs(8).

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r322753, mount(8) 'autoro' option addition.
gjb [Thu, 17 May 2018 15:53:44 +0000 (15:53 +0000)]
Document r322753, mount(8) 'autoro' option addition.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r333006, amd64 hybrid ISO images.
gjb [Thu, 17 May 2018 15:53:43 +0000 (15:53 +0000)]
Document r333006, amd64 hybrid ISO images.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r332947, etdump(1) utility addition.
gjb [Thu, 17 May 2018 15:53:42 +0000 (15:53 +0000)]
Document r332947, etdump(1) utility addition.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r328138, indent(1) supports the SIMPLE_BACKUP_SUFFIX
gjb [Thu, 17 May 2018 15:53:41 +0000 (15:53 +0000)]
Document r328138, indent(1) supports the SIMPLE_BACKUP_SUFFIX
environment variable also used by patch(1).

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r322509, top(1) enhancement to filter on multiple user
gjb [Thu, 17 May 2018 15:53:40 +0000 (15:53 +0000)]
Document r322509, top(1) enhancement to filter on multiple user
names.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r327837, lint(1) is no longer built and installed by
gjb [Thu, 17 May 2018 15:53:39 +0000 (15:53 +0000)]
Document r327837, lint(1) is no longer built and installed by
default.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoBump copyright year.
gjb [Thu, 17 May 2018 15:53:37 +0000 (15:53 +0000)]
Bump copyright year.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r322555, various bsdgrep(1) pattern matching fixes.
gjb [Thu, 17 May 2018 15:53:36 +0000 (15:53 +0000)]
Document r322555, various bsdgrep(1) pattern matching fixes.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r322525, rgrep(1) hard link addition.
gjb [Thu, 17 May 2018 15:53:35 +0000 (15:53 +0000)]
Document r322525, rgrep(1) hard link addition.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r324124, getconf(1) '-a' flag addition.
gjb [Thu, 17 May 2018 15:53:34 +0000 (15:53 +0000)]
Document r324124, getconf(1) '-a' flag addition.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r328139, du(1) '--si' option.
gjb [Thu, 17 May 2018 15:53:33 +0000 (15:53 +0000)]
Document r328139, du(1) '--si' option.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r328495, dtc(1) update from upstream.
gjb [Thu, 17 May 2018 15:53:32 +0000 (15:53 +0000)]
Document r328495, dtc(1) update from upstream.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoDocument r331465, BSD-licensed diff(1) imported from OpenBSD.
gjb [Thu, 17 May 2018 15:53:31 +0000 (15:53 +0000)]
Document r331465, BSD-licensed diff(1) imported from OpenBSD.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r333228
kib [Thu, 17 May 2018 15:24:53 +0000 (15:24 +0000)]
MFC r333228
Implement support for ifuncs in the kernel linker on x86.

MFC r333411:
Avoid calls to bzero() before ireloc

Approved by: re (marius)

5 years agoMFC r333458:
ae [Thu, 17 May 2018 10:01:47 +0000 (10:01 +0000)]
MFC r333458:
  Fix the printing of rule comments.

  Change uint8_t type of opcode argument to int in the print_opcode()
  function. Use negative value to print the rest of opcodes, because
  zero value is O_NOP, and it can't be uses for this purpose.

  Reported by: lev
Approved by: re (gjb)

5 years agoMFC 332891,332892: Fixes for atomic_*cmpset() on arm.
jhb [Wed, 16 May 2018 21:04:19 +0000 (21:04 +0000)]
MFC 332891,332892: Fixes for atomic_*cmpset() on arm.

332891:
Fix some harmless type mismatches in the ARM atomic_cmpset implementations.

The return value of atomic_cmpset() and atomic_fcmpset() is an int (which
is really a bool) that has the values 0 or 1.  Some of the inlines were
using the type being operated on (e.g. uint32_t) as either the return type
of the function, or the type of a local 'ret' variable used to hold the
return value.  Fix all of these to just use plain 'int'.  Due to C promotion
rules and the fact that the value can only be 0 or 1, these should all be
harmless.

332892:
Implement 32-bit atomic_fcmpset() in userland for armv4/v5.

- Add an implementation of atomic_fcmpset_32() using RAS for armv4/v5.
  This fixes recent world breakage due to use of atomic_fcmpset() in
  userland.
- While here, be more careful to not expose wrapper macros for 64-bit
  atomic_*cmpset to userland for armv4/v5 as only 32-bit cmpset is
  implemented.

This has been reviewed, but not runtime-tested, but should fix the arm.arm
and arm.armeb worlds that have been broken for a while.

Approved by: re (kib)

5 years agoMFC r333436: only launch getty if underlying device exists
imp [Wed, 16 May 2018 13:18:37 +0000 (13:18 +0000)]
MFC r333436: only launch getty if underlying device exists

Note: pc98 isn't run under VM, so I didn't do a direct commit to it.

Approved by: re@ (gjb@)

5 years agoMFC r333404, r333405:
kib [Wed, 16 May 2018 11:06:39 +0000 (11:06 +0000)]
MFC r333404, r333405:
Remove PG_U from the recursive pte for kernel pmap' PML4 page
and from the rest of the kernel pmap ptes.

Approved by: re (marius)

5 years agoMFC r331340, r331342, r331472, r332050, r333276, r333448:
np [Tue, 15 May 2018 18:41:01 +0000 (18:41 +0000)]
MFC r331340, r331342, r331472, r332050, r333276, r333448:

r331340:
cxgbe(4): Tunnel congestion drops on a port should be cleared when the
stats for that port are cleared.

r331342:
cxgbe(4): Do not read MFG diags information from custom boards.

r331472:
cxgbe(4): Always initialize requested_speed to a valid value.

This fixes an avoidable EINVAL when the user tries to disable AN after
the port is initialized but l1cfg doesn't have a valid speed to use.

r332050:
cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave
IFF_UP and IFF_DRV_RUNNING out of sync.  ifhwioctl in the kernel pays no
attention to the return code from the driver ioctl during SIOCSIFFLAGS
so these messages are the only indication that the ioctl was called but
failed.

r333276:
cxgbe(4): Update all firmwares to 1.19.1.0.

r333448:
cxgbe(4): Disable write-combined doorbells by default.

This had been the default behavior but was changed accidentally as part
of the recent iw_cxgbe+OFED overhaul.  Fix another bug in that change
while here: the global knob affects all the adapters in the system and
should be left alone by per-adapter code.

Approved by: re@ (marius@)
Sponsored by: Chelsio Communications

5 years agoMFC r333521:
kib [Tue, 15 May 2018 12:11:52 +0000 (12:11 +0000)]
MFC r333521:
PROC_PDEATHSIG_CTL will appear first in 11.2.

Approved by: re (marius)

5 years agoMFC r333244:
ae [Tue, 15 May 2018 11:43:05 +0000 (11:43 +0000)]
MFC r333244:
  Immediately propagate EACCES error code to application from tcp_output.

  In r309610 and r315514 the behavior of handling EACCES was changed, and
  tcp_output() now returns zero when EACCES happens. The reason of this
  change was a hesitation that applications that use TCP-MD5 will be
  affected by changes in project/ipsec.

  TCP-MD5 code returns EACCES when security assocition for given connection
  is not configured. But the same error code can return pfil(9), and this
  change has affected connections blocked by pfil(9). E.g. application
  doesn't return immediately when SYN segment is blocked, instead it waits
  when several tries will be failed.

  Actually, for TCP-MD5 application it doesn't matter will it get EACCES
  after first SYN, or after several tries. Security associtions must be
  configured before initiating TCP connection.

  I left the EACCES in the switch() to show that it has special handling.

  Reported by: Andreas Longwitz <longwitz at incore dot de>
Approved by: re (marius)

5 years agoMFC r333504:
kib [Tue, 15 May 2018 11:25:10 +0000 (11:25 +0000)]
MFC r333504:
Remove dead declaration.

Approved by: re (marius)

5 years agoHandle the difference between HEAD and stable/11 tests build.
kib [Tue, 15 May 2018 10:10:14 +0000 (10:10 +0000)]
Handle the difference between HEAD and stable/11 tests build.
This is a direct commit to stable/11.

PR: 228018, 228233
Tested by: Helge Oldach <freebsd@oldach.net>
Sponsored by: The FreeBSD Foundation
Approved by: re (marius)

5 years agoMFC r333362:
hselasky [Tue, 15 May 2018 09:40:52 +0000 (09:40 +0000)]
MFC r333362:
Fix for missing network interface address event when adding the default IPv6
based link-local address.

The default link local address for IPv6 is added as part of bringing the
network interface up. Move the call to "EVENTHANDLER_INVOKE(ifaddr_event,)"
from the SIOCAIFADDR_IN6 ioctl(2) handler to in6_notify_ifa() which should
catch all the cases of adding IPv6 based addresses to a network interface.
Add a witness warning in case the event handler is not allowed to sleep.

Approved by: re (marius)
Reviewed by: network (ae), kib
Differential Revision: https://reviews.freebsd.org/D13407
Sponsored by: Mellanox Technologies

5 years agoMFC r331906:
gonzo [Tue, 15 May 2018 02:26:50 +0000 (02:26 +0000)]
MFC r331906:

Approved by: re (gjb)

Fix accidental USB port resets by GPIO on Zynq/Zedboard boards

The Zynq/Zedboard GPIO driver attempts to tri-state all GPIO pins on
boot up but the order in which I reset the hardware can cause the pins
to be briefly held low before being tri-stated.  This is a problem on
boards that use GPIO pins to reset devices.

In particular, the Zybo and ZC-706 boards use a GPIO pin as a USB PHY
reset.  If U-boot enables the USB port before booting the kernel, the
GPIO driver attach causes a glitch on the USB PHY reset and the USB
port loses power.  My fix is to have the GPIO driver leave the pins in
whatever configuration U-boot placed them.

PR: 225713
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>

5 years agoMFC SVN r329188,329334,329353,329914,329995-329996: DTrace Enhancements
dteske [Tue, 15 May 2018 00:00:44 +0000 (00:00 +0000)]
MFC SVN r329188,329334,329353,329914,329995-329996: DTrace Enhancements

r329188: Use tabs in io.d, fix alignment issues, remove extra newlines
r329334: Add errno definitions to /usr/lib/dtrace/errno.d
r329353: Add inline to errno.d for translating int to string
r329914: Updates and enhancements to io.d to aid DTrace scripting
r329995: Updates and enhancements to signal.d to aid DTrace scripting
r329996: Consistent casing for fallback SIGCHLD (s/Unknown/unknown/)

MFC SVN r330559-330560,330672,332865-332867,333513-333519: dwatch(1)

r330559: Introduce dwatch(1) as a tool for making DTrace more useful
r330560: Bump dwatch(1) internal version from 1.0-beta-91 to 1.0
r330672: Fix display of wrong pid from dtrace_sched(4)
r332865: Add `-dev' option to aid debugging of profiles
r332866: Add profile for send(2)/recv(2) syscalls
r332867: Remove the line used to demonstrate `-dev' option
r333513: Bugfix, usage displayed with `-1Q'
r333514: Separate default values so `-[BK] num' don't affect usage
r333515: Simplify info message test
r333516: Export ARGV to profiles loaded via load_profile()
r333517: Allow `-E code' to override profile EVENT_DETAILS
r333518: Expose process for ip/tcp/udp
r333519: Refactor sendrecv profile

Reviewed by: markj, gnn, bdrewery (head; earlier version)
Approved by: re (gjb)
Relnotes: yes
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D15418

5 years agoMFC r332317, r332439, r332442
gonzo [Mon, 14 May 2018 23:12:30 +0000 (23:12 +0000)]
MFC r332317, r332439, r332442

Approved by: re

r332317:
[man] Fix return type of BUS_ADD_CHILD(9)

Fix return type of BUS_ADD_CHILD(9) in SYNOPSYS section,
it should be device_t, not int

PR: 207389

r332439:
Fix quotes in the example code in syslog(3) BUGS section

mdoc treats verbatim quotes in .Dl as a string delimiter and does
not pass them to the rendered output. Use special char \*q to specify
double quote

PR: 216755

r332442:
Bump .Dd value (forgot to do this in r332439)

5 years agoMFC r303848
sbruno [Mon, 14 May 2018 22:56:41 +0000 (22:56 +0000)]
MFC r303848

Repair trivial panic in ng_uncallout.  Fixes bugzilla #211031

PR: 211031
Approved by: re (gjb)