]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r305207: MFV r302659: 6931 lib/libzfs: cleanup gcc warnings
mav [Tue, 11 Oct 2016 16:33:43 +0000 (16:33 +0000)]
MFC r305207: MFV r302659: 6931 lib/libzfs: cleanup gcc warnings

illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be
https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be

https://www.illumos.org/issues/6931
  need cleanup:
  CERRWARN += -_gcc=-Wno-switch
  CERRWARN += -_gcc=-Wno-parentheses
  CERRWARN += -_gcc=-Wno-unused-function

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Igor Kozhukhov <ikozhukhov@gmail.com>

7 years agoMFC r305200: MFV r302651:
mav [Tue, 11 Oct 2016 16:32:49 +0000 (16:32 +0000)]
MFC r305200: MFV r302651:
7054 dmu_tx_hold_t should use refcount_t to track space

illumos/illumos-gate@0c779ad424a92a84d1e07d47cab7f8009189202b
https://github.com/illumos/illumos-gate/commit/0c779ad424a92a84d1e07d47cab7f8009
189202b

https://www.illumos.org/issues/7054
  upstream:
  ee0003de7d3e598499be7ac3fe6b61efcc47cb7f
  DLPX-40399 dmu_tx_hold_t should use refcount_t to track space

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFC r305199: MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set
mav [Tue, 11 Oct 2016 16:31:55 +0000 (16:31 +0000)]
MFC r305199: MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set

Note that the bulk of the upstream change is not applicable to FreeBSD
and the affected files are not even in the vendor area.

illumos/illumos-gate@45b1747515a17db45e8971501ee84a26bdff37b2
https://github.com/illumos/illumos-gate/commit/45b1747515a17db45e8971501ee84a26bdff37b2

https://www.illumos.org/issues/7019
  Currently zfsdev_ioctl, when confronted by a request with the FKIOCTL flag set,
  skips all processing of secpolicy functions. This means that ZFS is not doing
  any kind of verification of the credentials or access rights of the caller and
  assuming that (as it is an in-kernel client) all such checks have already been
  done.
  This turns out to be quite a dangerous assumption, especially with respect to
  sdev. In general I don't think it's particularly reasonable to offload this
  enforcement of access rights onto other kernel subsystems when ZFS has some
  particular local semantics in this area (delegated datasets etc) and does not
  provide any kind of API to allow other subsystems to avoid code duplication
  when doing it. ZFS should apply its normal access policy to requests from
  within the kernel, and callers should take care to give it the correct
  credentials and call it from the correct context in order to get the results
  they need.
  You can observe the currently unfortunate consequences of this bug in any non-
  global zone that has access to /dev/zvol or any subset of it via sdev profiles.
  In particular, a zone used to contain a KVM or similar which has a single zvol
  passed through to it using a <device match= block in its zone XML.
  Even though sdev makes something of an attempt to control for whether the
  caller should have access to nodes in /dev/zvol, it doesn't do this correctly,
  or really at all in the lookup call path. So, if we have a zone that's been
  given access to any part of /dev/zvol, it can simply look up the full path to
  any other zvol on the entire system, and the node will appear and be able to be
  used.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alex Wilson <alex.wilson@joyent.com>

7 years agoMFC r305198: MFV r302647:
mav [Tue, 11 Oct 2016 16:30:49 +0000 (16:30 +0000)]
MFC r305198: MFV r302647:
6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device

illumos/illumos-gate@63364b0ee2604783e7a55f8425888867768eafa4
https://github.com/illumos/illumos-gate/commit/63364b0ee2604783e7a55f84258888677
68eafa4

https://www.illumos.org/issues/6922
  ZFS does not do a config_sync after removing an aux (spare, log, or cache)
  device. AFAICT this isn't being done because it is slow and was deemed
  unnecessary. However, it should be such a rare operation that speed doesn't
  matter, and not doing it results in two problems:
  1) It is theoretically possible to remove an aux device from one pool and
  attach it to another, then lose power. When power is restored, both pools woul
d
  think that they own the aux device.
  2) Removal of the aux device doesn't send any useful sysevents to userland.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alan Somers <asomers@gmail.com>

7 years agoMFC r305195: MFV r302643:
mav [Tue, 11 Oct 2016 16:29:43 +0000 (16:29 +0000)]
MFC r305195: MFV r302643:
6902 speed up listing of snapshots if requesting name only and sorting by name

This was our change from the beginning, so just reduce the upstream diff.

7 years agoMFC r305193: MFV r302642:
mav [Tue, 11 Oct 2016 16:26:58 +0000 (16:26 +0000)]
MFC r305193: MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41
https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoAdd Cavium sponsor entity
emaste [Tue, 11 Oct 2016 13:22:37 +0000 (13:22 +0000)]
Add Cavium sponsor entity

7 years agoMFC 306480
sephe [Tue, 11 Oct 2016 02:08:09 +0000 (02:08 +0000)]
MFC 306480

    linuxkpi: Fix PCI BAR lazy allocation support.

    FreeBSD supports lazy allocation of PCI BAR, that is, when a device
    driver's attach method is invoked, even if the device's PCI BAR
    address wasn't initialized, the invocation of bus_alloc_resource_any()
    (the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() ->
    pci_reserve_map() -> pci_write_bar()) would allocate a proper address
    for the PCI BAR and write this 'lazy allocated' address into the PCI
    BAR.

    This model works fine for native FreeBSD device drivers, but _not_ for
    device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c
    and ofed/drivers/net/mlx4/main.c.  Both of them use
    pci_request_regions(), which doesn't work properly with the PCI BAR
    lazy allocation, because pci_resource_type() -> _pci_get_rle() always
    returns NULL, so pci_request_regions() doesn't have the opportunity to
    invoke bus_alloc_resource_any().  We now use pci_find_bar() in
    pci_resource_type(), which is able to locate all available PCI BARs
    even if some of them will be lazy allocated.

    Submitted by:   Dexuan Cui <decui microsoft com>
    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8071

7 years agoCorrect an entry from the release announcement.
gjb [Mon, 10 Oct 2016 23:35:55 +0000 (23:35 +0000)]
Correct an entry from the release announcement.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.
jilles [Mon, 10 Oct 2016 20:24:32 +0000 (20:24 +0000)]
MFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.

If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.

PR: 212048
Reported by: Casey Lucas

7 years agoMFC r306611:
sevan [Mon, 10 Oct 2016 16:41:17 +0000 (16:41 +0000)]
MFC r306611:
Amend history to mention predecessor originated from 386BSD[1] & current implementation from NetBSD[2].
Reword history since the utility was renamed once more in FreeBSD 5.0.
Separate out author & historical information regarding character code conversion.
Add AUTHORS section.

[1] https://groups.google.com/forum/#!search/mount_pcfs.c/comp.unix.bsd/9qhH0v1tZm0/inlPnXZj_2sJ
[2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/mount_msdos/mount_msdos.c?rev=1.6&content-type=text/x-cvsweb-markup

PR: 212536
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306610:
sevan [Mon, 10 Oct 2016 16:38:52 +0000 (16:38 +0000)]
MFC r306610:
Note mount_fusefs appeared in FreeBSD 10.
Move note regarding implementation to caveats.
Address issued raised by Igor.

PR:             212513
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306607:
sevan [Mon, 10 Oct 2016 16:35:25 +0000 (16:35 +0000)]
MFC r306607:
mksnap_ffs appeared in FreeBSD 5.1.

PR: 212510
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306606:
sevan [Mon, 10 Oct 2016 16:33:44 +0000 (16:33 +0000)]
MFC r306606:
mknod appeared in V4 UNIX
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man8/mknod.8

PR:             212509
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306605:
sevan [Mon, 10 Oct 2016 16:29:14 +0000 (16:29 +0000)]
MFC r306605:
init was there in UNIX from V1
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/init.s

PR: 212503
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306604:
sevan [Mon, 10 Oct 2016 16:27:32 +0000 (16:27 +0000)]
MFC r306604:
gbde first appeared in FreeBSD 5.0

PR:             212478
Approved by:    brc (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306603:
sevan [Mon, 10 Oct 2016 16:24:05 +0000 (16:24 +0000)]
MFC r306603:
Document which version of BSD first showed up in and add the version info
for NetBSD & FreeBSD.

PR: 212477
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306602:
sevan [Mon, 10 Oct 2016 16:22:34 +0000 (16:22 +0000)]
MFC r306602:
Mention the version of NetBSD the utility originated from.

PR:             212476
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306601:
sevan [Mon, 10 Oct 2016 16:16:26 +0000 (16:16 +0000)]
MFC r306601:
dumpon(8) appears to be present in FreeBSD 2.0.5,
despite initial import of man page listed FreeBSD 2.1.

PR: 212445
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306600:
sevan [Mon, 10 Oct 2016 16:14:49 +0000 (16:14 +0000)]
MFC r306600:
dump(8) first appeared in V4 UNIX
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man8

PR:             212444
Approved by:    bcr (mentor)
Obtained from:  TUHS
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306598
sevan [Mon, 10 Oct 2016 16:11:02 +0000 (16:11 +0000)]
MFC r306598
ccdconfig first appeared in NetBSD 1.1
From NetBSD man page, confirmed with repo tags in CVS [1]
(there was also no 1.0a release according to [2])

[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ccdconfig/ccdconfig.c
[2] http://netbsd.org/releases/formal.html#history

PR: 212437
Approved by: bcr (mentor)
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306582:
sevan [Mon, 10 Oct 2016 16:08:29 +0000 (16:08 +0000)]
MFC r306582:
"POSIX doesn't specify -h." - r1.27 from NetBSD
http://man.openbsd.org/?query=chmod&apropos=0&sec=0&arch=default&manpath=POSIX-2013

PR:             212337
Approved by:    bcr (mentor)
Obtained from:  NetBSD
Differential Revision:  https://reviews.freebsd.org/D8118

7 years agoFix a typo.
gjb [Mon, 10 Oct 2016 16:06:55 +0000 (16:06 +0000)]
Fix a typo.

Spotted by: lidl
Sponsored by: The FreeBSD Foundation

7 years agoMFC r306581:
sevan [Mon, 10 Oct 2016 15:53:56 +0000 (15:53 +0000)]
MFC r306581:
Use .At macro instead of specifying AT&T UNIX literaly.

PR: 212034
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8114

7 years ago- Add known-issue entries for 11.0-RELEASE errata.html.
gjb [Mon, 10 Oct 2016 15:49:49 +0000 (15:49 +0000)]
- Add known-issue entries for 11.0-RELEASE errata.html.
- Bump version numbers in release.ent.
- Bump the copyright year for the errata file.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306714:
sevan [Mon, 10 Oct 2016 15:47:39 +0000 (15:47 +0000)]
MFC r306714:
Document where chio(1) originated from & which version of FreeBSD first
included it.

PR:           211776
Approved by:  bcr (mentor)
Differential Revision:        https://reviews.freebsd.org/D8104

7 years agoMFC r306584:
sevan [Mon, 10 Oct 2016 15:42:50 +0000 (15:42 +0000)]
MFC r306584:
Move the description of CHANGER variable to ENVIRONMENT section rather than
in the DESCRIPTION section.
From OpenBSD src/bin/chio/chio.1 r1.23

PR:           212158
Approved by:  bjk
Obtained from:        OpenBSD
Differential Revision:        https://reviews.freebsd.org/D8117

7 years agoMFC: r306318
tijl [Mon, 10 Oct 2016 11:51:47 +0000 (11:51 +0000)]
MFC: r306318

Allocate a zeroed LDT.

Failing to do this might result in the LDT appearing to run out of free
descriptors because of random junk in the descriptor's 'sd_type' field.

http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html

PR: 212639
Submitted by: wheelcomplex@gmail.com

7 years agoMFC r306478:
hselasky [Mon, 10 Oct 2016 11:46:08 +0000 (11:46 +0000)]
MFC r306478:
Add new USB ID.

While at it remove some whitespaces.

Submitted by: Jose Luis Duran <jlduran@gmail.com>
PR: 213110

7 years agoMFC r306454:
hselasky [Mon, 10 Oct 2016 11:42:25 +0000 (11:42 +0000)]
MFC r306454:
Set hardware stats flag to avoid double counting the number of incoming bytes.

Found by: Ben RUBSON <ben.rubson@gmail.com>
Sponsored by: Mellanox Technologies

7 years agoMFC r306453:
hselasky [Mon, 10 Oct 2016 11:38:55 +0000 (11:38 +0000)]
MFC r306453:
Set hardware stats flag to avoid double counting the number of incoming bytes.

Found by: Ben RUBSON <ben.rubson@gmail.com>

7 years agoMFC r306451:
hselasky [Mon, 10 Oct 2016 11:30:35 +0000 (11:30 +0000)]
MFC r306451:
The IORESOURCE_XXX defines should resemble a bitmask while SYS_RES_XXX
are not bitmasks. Fix return value of pci_resource_flags() to reflect
this change.

Sponsored by: Mellanox Technologies

7 years agoMFC r306441 and r306634:
hselasky [Mon, 10 Oct 2016 11:22:11 +0000 (11:22 +0000)]
MFC r306441 and r306634:
While draining a timeout task prevent the taskqueue_enqueue_timeout()
function from restarting the timer.

Commonly taskqueue_enqueue_timeout() is called from within the task
function itself without any checks for teardown. Then it can happen
the timer stays active after the return of taskqueue_drain_timeout(),
because the timeout and task is drained separately.

This patch factors out the teardown flag into the timeout task itself,
allowing existing code to stay as-is instead of applying a teardown
flag to each and every of the timeout task consumers.

Add assert to taskqueue_drain_timeout() which prevents parallel
execution on the same timeout task.

Update manual page documenting the return value of
taskqueue_enqueue_timeout().

Differential Revision: https://reviews.freebsd.org/D8012
Reviewed by: kib, trasz

7 years agoMFC r306443:
jch [Sun, 9 Oct 2016 21:02:33 +0000 (21:02 +0000)]
MFC r306443:

Fix an issue with accept_filter introduced with r261242:

As a side effect of r261242 when using accept_filter the
first call to soisconnected() is done earlier in tcp_input()
instead of tcp_do_segment() context.  Restore the expected behaviour.

Note:  This call to soisconnected() seems to be extraneous in all
cases (with or without accept_filter).  Will be addressed in a
separate commit.

PR: 212920
Reported by: Alexey
Tested by: Alexey, jch
Sponsored by: Verisign, Inc.

7 years agoMFC r306560, r306561:
pfg [Sun, 9 Oct 2016 20:12:58 +0000 (20:12 +0000)]
MFC r306560, r306561:
patch(1): make some macros look boolean.

Minor cleanup inspired by a new patch(1) variant in schily tools.

For reference:
https://sourceforge.net/p/schillix-on/

7 years agoMFC r305813:
pfg [Sun, 9 Oct 2016 20:07:01 +0000 (20:07 +0000)]
MFC r305813:
localedef(1): make better use of calloc(3) arguments.

The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

7 years agoMFC r305812:
pfg [Sun, 9 Oct 2016 19:57:20 +0000 (19:57 +0000)]
MFC r305812:

fifolog(1): invert order of calloc(3) arguments.

The second argument to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

7 years agoMFC r306658: Clear GT_CTRL_ENABLE to stop the timer.
jmcneill [Sun, 9 Oct 2016 13:59:38 +0000 (13:59 +0000)]
MFC r306658: Clear GT_CTRL_ENABLE to stop the timer.

7 years agoMFC r306588:
kib [Sun, 9 Oct 2016 12:34:56 +0000 (12:34 +0000)]
MFC r306588:
Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.

7 years agoMFC r306599:
sevan [Sat, 8 Oct 2016 21:13:55 +0000 (21:13 +0000)]
MFC r306599:
dmesg(8) first appeared in 3BSD.
http://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/man/man1/dmesg.1m

PR: 212443
Approved by: bcr (mentor)
Obtained from: TUHS
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306498:
avos [Sat, 8 Oct 2016 16:39:21 +0000 (16:39 +0000)]
MFC r306498:

ral (rt2860): eliminate duplicate ieee80211_process_callback() call
(left after r287197)

While here, add missing mergeinfo for r306320 (committed in r306549)

7 years agoMFC r306568, r306569
vangyzen [Sat, 8 Oct 2016 14:07:34 +0000 (14:07 +0000)]
MFC r306568, r306569

Add the __printflike attribute to the declarations of
dprintf(3) and vdprintf(3).

Sponsored by: Dell EMC

7 years agolmc(4): fix the build without the bpf device
vangyzen [Sat, 8 Oct 2016 13:49:40 +0000 (13:49 +0000)]
lmc(4): fix the build without the bpf device

Reported by: Dave Mischler <dave@mischler.com>
Sponsored by: Dell EMC

7 years agoMFC: r306677
allanjude [Sat, 8 Oct 2016 00:01:07 +0000 (00:01 +0000)]
MFC: r306677

GELIBoot may attempt to read past the end of the disk

PR: 213196
Relnotes: yes
Sponsored by: ScaleEngine Inc.

7 years agoMFC r306292: fix vnode lock assertion for extended attributes directory
avg [Fri, 7 Oct 2016 18:56:20 +0000 (18:56 +0000)]
MFC r306292: fix vnode lock assertion for extended attributes directory

7 years agoMFC r306291: the rest of changes intended to be committed in r306290
avg [Fri, 7 Oct 2016 18:53:17 +0000 (18:53 +0000)]
MFC r306291: the rest of changes intended to be committed in r306290

7 years agoMFC r306218,306290: amdsbwd, intpm: unify bits specific to AMD chipsets
avg [Fri, 7 Oct 2016 18:50:50 +0000 (18:50 +0000)]
MFC r306218,306290: amdsbwd, intpm: unify bits specific to AMD chipsets

7 years agoMFC r306674:
kib [Fri, 7 Oct 2016 11:47:18 +0000 (11:47 +0000)]
MFC r306674:
Style.

7 years agoMFC r306541
bapt [Fri, 7 Oct 2016 06:11:15 +0000 (06:11 +0000)]
MFC r306541

Import dma 20160929

7 years agoMFC r306508: Fix blacklistd's state restoral at startup
lidl [Fri, 7 Oct 2016 02:33:45 +0000 (02:33 +0000)]
MFC r306508: Fix blacklistd's state restoral at startup

The blacklistd daemon attempted to restore the filtering rules
before the database of blocked addresses was opened, so no rules
were being reloaded.  Now the rules are properly recreated when the
daemon is started with '-r'.

This bug was fixed locally, and then sent upstream to NetBSD.
This changeset is the import the NetBSD version of the change,
which added debugging output to alert about a null database.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306507: Update blacklistd.8 with changes from NetBSD
lidl [Fri, 7 Oct 2016 02:32:01 +0000 (02:32 +0000)]
MFC r306507: Update blacklistd.8 with changes from NetBSD

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306528: Fix `sesutil fault` operation.
mav [Fri, 7 Oct 2016 01:32:29 +0000 (01:32 +0000)]
MFC r306528: Fix `sesutil fault` operation.

Fault and ident bits are located in different control bytes, so previous
code was just doing nothing, writing into reserved bit.

7 years agoMFC 302859: Include command line arguments in core dump process info.
jhb [Thu, 6 Oct 2016 21:17:18 +0000 (21:17 +0000)]
MFC 302859: Include command line arguments in core dump process info.

Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command
line arguments.

7 years agoMFC r306522
davidcs [Thu, 6 Oct 2016 18:52:09 +0000 (18:52 +0000)]
MFC r306522
Upgrade Firmware/Bootloader/ResetSeq/Minidump to revision 5.4.62

7 years agoMFC 303754: Add __printflike() to bus_describe_intr() to enable -Wformat checks.
jhb [Thu, 6 Oct 2016 17:21:19 +0000 (17:21 +0000)]
MFC 303754: Add __printflike() to bus_describe_intr() to enable -Wformat checks.

Fix a few places that were passing a raw string as the format to use
a "%s" format string instead.

7 years agoMFC r306279: Use g_wither_provider() where applicable.
mav [Thu, 6 Oct 2016 15:35:36 +0000 (15:35 +0000)]
MFC r306279: Use g_wither_provider() where applicable.

It is just a helper function combining G_PF_WITHER setting with
g_orphan_provider().

7 years agoMFC r306459:
ae [Thu, 6 Oct 2016 08:11:53 +0000 (08:11 +0000)]
MFC r306459:
  Fix bug introduced in r274300.

  In icmp6_reflect() use original source address of erroneous packet as
  destination address for source selection algorithm when original
  destination address is not one of our own.

  Reported by: Mark Kamichoff <prox at prolixium com>

7 years agoMFC 305922: Fix LINT building.
jhb [Wed, 5 Oct 2016 22:26:48 +0000 (22:26 +0000)]
MFC 305922: Fix LINT building.

7 years agoMFC r306090:
kib [Wed, 5 Oct 2016 22:04:22 +0000 (22:04 +0000)]
MFC r306090:
Simple post-mortem reporter for amd64 loader.efi.

7 years agoMFC r306097:
kib [Wed, 5 Oct 2016 22:02:36 +0000 (22:02 +0000)]
MFC r306097:
Add kernel interfaces to call EFI Runtime Services.

MFC r306104:
Fix build of the module outside the kernel tree.

MFC r306209 (by imp):
Change the efi_get_table interface to a void **.

MFC r306351:
Handle TLB shootdown IPI during the EFI runtime calls, on SandyBridges.

7 years agoMFC 303226: Fix kernel builds with "device cxgbe".
jhb [Wed, 5 Oct 2016 00:49:39 +0000 (00:49 +0000)]
MFC 303226: Fix kernel builds with "device cxgbe".

7 years agoMFC r306061:
markj [Wed, 5 Oct 2016 00:33:52 +0000 (00:33 +0000)]
MFC r306061:
Protect ccbq access with devq->send_mtx in the XPT_ABORT handler.

7 years agoMFC 303859,305851: Fix a typo and some whitespace nits.
jhb [Tue, 4 Oct 2016 22:36:36 +0000 (22:36 +0000)]
MFC 303859,305851: Fix a typo and some whitespace nits.

7 years agoMFC 303454: Mark spg_len and fl_pktshift static.
jhb [Tue, 4 Oct 2016 22:34:12 +0000 (22:34 +0000)]
MFC 303454: Mark spg_len and fl_pktshift static.

These variables are no longer exported to t4_netmap.c after r296478.

7 years agoMFC 304482: Adjust t4_port_init() to work with VF devices.
jhb [Tue, 4 Oct 2016 22:32:43 +0000 (22:32 +0000)]
MFC 304482: Adjust t4_port_init() to work with VF devices.

Specifically, the FW_PORT_CMD may or may not work for a VF (the PF
driver can choose whether or not to permit access to this command),
so don't attempt to fetch port information on a VF if permission is
denied by the PF.

7 years agoMFC 305548: Don't break out of the m_advance() loop if len drops to zero.
jhb [Tue, 4 Oct 2016 22:15:42 +0000 (22:15 +0000)]
MFC 305548: Don't break out of the m_advance() loop if len drops to zero.

If a packet contains the Ethernet header (14 bytes) in the first mbuf
and the payload (IP + UDP + data) in the second mbuf, then the attempt
to fetch the l3hdr will return a NULL pointer.  The first loop iteration
will drop len to zero and exit the loop without setting 'p'.  However,
the desired data is at the start of the second mbuf, so the correct
behavior is to loop around and let the conditional set 'p' to m_data of
the next mbuf (and leave offset as 0).

7 years agoMerge r306212:
glebius [Tue, 4 Oct 2016 20:26:18 +0000 (20:26 +0000)]
Merge r306212:
  Fix regression from r297400, which truncates headers in case of low socket
  buffer and put a small optimization for low socket buffer case:

  - Do not hack uio_resid, and let m_uiotombuf() properly take care of it. This
    fixes truncation of headers at low buffer.
  - If headers ate all the space, jump right to the end of the cycle, to
    avoid doing single page I/O and allocating zero length mbuf.
  - Clear hdr_uio only if space is positive, which indicates that all uio
    was copied in.

7 years agoMFC r306046:
markj [Tue, 4 Oct 2016 18:07:33 +0000 (18:07 +0000)]
MFC r306046:
Reduce code duplication around NDP message handlers in icmp6_input().

7 years agoMFC r305659:
mjg [Tue, 4 Oct 2016 18:04:46 +0000 (18:04 +0000)]
MFC r305659:

nullfs: plug vnode ref leak in null_vptocnp

The lower vnode is already referenced and nodeget is supposed to consume
the reference. Thus the extra vref call was causing a leak.

7 years agoMFC 303522,303647,303860,303880,304168,304169,304170,304479,304485,305549:
jhb [Mon, 3 Oct 2016 23:49:05 +0000 (23:49 +0000)]
MFC 303522,303647,303860,303880,304168,304169,304170,304479,304485,305549:
Chelsio T4/T5 VF driver.

303522:
Various fixes to the t4/5nex character device.

- Remove null open/close methods.
- Don't set d_flags to 0 explicitly.
- Remove t5_cdevsw as the .d_name member isn't really used and doesn't
  warrant a separate cdevsw just for the name.
- Use ENOTTY as the error value for an unknown ioctl request.
- Use make_dev_s() to close race with setting si_drv1.

303647:
Store the offset of the KDOORBELL and GTS registers in the softc.

VF devices use a different register layout than PF devices.  Storing
the offset in a value in the softc allows code to be shared between the
PF and VF drivers.

303860:
Reserve an adapter flag IS_VF to mark VF devices vs PF devices.

303880:
Track the base absolute ID of ingress and egress queues.

Use this to map an absolute queue ID to a logical queue ID in interrupt
handlers.  For the regular cxgbe/cxl drivers this should be a no-op as
the base absolute ID should be zero.  VF devices have a non-zero base
absolute ID and require this change.  While here, export the absolute ID
of egress queues via a sysctl.

304168:
Make SGE parameter handling more VF-friendly.

Add fields to hold the SGE control register and free list buffer sizes to
the sge_params structure.  Populate these new fields in
t4_init_sge_params() for PF devices and change t4_read_chip_settings() to
pull these values out of the params structure instead of reading
registers directly.  This will permit t4_read_chip_settings() to be reused
for VF devices which cannot read SGE registers directly.

While here, move the call to t4_init_sge_params() to
get_params__post_init().  The VF driver will populate the SGE parameters
structure via a different method before calling t4_read_chip_settings().

304169:
Update mailbox writes to work with VF devices.

- Use alternate register locations for the data and control registers for
  VFs.
- Do a dummy read to force the writes to the  mailbox data registers to
  post before the write to the control register on VFs.
- Do not check the PCI-e firmware register for errors on VFs.

304170:
Add support for register dumps on VF devices.

- Add handling of VF register sets to t4_get_regs_len() and t4_get_regs().
- While here, use t4_get_regs_len() in the ioctl handler for regdump
  instead of inlining it.

304479:
Add structures for VF-specific adapter parameters.

While here, mark which parameters are PF-specific and which are
VF-specific.

304485:
Reorder sysctls so that nodes shared with the VF driver are added first.

This permits a single early return for VF devices in the routines that
add sysctl nodes.

305549:
Chelsio T4/T5 VF driver.

The cxgbev/cxlv driver supports Virtual Function devices for Chelsio
T4 and T4 adapters.  The VF devices share most of their code with the
existing PF4 driver (cxgbe/cxl) and as such the VF device driver
currently depends on the PF4 driver.

Similar to the cxgbe/cxl drivers, the VF driver includes a t4vf/t5vf
PCI device driver that attaches to the VF device.  It then creates
child cxgbev/cxlv devices representing ports assigned to the VF.
By default, the PF driver assigns a single port to each VF.

t4vf_hw.c contains VF-specific routines from the shared code used to
fetch VF-specific parameters from the firmware.

t4_vf.c contains the VF-specific PCI device driver and includes its
own attach routine.

VF devices are required to use a different firmware request when
transmitting packets (which in turn requires a different CPL message
to encapsulate messages).  This alternate firmware request does not
permit chaining multiple packets in a single message, so each packet
results in a firmware request.  In addition, the different CPL message
requires more detailed information when enabling hardware checksums,
so parse_pkt() on VF devices must examine L2 and L3 headers for all
packets (not just TSO packets) for VF devices.  Finally, L2 checksums
on non-UDP/non-TCP packets do not work reliably (the firmware trashes
the IPv4 fragment field), so IPv4 checksums for such packets are
calculated in software.

Most of the other changes in the non-VF-specific code are to expose
various variables and functions private to the PF driver so that they
can be used by the VF driver.

Note that a limited subset of cxgbetool functions are supported on VF
devices including register dumps, scheduler classes, and clearing of
statistics.  In addition, TOE is not supported on VF devices, only for
the PF interfaces.

Sponsored by: Chelsio Communications

7 years agoMFC 306126: Fix invalid vendor ID constant (typo).
jhb [Mon, 3 Oct 2016 23:16:38 +0000 (23:16 +0000)]
MFC 306126: Fix invalid vendor ID constant (typo).

During a bus rescan the check for an invalid vendor ID of a subfunction
used the wrong constant.

7 years agoMFC 303405: Add support for zero-copy aio_write() on TOE sockets.
jhb [Mon, 3 Oct 2016 23:15:44 +0000 (23:15 +0000)]
MFC 303405: Add support for zero-copy aio_write() on TOE sockets.

AIO write requests for a TOE socket on a Chelsio T4+ adapter can now
DMA directly from the user-supplied buffer.  This is implemented by
wiring the pages backing the user-supplied buffer and queueing special
mbufs backed by raw VM pages to the socket buffer.  The TOE code
recognizes these special mbufs and builds a sglist from the VM page
array associated with the mbuf when queueing a work request to the TOE.

Because these mbufs do not have an associated virtual address, m_data
is not valid.  Thus, the AIO handler does not invoke sosend() directly
for these mbufs but instead inlines portions of sosend_generic() and
tcp_usr_send().

An aiotx_buffer structure is used to describe the user buffer (e.g.
it holds the array of VM pages and a reference to the AIO job).  The
special mbufs reference this structure via m_ext.  Note that a single
job might be split across multiple mbufs (e.g. if it is larger than
the socket buffer size).  The 'ext_arg2' member of each mbuf gives an
offset relative to the backing aiotx_buffer.  The AIO job associated
with an aiotx_buffer structure is completed when the last reference to
the structure is released.

Zero-copy aio_write()'s for connections associated with a given
adapter can be enabled/disabled at runtime via the
'dev.t[45]nex.N.toe.tx_zcopy' sysctl.

Sponsored by: Chelsio Communications

7 years agoMFC 303205,303722,305032,305752: Create VF devices on Chelsio T4/T5 NICs.
jhb [Mon, 3 Oct 2016 22:42:23 +0000 (22:42 +0000)]
MFC 303205,303722,305032,305752: Create VF devices on Chelsio T4/T5 NICs.

303205:
Add a driver to create VF devices on Chelsio T4/T5 NICs.

Chelsio NICs are a bit unique compared to some other NICs in that they
expose different functionality on different physical functions.  In
particular, PF4 is used to manage the NIC interfaces ('t4nex' and 't5nex').
However, PF4 is not able to create VF devices.  Instead, VFs are only
supported by physical functions 0 through 3.  This commit adds 't4iov'
and 't5iov' drivers that attach to PF0-3.

One extra wrinkle is that the iov devices cannot enable SR-IOV until the
firwmare has been initialized by the main PF4 driver.  To handle this
case, a new t4_if kobj interface has been added to permit cross-calls
between the PF drivers.  The PF4 driver notifies sibling drivers when it
is fully attached.  It also requests sibling drivers to detach before it
detaches.  Sibling drivers query the PF4 driver during their attach
routine to see if it is attached.  If not, the sibling drivers defer
their attach actions until the PF4 driver informs them it is attached.

VF devices are associated with a single port on the NIC.  VF devices
created from PF0 are associated with the first port on the NIC, VFs
from PF1 are associated with the second port, etc.  VF devices can
only be created from a PF device that has an associated port.  Thus,
on a 2-port card, VFs are only supported on PF0 and PF1.

303722:
Use the port device name for the iov device for Chelsio T4/T5 cards.

Chelsio T4/T5 adapters are multifunction cards.  The main driver uses
physical function 4 (PF4).  However, VF devices for SR-IOV are only
supported on physical functions 0 through 3, where PF0 creates VFs tied
to port 0, etc.  The t4iov/t5iov driver was previously added to
create VF devices for ports that are present on each adapter.  This
change uses the recently added pci_iov_attach_name() function to
name the character device in /dev/iov after the associated port on
the card (e.g. /dev/iov/cxl0 is used to create VFs that share the
cxl0 port).  With this in place, mark the t4iov/t5iov devices quiet
to prevent them from cluttering dmesg.

305032:
Use device_verbose() to undo device_quiet() when detaching from t[45]iovX.

The device quiet flag is not automatically reset on detach, so it is
inherited by other device drivers (e.g. when switching a device driver
over to ppt for PCI pass through).  Cope with this behavior by explicitly
marking the device verbose during detach so that the next driver can make
its own decision.

305752:
Remove explicit device_verbose() from the t4iov driver detach routine
now that this case is handled generically.

Sponsored by: Chelsio Communications

7 years agoMFC r306048
asomers [Mon, 3 Oct 2016 14:59:32 +0000 (14:59 +0000)]
MFC r306048

Fix periodic scripts when an NFS mount covers a local mount

100.chksetuid and 110.neggrpperm try to search through all UFS and ZFS
filesystems. But their logic contains an error. They also search through
remote filesystems that are mounted on top of the root of a local
filesystem. For example, if a user installs a FreeBSD system with the
default ZFS layout, he'll get a zroot/usr/home filesystem. If he then mounts
/usr/home over NFS, these scripts would search through /usr/home.

7 years agoMFC r306228:
hselasky [Mon, 3 Oct 2016 12:58:08 +0000 (12:58 +0000)]
MFC r306228:
Prevent cuse4bsd.ko and cuse.ko from loading at the same time by
declaring support for the cuse4bsd interface in cuse.ko.

Found by: Sergey V. Dyatko <sergey.dyatko@gmail.com>

7 years agoMFC: r304059
rmacklem [Mon, 3 Oct 2016 12:13:40 +0000 (12:13 +0000)]
MFC: r304059
Update the man page to descibe the "-d" option added by r304058.

This is a content change.

7 years agoMFC: r304058, r304066, r304194
rmacklem [Mon, 3 Oct 2016 12:02:45 +0000 (12:02 +0000)]
MFC: r304058, r304066, r304194
Update nfsstat.c to use the new kernel nfsstat structure and
add the new "-d" flag from D1626.
The man page will be updated in a subsequent commit.

7 years agoMFC r306350:
kib [Mon, 3 Oct 2016 09:41:33 +0000 (09:41 +0000)]
MFC r306350:
For machines which support PCID but not have INVPCID instruction,
i.e. SandyBridge and IvyBridge, correct a race between pmap_activate()
and invltlb_pcid_handler().

7 years agoMFC r305978:
kib [Mon, 3 Oct 2016 09:39:46 +0000 (09:39 +0000)]
MFC r305978:
Detect x2APIC mode on boot and obey it.

7 years agoMFC r305977:
kib [Mon, 3 Oct 2016 09:37:56 +0000 (09:37 +0000)]
MFC r305977:
Be more strict when selecting between snapshot/regular mount.

7 years agoMFC r306334:
kib [Mon, 3 Oct 2016 09:30:25 +0000 (09:30 +0000)]
MFC r306334:
Document thr_suspend(2) and thr_wake(2).

MFC r306506:
Reword the statement.

7 years agoMFC r306505:
kib [Mon, 3 Oct 2016 09:28:06 +0000 (09:28 +0000)]
MFC r306505:
Add an article.

7 years agoMFC: r304026
rmacklem [Mon, 3 Oct 2016 00:10:14 +0000 (00:10 +0000)]
MFC: r304026
Update the nfsstats structure to include the changes needed by
the patch in D1626 plus changes so that it includes counts for
NFSv4.1 (and the draft of NFSv4.2).
Also, make all the counts uint64_t and add a vers field at the
beginning, so that future revisions can easily be implemented.
There is code in place to handle the old vesion of the nfsstats
structure for backwards binary compatibility.

Subsequent commits will update nfsstat(8) to use the new fields.

7 years agoMFC r306289:
kp [Sun, 2 Oct 2016 21:06:55 +0000 (21:06 +0000)]
MFC r306289:

bridge: Fix fragment handling and memory leak

Fragmented UDP and ICMP packets were corrupted if a firewall with reassembling
feature (like pf'scrub) is enabled on the bridge.  This patch fixes corrupted
packet problem and the panic (triggered easly with low RAM) as explain in PR
185633.

bridge_pfil and bridge_fragment relationship:

bridge_pfil() receive (IN direction) packets and sent it to the firewall The
firewall can be configured for reassembling fragmented packet (like pf'scrubing)
in one mbuf chain when bridge_pfil() need to send this reassembled packet to the
outgoing interface, it needs to re-fragment it by using bridge_fragment()
bridge_fragment() had to split this mbuf (using ip_fragment) first then
had to M_PREPEND each packet in the mbuf chain for adding Ethernet
header.

But M_PREPEND can sometime create a new mbuf on the begining of the mbuf chain,
then the "main" pointer of this mbuf chain should be updated and this case is
tottaly forgotten. The original bridge_fragment code (Revision 158140,
2006 April 29) came from OpenBSD, and the call to bridge_enqueue was
embedded.  But on FreeBSD, bridge_enqueue() is done after bridge_fragment(),
then the original OpenBSD code can't work as-it of FreeBSD.

PR:             185633
Submitted by:   Olivier Cochard-LabbĂ©

7 years agoRegen.
kib [Sun, 2 Oct 2016 16:14:03 +0000 (16:14 +0000)]
Regen.

7 years agoMFC r305954:
kib [Sun, 2 Oct 2016 16:13:18 +0000 (16:13 +0000)]
MFC r305954:
Add compat32 support for capsicum.

7 years agoMFC r304431:
markj [Sun, 2 Oct 2016 01:22:38 +0000 (01:22 +0000)]
MFC r304431:
Add a SIGINFO handler for dtrace(1).

7 years agoMFC r305056, r305367:
markj [Sun, 2 Oct 2016 01:21:02 +0000 (01:21 +0000)]
MFC r305056, r305367:
Restore swap pager readahead.

7 years agoMFC r306220:
markj [Sun, 2 Oct 2016 01:18:34 +0000 (01:18 +0000)]
MFC r306220:
Re-check the systrace probe ID before calling dtrace_probe().

7 years agoMFC r306285:
markj [Sun, 2 Oct 2016 01:16:02 +0000 (01:16 +0000)]
MFC r306285:
Rename ndpr_refcnt to ndpr_addrcnt.

7 years agoMFC r306304:
markj [Sun, 2 Oct 2016 01:14:26 +0000 (01:14 +0000)]
MFC r306304:
Move implementations of uread() and uwrite() to the illumos compat layer.

7 years agoMFC r305213,305319,305398
alc [Sat, 1 Oct 2016 19:30:28 +0000 (19:30 +0000)]
MFC r305213,305319,305398
  As an optimization to the machine-independent layer, change the machine-
  dependent pmap_ts_referenced() so that it updates the page's dirty field
  if a modified bit is found while counting reference bits.  This
  opportunistic update can be performed at low cost and can eliminate the
  need for some future calls to pmap_is_modified() by the machine-
  independent layer.

  Replace the number 4 in sparc64's pmap_ts_referenced() by
  PMAP_TS_REFERENCED_MAX, like we've done elsewhere, e.g., amd64.

7 years agoMFC r305902:
kib [Sat, 1 Oct 2016 09:19:43 +0000 (09:19 +0000)]
MFC r305902:
Reduce size of ufs inode.

MFC r305903:
Fix libprocstat build after r305902.

7 years agoMFC r306320:
avos [Sat, 1 Oct 2016 03:24:53 +0000 (03:24 +0000)]
MFC r306320:

rsu: do not restart calibration task when going out of RUN state.

Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.

Reported and tested by: hselasky
Reviewed by: adrian

7 years agoMFC 305751: Make device_quiet() an attachment property.
jhb [Fri, 30 Sep 2016 22:29:19 +0000 (22:29 +0000)]
MFC 305751: Make device_quiet() an attachment property.

In particular, reset the DF_QUIET flag when detaching from a device so
that a driver that marks a device quiet doesn't dictate policy for a
different driver that may claim the device in the future.

Sponsored by: Chelsio Communications

7 years agoMFC 305034: Implement 'devctl clear driver' to undo a previous 'set driver'.
jhb [Fri, 30 Sep 2016 22:05:47 +0000 (22:05 +0000)]
MFC 305034: Implement 'devctl clear driver' to undo a previous 'set driver'.

Add a new 'clear driver' command for devctl along with the accompanying
ioctl and devctl_clear_driver() library routine to reset a device to
use a wildcard devclass instead of a fixed devclass.  This can be used
to undo a previous 'set driver' command.  After the device's name has
been reset to permit wildcard names, it is reprobed so that it can
attach to newly-available (to it) device drivers.

Sponsored by: Chelsio Communications

7 years agoMFC 305502: Reset PCI pass through devices via PCI-e FLR during VM start/end.
jhb [Fri, 30 Sep 2016 18:47:34 +0000 (18:47 +0000)]
MFC 305502: Reset PCI pass through devices via PCI-e FLR during VM start/end.

Add routines to trigger a function level reset (FLR) of a PCI-express
device via the PCI-express device control register.  This also includes
support routines to wait for pending transactions to complete as well
as calculating the maximum completion timeout permitted by a device.

Change the ppt(4) driver to reset pass through devices before attaching
to a VM during startup and before detaching from a VM during shutdown.

Sponsored by: Chelsio Communications

7 years agoMFC r304855
hiren [Fri, 30 Sep 2016 18:14:05 +0000 (18:14 +0000)]
MFC r304855

Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection
can be in after receiving a FIN.

FWIW, NetBSD has this change for quite some time.

This has been tested at Netflix and Limelight in production traffic.

7 years agoMFC r306261:
kib [Fri, 30 Sep 2016 09:20:44 +0000 (09:20 +0000)]
MFC r306261:
Add proccontrol(1).

MFC r306281 (by bdrewery):
DIRDEPS_BUILD: Connect new directories.

7 years agoMFC r303019:
ae [Fri, 30 Sep 2016 03:45:41 +0000 (03:45 +0000)]
MFC r303019:
  Use g_resize_provider() to change the size of GEOM_DISK provider,
  when it is being opened. This should fix the possible loss of a resize
  event when disk capacity changed.

MFC r303288:
  Do not invoke resize method if geom is being withered.

MFC r303637:
  Do not invoke resize event if initial disk size is zero. Some disks
  report the size only after first opening.  And due to the events are
  asynchronous, some consumers can receive this event too late and
  this confuses them. This partially restores previous behaviour, and
  at the same time this should fix the problem, when already opened
  provider loses resize event.

PR: 211028