]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 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)

6 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

6 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

6 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)

6 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.

6 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)

6 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)

6 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)

6 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)

6 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)

6 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)

6 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)

6 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)

6 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)

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

Approved by: re (gjb)

6 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)

6 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

6 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)

6 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

6 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)

6 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)

6 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)

6 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)

6 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)

6 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)

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

Approved by: re (marius)

6 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

6 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)

6 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

6 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

6 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)

6 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

6 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

6 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

6 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)

6 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

6 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)

6 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)

6 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)

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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)

6 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

6 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)

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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)

6 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)

6 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)

6 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@)

6 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)

6 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

6 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)

6 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)

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

Approved by: re (marius)

6 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)

6 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

6 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>

6 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

6 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)

6 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)

6 years agoMFC r333239:
pfg [Mon, 14 May 2018 19:20:37 +0000 (19:20 +0000)]
MFC r333239:
msdosfs: long names of files are created incorrectly.

This fixes a regression that happened in r120492 (2003) where libkiconv
was introduced and we went from checking unlen to checking for '\0'.

PR: 111843
Patch by: Damjan Jovanovic
Approved by: re (gjb)

6 years agoMFC r333473:
gjb [Mon, 14 May 2018 17:43:43 +0000 (17:43 +0000)]
MFC r333473:
 Add a special GCE_LICENSE variable to Makefile.gce, which when set,
 will include license metadata in the resultant GCE image.

 GCE_LICENSE is unset by default, as it primarily pertains to images
 produced by the FreeBSD Project, but for downstream FreeBSD consumers,
 it can be set in the make(1) environment in the format of:

   --licenses="projects/PROJECT_ID/global/licenses/LICENSE_NAME"

 The "license" is not a license, per se, but required metadata that
 is required by the GCE marketplace.  For the FreeBSD Project, the
 license name is simply 'freebsd', with the description of 'FreeBSD'.

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

6 years agoMFC r333493:
trasz [Mon, 14 May 2018 15:35:54 +0000 (15:35 +0000)]
MFC r333493:

Set kldxref_enable="YES" for ARM images. Without it, the images are missing
the /boot/kernel/linker.hints file, which breaks loading some of the modules
with dependencies, eg cfiscsi.ko.

This is a minimal fix for ARM images, in order to safely MFC it before
11.2-RELEASE.  Afterwards, however, I believe we should actually just change
the default (as in, etc/defaults/rc.conf).  The reason is that it's required
for every image that's being cross-built, as kldxref(1) cannot handle files
for non-native architectures.  For the one that is not - amd64 - having it
on by default doesn't change anything - the script is noop if the linker.hints
already exists.

The long-term solution would be to rewrite kldxref(1) to handle other
architectures, and generate linker.hints at build time.

Approved by: re (marius@)
Sponsored by: DARPA, AFRL

6 years agoMFC r333460:
kib [Sun, 13 May 2018 17:44:26 +0000 (17:44 +0000)]
MFC r333460:
Add the test program to examine CPU behaviour for pop ss issue
CVE-2018-8897.

Approved by: re (marius)

6 years agoMFC r332504:
kib [Sat, 12 May 2018 11:40:34 +0000 (11:40 +0000)]
MFC r332504:
Set PG_G global mapping bit on the trampoline ptes.

Approved by: re (marius)

6 years agoMFC r332450:
kib [Sat, 12 May 2018 11:18:14 +0000 (11:18 +0000)]
MFC r332450:
Optimize context switch for PTI on PCID pmap.

Approved by: re (marius)

6 years agor285910 attempted to make shutdown() be POSIX compliant by returning
jtl [Sat, 12 May 2018 01:55:24 +0000 (01:55 +0000)]
r285910 attempted to make shutdown() be POSIX compliant by returning
ENOTCONN when shutdown() is called on unconnected sockets.  This change was
slightly modified by r316874, which returns ENOTCONN in the case of an
unconnected datagram socket, but still runs the shutdown code for the
socket.  This specifically supports the case where the user-space code is
using the shutdown() call to wakeup another thread blocked on the socket.

In PR 227259, a user is reporting that they have code which is using
shutdown() to wakup another thread blocked on a stream listen socket.  This
code is failing, while it used to work on FreeBSD 10 and still works on
Linux.

It seems reasonable to add another exception to support something users are
actually doing, which used to work on FreeBSD 10, and still works on Linux.
And, it seems like it should be acceptable to POSIX, as we still return
ENOTCONN.

This is a direct commit to stable/11.  The listen socket code changed
substantially in head, and the code change there will be substantially
more complex.  In the meantime, it seems to make sense to commit this
trivial fix to stable/11 given the fact that users appear to depend on
this behavior, this appears to have been an unintended change in stable/11,
and we did not announce the change.

PR: 227259
Reviewed by: ed
Approved by: re (gjb)
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D15021
Tested by: Eric Masson (emss at free.fr)

6 years agoCreate a sun7i-a20-bananapi.dtb hard link to bananapi.dtb to fix
gjb [Fri, 11 May 2018 21:46:53 +0000 (21:46 +0000)]
Create a sun7i-a20-bananapi.dtb hard link to bananapi.dtb to fix
a boot failure on the Banana Pi SoC.

This is a direct commit to stable/11, as the sun7i-a20-bananapi.dtb
file exists in head, but appears to have been part of a larger
rework of dtb-related files that may have larger consequences than
hard link creation.  Note: creating a hard link to dtb files was
an original fix in 12-CURRENT beforehand, introduced in r319603.

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

6 years agoMFC r333329, r333366, r333373
shurd [Fri, 11 May 2018 20:40:26 +0000 (20:40 +0000)]
MFC r333329, r333366, r333373

r333329: Fix off-by-one error requesting tx interrupt
r333366: Cleanup queues when iflib_device_register fails
r333373: Log iflib_tx_structures_setup failure in function

Approved by: re (gjb@)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15354

6 years agoRename stable/11 from PRERELEASE to BETA1 as part of the 11.2-RELEASE
gjb [Thu, 10 May 2018 23:58:33 +0000 (23:58 +0000)]
Rename stable/11 from PRERELEASE to BETA1 as part of the 11.2-RELEASE
cycle.

Update the default pkg(8) repository to the 'quarterly' branch to
prevent further 11.2 builds from downgrading packages when invoking
'pkg upgrade' for the duration of the cycle.

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

6 years agoMFC r333003
davidcs [Wed, 9 May 2018 19:52:33 +0000 (19:52 +0000)]
MFC r333003
Upgraded FW Related Files to version 5.4.67

Approved by:re(gjb)

6 years agoMFC r333019 r333046 r333085 r333086 r333132
sbruno [Wed, 9 May 2018 16:14:12 +0000 (16:14 +0000)]
MFC r333019 r333046 r333085 r333086 r333132

smartpqi(4):
- Microsemi SCSI driver for PQI controllers.
- Found on newer model HP servers.
- Restrict to AMD64 only as per developer request.

The driver provides support for the new generation of PQI controllers
from Microsemi. This driver is the first SCSI driver to implement the
PQI queuing model and it will replace the aacraid driver for Adaptec
Series 9 controllers.  HARDWARE Controllers supported by the driver include:

    HPE Gen10 Smart Array Controller Family
    OEM Controllers based on the Microsemi Chipset.

Approved by: re (gjb@)
Relnotes: yes

6 years agoMFC r333158:
mav [Wed, 9 May 2018 15:22:40 +0000 (15:22 +0000)]
MFC r333158:
Clean enclosure_table when resetting num_enc_table_entries to zero.

Garbage left there by r325363 in some scenarios found to lead to later
enclosure mapping failures.

Approved by: re@ (gjb)
Sponsored by: iXsystems, Inc.

6 years agoMFC r332966: Add deprecation notice for lmc(4)
emaste [Wed, 9 May 2018 14:50:32 +0000 (14:50 +0000)]
MFC r332966: Add deprecation notice for lmc(4)

We intend to remove support before FreeBSD 12 is branched.  These are
available only as 32-bit PCI devices.  The driver has an ambiguous
license and I have not been successful in contacting the driver's author
in order to address this.

The planned deprecation has been announced on -current and -stable; if
we receive feedback that the driver is still useful and we are able to
resolve the license issue this deprecation notice can be reverted.

Relnotes: Yes
Approved by: re
Sponsored by: The FreeBSD Foundation

6 years agoMFC r332446: switch i386 memstick installer images to MBR
emaste [Wed, 9 May 2018 14:38:07 +0000 (14:38 +0000)]
MFC r332446: switch i386 memstick installer images to MBR

Some BIOSes have trouble booting from GPT in non-UEFI mode.  This is
commonly reported with Lenovo laptops, including my x220.  As we do not
currently support booting FreeBSD/i386 via UEFI there's no reason to
prefer GPT.

The "vestigial swap partition" was added in r265017 to work around an
issue with loader's GPT support, so we should not need it when using
MBR.

We may want to make the same change to amd64, although the issue there is
mitigated by such systems booting via UEFI in the common case.

PR: 227422
Approved by: re
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

6 years agoMFC r333182:
kib [Wed, 9 May 2018 11:47:05 +0000 (11:47 +0000)]
MFC r333182:
mlx5en: Always allow VLAN id 0.

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

6 years agoBelatedly bump copyright year.
gjb [Tue, 8 May 2018 18:03:08 +0000 (18:03 +0000)]
Belatedly bump copyright year.

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

6 years agoDocument EN-18:05, EN-18:06, SA-18:06.
gjb [Tue, 8 May 2018 17:59:25 +0000 (17:59 +0000)]
Document EN-18:05, EN-18:06, SA-18:06.

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