]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC: r313961 r316061
bapt [Sat, 1 Apr 2017 09:37:15 +0000 (09:37 +0000)]
MFC: r313961 r316061

Update pci_vendors to 2017-03-16

git-svn-id: svn://svn.freebsd.org/base/stable/10@316352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316060:
bapt [Sat, 1 Apr 2017 09:32:05 +0000 (09:32 +0000)]
MFC r316060:

Import tzdata 2017b

git-svn-id: svn://svn.freebsd.org/base/stable/10@316350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r315912 (by eugen@) and r315935
bapt [Sat, 1 Apr 2017 09:29:47 +0000 (09:29 +0000)]
MFC: r315912 (by eugen@) and r315935

Properly initialise with content of pw.conf(5) that was mistakenly ignored.
Also, respect "defaultgroup" if specified there.

Add a regression test

PR: 217934
Submitted by: Victor Sudakov <vas@mpeks.tomsk.su>

git-svn-id: svn://svn.freebsd.org/base/stable/10@316348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315636,315876,316095:
mm [Fri, 31 Mar 2017 20:17:30 +0000 (20:17 +0000)]
MFC r315636,315876,316095:
Sync libarchive with vendor

Vendor changes/bugfixes (FreeBSD-related):
r315636:
  PR 867 (bsdcpio): show numeric uid/gid when names are not found
  PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers
  PR 880 (pax): Fix handling of "size" pax header keyword
  PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream
  OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser
  Break ACL read/write code into platform-specific source files

r315876:
  Store extended attributes with extattr_set_link() if no fd is provided
  Add extended attribute tests to libarchive and bsdtar
  Fix tar's test_option_acls
  Support the UF_HIDDEN file flag

r316095:
  Constify variables in several places
  Unify platform ACL code in a single source file
  Fix unused variable if compiling on FreeBSD without NFSv4 ACL support

git-svn-id: svn://svn.freebsd.org/base/stable/10@316338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315516
truckman [Fri, 31 Mar 2017 06:33:20 +0000 (06:33 +0000)]
MFC r315516

Change several constants used by the PIE algorithm from unsigned to signed.

 - PIE_MAX_PROB is compared to variable of int64_t and the type promotion
   rules can cause the value of that variable to be treated as unsigned.
   If the value is actually negative, then the result of the comparsion
   is incorrect, causing the algorithm to perform poorly in some
   situations.  Changing the constant to be signed cause the comparision
   to work correctly.

 - PIE_SCALE is also compared to signed values.  Fortunately they are
   also compared to zero and negative values are discarded so this is
   more of a cosmetic fix.

 - PIE_DQ_THRESHOLD is only compared to unsigned values, but it is small
   enough that the automatic promotion to unsigned is harmless.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>

git-svn-id: svn://svn.freebsd.org/base/stable/10@316325 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316106:
ngie [Fri, 31 Mar 2017 04:51:08 +0000 (04:51 +0000)]
MFC r316106:

Don't shadow read(2) definition with `read` argument in vdev_{create,probe}

This fixes several -Wshadow warnings introduced in r192194, but now errors
with gcc 6.3.0.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316107:
ngie [Fri, 31 Mar 2017 04:44:37 +0000 (04:44 +0000)]
MFC r316107:

Remove redundant declaration for `zfs_crc64_table`

zfssubr.c already defines this statically. Besides, zfsimpl.c defined it, but
didn't use it.

This fixes a -Wredundant-decls warning.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316321 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316108:
ngie [Fri, 31 Mar 2017 04:43:25 +0000 (04:43 +0000)]
MFC r316108:

Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)`

This variable has been unused since its inception in r40106.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316319 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316080,r316081,r316115:
ngie [Fri, 31 Mar 2017 04:42:00 +0000 (04:42 +0000)]
MFC r316080,r316081,r316115:

r316080:

Fix some localized style(9) issues and reword CAM_ERRBUF_SIZE description

The CAM_ERRBUF_SIZE description rewording fixes a typo by proxy.

r316081:

Use `sizeof(cam_errbuf)` instead of `CAM_ERRBUF_SIZE` in snprintf calls

Reindent snprintf calls' arguments to match style(9) guidelines with
respect to indentation.

r316115:

libcam: use __func__ instead of hardcoding the function name as `func_name`

Tested with: `cam_device_copy(NULL, NULL)` // ;)..

git-svn-id: svn://svn.freebsd.org/base/stable/10@316316 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315732:
ed [Thu, 30 Mar 2017 15:05:58 +0000 (15:05 +0000)]
MFC r315732:

  Add forward declaration for struct vnode.

  The coredump() function provided by this header file has struct vnode *
  as an argument.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235
dexuan [Thu, 30 Mar 2017 12:51:44 +0000 (12:51 +0000)]
MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235

r314547
    loader.efi: reduce the size of the staging area if necessary

    The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE)
    is Conventional Memory, but actually it may not, e.g. in the case
    of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows
    Server 2012 R2 host, there is a BootServiceData memory block at
    the address 47.449MB and the memory is not writable.

    Without the patch, the loader will crash in efi_copy_finish():
    see PR 211746.

    The patch verifies the end of the staging area, and reduces its
    size if necessary. This way, the loader will not try to write into
    the BootServiceData memory any longer.

    Thank Marcel Moolenaar for helping me on this issue!

    The patch also allocates the staging area in the first 1GB memory.
    See the comment in the patch for this.

    Reviewed by: marcel, kib, sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9686

r314770
    loader.efi: fix recent UEFI-boot regression on physical machines

    This patch fixes my recent patch
    "loader.efi: reduce the size of the staging area if necessary", which
    causes EFI-boot failure on physical machines since Mar 2:
    on the host there is a 1MB LoaderData memory range, which splits
    the big Conventional Memory range into a small one (15MB) and a
    big one: the small one is too small to hold the staging area.

    We can actually use the LoaderData range safely, because when
    amd64_tramp -> efi_copy_finish() starts to run, we're almost at
    the very end of the efi loader code and we're going to "return"
    to the kernel entry, so we're pretty sure we won't access any loader
    data any more.

    For people who are interested in the details: please see
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22

    PS, some people also reported the regression happened to FreeBSD VM
    running on Bhyve in EFI mode. This patch should resolve it too,
    though I don't have such a setup to test.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9904

r314828
    loader.efi: fix an off-by-one bug in efi_verify_staging_size()

    Also remove the warning message: it may not be unusual to see
    the memory range containing 2MB is not of EfiConventionalMemory.

    Sponsored by: Microsoft

r314891
    loader.efi: finally fix the off-by-one bug in efi_verify_staging_size()

    r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size())
    doesn't really fix the bug and this patch adds the missing part.

    It's a shame that I didn't make everything correct at the very beginning...

    Sponsored by: Microsoft

r314956
    loader.efi: only reduce the size of the staging area on Hyper-V

    Doing this on physical hosts turns out to be problematic, e.g. see comment
    24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746.

    To fix the real underlying issue correctly & thoroughly, IMO we need
    a relocatable kernel, but that would require a lot of complicated long
    term work:  https://reviews.freebsd.org/D9686?id=25414#inline-56969

    For now, let's only apply efi_verify_staging_size() to VMs running on
    Hyper-V, and restore the old behavior on physical machines since that
    has been working for people for a long period of time, though that's
    potentially unsafe...

    Sponsored by: Microsoft

r314962
    loader.efi: only include the machine/ header files on x86

    The 2 files may not exist on other archs like aarch64 and hence we
    can have a build failure there.

    Reported by: lwhsu
    Sponsored by: Microsoft

r315235
    loader.efi: use stricter check for Hyper-V

    Some other hypervisors like Xen can pretend to be Hyper-V but obviously
    they can't implement all Hyper-V features. Let's make sure we're genuine
    Hyper-V here.

    Also fix some minor coding style issues.

    Sponsored by: Microsoft

PR: 211746

git-svn-id: svn://svn.freebsd.org/base/stable/10@316273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315776:
ngie [Thu, 30 Mar 2017 06:20:58 +0000 (06:20 +0000)]
MFC r315776:

Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315798:
ngie [Thu, 30 Mar 2017 06:14:36 +0000 (06:14 +0000)]
MFC r315798:

DB_COMMAND(9): fix mandoc markup

Start new sentences on new lines.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316050,r316051:
ngie [Thu, 30 Mar 2017 06:13:54 +0000 (06:13 +0000)]
MFC r316050,r316051:

r316050:

ctld: sort #includes per style(9)

- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

r316051:

ctldadm: sort #includes per style(9)

- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316253 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315762:
ngie [Thu, 30 Mar 2017 06:07:38 +0000 (06:07 +0000)]
MFC r315762:

rc.conf(5): fix a .Xr call for chroot(8)

Add the missing section number to the .Xr call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315795:
ngie [Thu, 30 Mar 2017 06:06:49 +0000 (06:06 +0000)]
MFC r315795:

alq(9): fix mandoc markup

Start new sentence on a new line.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316247 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315803:
ngie [Thu, 30 Mar 2017 06:06:09 +0000 (06:06 +0000)]
MFC r315803:

memguard(9): fix igor/manlint warnings

- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

git-svn-id: svn://svn.freebsd.org/base/stable/10@316245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315788:
ngie [Thu, 30 Mar 2017 06:02:39 +0000 (06:02 +0000)]
MFC r315788:

build(7): sort SEE ALSO section

tests(7) should be grouped in the man section 7 group, not the section 8 group.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315802:
ngie [Thu, 30 Mar 2017 06:00:30 +0000 (06:00 +0000)]
MFC r315802:

ifnet(9): fix some igor/manlint warnings

- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

git-svn-id: svn://svn.freebsd.org/base/stable/10@316239 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315772:
ngie [Thu, 30 Mar 2017 05:57:44 +0000 (05:57 +0000)]
MFC r315772:

tmpfs(5): fix mdoc warnings

- Delete trailing whitespace
- Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315789:
ngie [Thu, 30 Mar 2017 05:57:01 +0000 (05:57 +0000)]
MFC r315789:

tests(7): fix mdoc warning

Continue sentence in "Configuring the tests" on a new line.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316236 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316049:
ngie [Thu, 30 Mar 2017 05:54:27 +0000 (05:54 +0000)]
MFC r316049:

Allow WARNS to be overridden by the end-user

git-svn-id: svn://svn.freebsd.org/base/stable/10@316235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315797:
ngie [Thu, 30 Mar 2017 05:50:51 +0000 (05:50 +0000)]
MFC r315797:

buf_ring(9): fix mandoc markup

Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r316229:
ngie [Thu, 30 Mar 2017 05:49:46 +0000 (05:49 +0000)]
MFstable/11 r316229:

Backport mlx4{en,ib}(4) from ^/head

MFCing other pieces would be very structurally disruptive. This just
brings back the manpages so they can be used by end-users and to ease
future backports.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315759,r315761:
ngie [Thu, 30 Mar 2017 05:25:33 +0000 (05:25 +0000)]
MFC r315759,r315761:

r315759 (by gjb):

Add mlx5en(4) to the hardware page. [1]
Belatedly bump copyright years after several changes.

r315761:

Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes

git-svn-id: svn://svn.freebsd.org/base/stable/10@316225 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315774:
ngie [Thu, 30 Mar 2017 05:17:23 +0000 (05:17 +0000)]
MFC r315774:

mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315796:
ngie [Thu, 30 Mar 2017 05:16:37 +0000 (05:16 +0000)]
MFC r315796:

bus_alloc_resource(9): fix mandoc markup

Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316219 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314372:
ngie [Thu, 30 Mar 2017 05:15:00 +0000 (05:15 +0000)]
MFC r314372:

Use "build" instead of "all" when building ports modules

"all" in ports currently means "stage the ports", which requires root today,
and brings to light other potential issues, like ENAMETOOLONG with staged
directories (bug 161481, etc).

This fixes buildkernel for me when run as a non-root user, assuming all
of the prerequisites have been installed beforehand and are up-to-date.

Discussed with: swills (IRC)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316218 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315734:
ngie [Thu, 30 Mar 2017 05:13:52 +0000 (05:13 +0000)]
MFC r315734:

style(9): sort #includes

git-svn-id: svn://svn.freebsd.org/base/stable/10@316216 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306733
sevan [Thu, 30 Mar 2017 02:38:38 +0000 (02:38 +0000)]
MFC r306733

Add history section to fsck(8)

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@316209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r266586
sevan [Thu, 30 Mar 2017 02:37:37 +0000 (02:37 +0000)]
MFC r266586

If called without -T or -t, fsck attempts to detect the
file system type.  If this fails, fsck will fail with
"unknown file system type" message.

PR: 188214

git-svn-id: svn://svn.freebsd.org/base/stable/10@316207 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306616
sevan [Thu, 30 Mar 2017 02:32:38 +0000 (02:32 +0000)]
MFC r306616

setkey appeared in FreeBSD 4.0

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@316205 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306617
sevan [Thu, 30 Mar 2017 02:28:49 +0000 (02:28 +0000)]
MFC r306617

shutdown appeared as a standalone utility in 4.1BSD.
http://mail-index.netbsd.org/source-changes-d/2016/09/13/msg008686.html
http://mail-index.netbsd.org/source-changes-d/2016/09/14/msg008691.html
PR: 212552
Approved by: bcr (mentor)
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D8105

git-svn-id: svn://svn.freebsd.org/base/stable/10@316204 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r306715
sevan [Thu, 30 Mar 2017 02:23:02 +0000 (02:23 +0000)]
MFC r306715

Add history section for dd(1)
First version of UNIX to include dd found using TUHS
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@316203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r285645
sevan [Thu, 30 Mar 2017 02:19:42 +0000 (02:19 +0000)]
MFC r285645

Mention the dd-like recoverdisk(1) to help folks find this great BSD command.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r270831
sevan [Thu, 30 Mar 2017 02:17:48 +0000 (02:17 +0000)]
MFC r270831

Update the date for last example.

Sponsored by: Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@316201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r270771
sevan [Thu, 30 Mar 2017 02:16:34 +0000 (02:16 +0000)]
MFC r270771
Add canonical population of a disk / thumb drive from an image example.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316200 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r309192
sevan [Thu, 30 Mar 2017 02:02:48 +0000 (02:02 +0000)]
MFC r309192

Fix null dereference when running out of nodes during rename.

PR: 212370
Submitted by: Sascha Wildner <swildner AT gmail>
Reviewed by: bcr (mentor)
Approved by: bapt
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D8643

git-svn-id: svn://svn.freebsd.org/base/stable/10@316198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312692
sevan [Thu, 30 Mar 2017 02:00:42 +0000 (02:00 +0000)]
MFC r312692

Improve wording when describing -mmin.

PR: 215922
Submitted by: danielsh AT apache DOT org
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D9313

git-svn-id: svn://svn.freebsd.org/base/stable/10@316197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r281759
sevan [Thu, 30 Mar 2017 01:57:32 +0000 (01:57 +0000)]
MFC r281759

find.1: Add missing whitespace:

Obtained from: Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316196 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r309552
sevan [Thu, 30 Mar 2017 01:48:36 +0000 (01:48 +0000)]
MFC r309552

Fix error in the example section
Adjust formatting highlighted by igor.

PR: 214683
Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com>
Reviewed by: jilles
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8591

git-svn-id: svn://svn.freebsd.org/base/stable/10@316194 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r316022,r316023:
jamie [Thu, 30 Mar 2017 01:37:37 +0000 (01:37 +0000)]
MFC r316022,r316023:

  Fix hexadecimal escape codes in jail.conf(5).

PR: 218154
Submitted by: Masahiro Konishi <mkonishi@sea.plala.or.jp>

git-svn-id: svn://svn.freebsd.org/base/stable/10@316193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 312684
sevan [Thu, 30 Mar 2017 01:17:46 +0000 (01:17 +0000)]
MFC 312684

Extend manual to cover more commands and options.

PR: 203406
Submitted by: Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com)
Approved by: wblock (mentor)
Differential Revision:  https://reviews.freebsd.org/D8691

git-svn-id: svn://svn.freebsd.org/base/stable/10@316189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 315964
sevan [Thu, 30 Mar 2017 01:00:45 +0000 (01:00 +0000)]
MFC 315964
ftp.microsoft.com is dead and the document was not archived, point to the full
protocol spec document instead.
Fix spelling mistake flagged by igor.
Rephrase bad sentence flagged by igor.

Approved by:  bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D10111

git-svn-id: svn://svn.freebsd.org/base/stable/10@316187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix build broken by different size of lun_id_t.
mav [Wed, 29 Mar 2017 19:25:42 +0000 (19:25 +0000)]
Fix build broken by different size of lun_id_t.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316173 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix -Wformat issue with r316140, which broke i386/GENERIC
ngie [Wed, 29 Mar 2017 17:11:41 +0000 (17:11 +0000)]
Fix -Wformat issue with r316140, which broke i386/GENERIC

Since r316140 was a direct commit to ^/stable/10, this too is a direct commit
to ^/stable/10.

Reported by: Jenkins (FreeBSD-stable-10-i386-build job)
Tested with: amd64, i386
Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@316170 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315545: Remove hackish code delaying ATIOs to unknown virtual port.
mav [Wed, 29 Mar 2017 16:17:10 +0000 (16:17 +0000)]
MFC r315545: Remove hackish code delaying ATIOs to unknown virtual port.

Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful
in loop mode, which probably doesn't worth having this hack in 2017.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316169 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315536: Move <= 23xx PDB workaround to generic code.
mav [Wed, 29 Mar 2017 16:15:52 +0000 (16:15 +0000)]
MFC r315536: Move <= 23xx PDB workaround to generic code.

It is chip-specific and has nothing to do with platform.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315534: Remove some dead stuff.
mav [Wed, 29 Mar 2017 16:14:33 +0000 (16:14 +0000)]
MFC r315534: Remove some dead stuff.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code.
mav [Wed, 29 Mar 2017 16:13:24 +0000 (16:13 +0000)]
MFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code.

This code has nothing to do with specific platform.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.
mav [Wed, 29 Mar 2017 16:04:42 +0000 (16:04 +0000)]
MFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.

There were two copies of the code: one in generic code was half-broken, and
another in platform code was never called.  Leave only one in generic code
and working.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code.
mav [Wed, 29 Mar 2017 16:04:02 +0000 (16:04 +0000)]
MFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315488: Extend nt_lun to full 8 byte.
mav [Wed, 29 Mar 2017 16:02:50 +0000 (16:02 +0000)]
MFC r315488: Extend nt_lun to full 8 byte.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315485: Remove dead remnants of SPI target.
mav [Wed, 29 Mar 2017 15:58:25 +0000 (15:58 +0000)]
MFC r315485: Remove dead remnants of SPI target.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315482: Use isp_target_put_entry() in places where it can be.
mav [Wed, 29 Mar 2017 15:56:57 +0000 (15:56 +0000)]
MFC r315482: Use isp_target_put_entry() in places where it can be.

This unifies the code and removes some duplication.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315478: Do some notify acks cleanup.
mav [Wed, 29 Mar 2017 15:45:34 +0000 (15:45 +0000)]
MFC r315478: Do some notify acks cleanup.

ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316151 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315327: Remove not very useful ATIO/INOT stats.
mav [Wed, 29 Mar 2017 15:44:22 +0000 (15:44 +0000)]
MFC r315327: Remove not very useful ATIO/INOT stats.

While there polish respective debug logging.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315307: Refactor interrupt handling.
mav [Wed, 29 Mar 2017 15:43:07 +0000 (15:43 +0000)]
MFC r315307: Refactor interrupt handling.

Instead of single isp_intr() function doing all possible magic, introduce
four different functions to handle mailbox operation completions, async
events, response and ATIO queues.  The goal is to isolate different code
paths to make code more readable, and to make easier support for multiple
interrupt vectors.  Even oldest hardware in many cases can identify what
code path it should run on interrupt.  Contemporary hardware can assign
them to different interrupt vectors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315303: Fix panic when SIM dereferenced before allocation.
mav [Wed, 29 Mar 2017 15:41:14 +0000 (15:41 +0000)]
MFC r315303: Fix panic when SIM dereferenced before allocation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234.
mav [Wed, 29 Mar 2017 15:39:47 +0000 (15:39 +0000)]
MFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316142 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoxen/netfront: release resources on removal
royger [Wed, 29 Mar 2017 15:34:52 +0000 (15:34 +0000)]
xen/netfront: release resources on removal

Current netfront code doesn't release the resources (grants and mbufs) on
removal. Add a new helper that releases the resources, so FreeBSD doesn't run
out of grants or memory when performing heavy hotplug/unplug of Xen PV nic
devices.

This is a direct commit to stable/10 because the code in newer branches has
been completely refactored and no longer has this issue.

Reviewed by: royger
Submitted by: Ouyangzhaowei <ouyangzhaowei@huawei.com>
Differential review: https://reviews.freebsd.org/D10088

git-svn-id: svn://svn.freebsd.org/base/stable/10@316140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315711: Fix printing bits above first eight.
mav [Wed, 29 Mar 2017 14:58:15 +0000 (14:58 +0000)]
MFC r315711: Fix printing bits above first eight.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315738:
ngie [Wed, 29 Mar 2017 08:02:12 +0000 (08:02 +0000)]
MFC r315738:

Document some more 10GbE+ network drivers in loader.conf

- if_cxgbe
- if_ixl
- if_ixlv
- sfxge

git-svn-id: svn://svn.freebsd.org/base/stable/10@316130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315699:
ngie [Wed, 29 Mar 2017 08:00:11 +0000 (08:00 +0000)]
MFC r315699:

Print out name of non-dynamic sysctl in sysctl_remove_oid_locked

This will provide a slightly better smoking gun than just stating
"can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9)
and sysctl_remove_{name,oid}(9) with a non-dynamic (likely
static) sysctl.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315201, r315920, r315921, r315922, r316008, and r316062.
np [Wed, 29 Mar 2017 02:21:05 +0000 (02:21 +0000)]
MFC r315201, r315920, r315921, r315922, r316008, and r316062.

r315201:
cxgbe(4):  Fix an always-true assertion (reported by PVS-Studio).

sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3)

r315920:
cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure.

r315921:

cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during
alloc_ep.

r315922:
cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on
FreeBSD) cannot fail.

r316008:
cxgbe/iw_cxgbe: Remove unused code.

r316062:
cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to
the thread that deals with socket state changes.  This eliminates
various bad races with the ithread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311103 (ian):
cy [Wed, 29 Mar 2017 01:32:34 +0000 (01:32 +0000)]
MFC r311103 (ian):

Update ntp.conf to use the ntpd pool feature.

Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org
using 3 separate 'server' config lines.  That is now replaced with a single
'pool' line which causes ntpd to add multiple servers from the pool.

More than just making the config smaller, the pool feature in ntpd has one
major advantage over configuring 3 separate servers from a pool: if a server
that was added using a 'pool' statement provides bad time (initially or at
some later date), ntpd automatically discards it and configures a new
different server from the pool without needing to be restarted.

These changes also add a 'tos' line to control how many pool servers get
added, a 'restrict source' line that is required to allow ntpd to add new
peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does
nothing and should never have been there (127.127.1.0 is not a valid IP
address, it's a refclock identifier).

Reviewed by: cy
MFC requested by: ache
Differential Revision:  https://reviews.freebsd.org/D9011

git-svn-id: svn://svn.freebsd.org/base/stable/10@316121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315242: Fix late and noauto with geli swap
amdmi3 [Tue, 28 Mar 2017 10:43:20 +0000 (10:43 +0000)]
MFC r315242: Fix late and noauto with geli swap

With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by: jilles
Approved by: jilles
Differential Revision: D9835

git-svn-id: svn://svn.freebsd.org/base/stable/10@316097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315279: Remove some dead/broken code paths around async handling
mav [Tue, 28 Mar 2017 10:26:27 +0000 (10:26 +0000)]
MFC r315279: Remove some dead/broken code paths around async handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@316093 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315273: Remove tangled isp_mbox_continue() mechanism.
mav [Tue, 28 Mar 2017 10:25:10 +0000 (10:25 +0000)]
MFC r315273: Remove tangled isp_mbox_continue() mechanism.

It was implemented to reduce context switches when uploading firmware to
card's RAM.  But this mechanism is not used last 10 years since all mbox
operations are now polled, and it was never used for cards produced in
last 15 years.  Newer cards can use DMA to upload firmware.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.
mav [Tue, 28 Mar 2017 10:24:01 +0000 (10:24 +0000)]
MFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315234: Improvements around attach, reset and detach.
mav [Tue, 28 Mar 2017 10:22:55 +0000 (10:22 +0000)]
MFC r315234: Improvements around attach, reset and detach.

This change fixes DMA resource leak on driver unload.  Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware.  Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316087 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313568 (by ken):
mav [Tue, 28 Mar 2017 10:19:52 +0000 (10:19 +0000)]
MFC r313568 (by ken):
Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.

The isp(4) driver was changing the tag type for REQUEST SENSE
commands to Head of Queue, when the CAM CCB flag
CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
and when the target has tagged queueing turned on.

In most cases when CAM_TAG_ACTION_VALID is not set, it is because
the target is not doing tagged queueing.  In those cases, trying to
send a Head of Queue tag may cause problems.  Instead, default to
sending a simple tag.

IBM tape drives claim to support tagged queueing in their standard
Inquiry data, but have the DQue bit set in the control mode page
(mode page 10).  CAM correctly detects that these drives do not
support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
on CCBs sent down to the drives.

This caused the isp(4) driver to go down the path of setting the
tag action to a default value, and for Request Sense commands only,
set the tag action to Head of Queue.

If an IBM tape drive does get a Head of Queue tag, it rejects it with
Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
to a Transport Error, which the driver translates to an Unrecoverable
HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
to get a good response from a REQUEST SENSE to an FC-attached IBM
tape drive with the isp(4) driver.

IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
with 4470 firmware) also have a bug in that sending a command with a
non-simple tag attribute breaks the tape drive's Command Reference
Number (CRN) accounting and causes it to ignore all subsequent
commands because it and the initiator disagree about the next
expected CRN.  The drives do reject the initial command with a head
of queue tag with an Invalid Message Error (0x49,0x00), but after that
they ignore any subsequent commands.  IBM confirmed that it is a bug,
and sent me test firmware that fixes the bug.  However tape drives in
the field will still exhibit the bug until they are upgraded.

Request Sense is not often sent to targets because most errors are
reported automatically through autosense in Fibre Channel and other
modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
an error that would crop up frequently.  But Request Sense is useful on
tape devices to report status information, aside from error reporting.

This problem is less serious without FC-Tape features turned on,
specifically precise delivery of commands (which enables Command
Reference Numbers), enabled on the target and initiator.  Without
FC-Tape features turned on, the target would return an error and
things would continue on.

And it also does not cause problems for targets that do tagged
queueing, because in those cases the isp(4) driver just uses the
tag type that is specified in the CCB, assuming the
CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
tag action if it isn't an ordered or head of queue tag.

sys/dev/isp/isp.c:
        In isp_start(), don't try to send Request Sense commands
        with the Head of Queue tag attribute if the CCB doesn't
        have a valid tag action.  The tag action likely isn't valid
        because the target doesn't support tagged queueing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316086 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299849 (by trasz):
mav [Tue, 28 Mar 2017 10:15:30 +0000 (10:15 +0000)]
MFC r299849 (by trasz):
Remove NULL checks after M_WAITOK allocations from isp(4).

git-svn-id: svn://svn.freebsd.org/base/stable/10@316085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313436,r313437,r313438,r314587,r315687:
ngie [Tue, 28 Mar 2017 06:13:16 +0000 (06:13 +0000)]
MFC r313436,r313437,r313438,r314587,r315687:

r313436:

Clarify #includes for hexdump(3) vs sbuf_hexdump(9)

hexdump(3) only requires libutil.h, whereas sbuf_hexdump(9) requires
sys/types.h (for ssize_t) and sys/sbuf.h

r313437:

Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describes
sbuf_hexdump(9)'s behavior

r313438:

Clean up trailing and leading whitespace for variables to make it
consistent with the rest of the file and style.Makefile(9) a bit
more

r314587:

Correct MLINKS for sbuf_hexdump(9)

sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another
review will be posted to deduplicate the sbuf_hexdump reference in
in hexdump(3) or at the very least make the information less duplicative.

r315687:

Document sbuf_hexdump(9) in just sbuf(9)

- Remove duplicate references to sbuf_hexdump(9) from hexdump(3).
  sbuf_hexdump(9) already pointed back to hexdump(3) for implementation
  details.
- Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness

git-svn-id: svn://svn.freebsd.org/base/stable/10@316074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315686,r315688:
ngie [Tue, 28 Mar 2017 06:05:26 +0000 (06:05 +0000)]
MFC r315686,r315688:

r315686:

kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

r315688:

kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

git-svn-id: svn://svn.freebsd.org/base/stable/10@316072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315647:
ngie [Tue, 28 Mar 2017 05:57:20 +0000 (05:57 +0000)]
MFC r315647:

Handle kd == NULL gracefully with kvm_close(3)

Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return
-1 and set errno to EINVAL.

Document this new behavior explicitly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315871: MFV r315791: ntp 4.2.8p10.
delphij [Tue, 28 Mar 2017 04:48:55 +0000 (04:48 +0000)]
MFC r315871: MFV r315791: ntp 4.2.8p10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316069 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315639:
ngie [Mon, 27 Mar 2017 18:29:30 +0000 (18:29 +0000)]
MFC r315639:

libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers

This is being done to avoid potential double frees with the values.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314245:
ngie [Mon, 27 Mar 2017 18:28:17 +0000 (18:28 +0000)]
MFC r314245:

Fill MK_LIBTHR as far as lib/libthr is concerned

There are other areas of the tree that will need to be evaluated for sanity
if they're supposed to be conditionally compiled out of the build/install,
like libzpool

Relnotes: yes (this might break someone's system if have the knob set)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315641,r315642:
ngie [Mon, 27 Mar 2017 18:26:22 +0000 (18:26 +0000)]
MFC r315641,r315642:

r315641:

bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure

r315642:

bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..)

open_client_* returns -1 on failure; 0 on success. Ensure that the return value is
0 -- otherwise exit snmp_open(..).

git-svn-id: svn://svn.freebsd.org/base/stable/10@316044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315690:
ngie [Mon, 27 Mar 2017 18:24:27 +0000 (18:24 +0000)]
MFC r315690:

Delete trailing whitespace (no functional change)

git-svn-id: svn://svn.freebsd.org/base/stable/10@316042 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315595,r315603:
ngie [Mon, 27 Mar 2017 18:23:45 +0000 (18:23 +0000)]
MFC r315595,r315603:

r315595:

Remove a commented out line before kvm_getprocs(3)

The commented out return value for kvm_getprocs(3) was misleading -- the
uncommented line is correct.

No content change

r315603:

kvm_close(3): return `error` instead of blindly returning `0`

`error` is the accumulated error from previous close(2) calls.

This bug has been present since the libcall's import from 4.4BSD
Lite (r1573).

Noticed by: vangyzen (D10022)
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@316040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 315229: Remove remnant of r315163.
mav [Mon, 27 Mar 2017 08:29:46 +0000 (08:29 +0000)]
MFC 315229: Remove remnant of r315163.

git-svn-id: svn://svn.freebsd.org/base/stable/10@316016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 315529
kp [Sun, 26 Mar 2017 18:12:50 +0000 (18:12 +0000)]
MFC 315529

pf: Fix rule evaluation after inet6 route-to

In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out
of a different interface. pf_test6() needs to know that the packet was
forwarded (in case it needs to refragment so it knows whether to call
ip6_output() or ip6_forward()).

This lead pf_test6() to try to evaluate rules against the PF_FWD
direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT.
Once fwdir is set correctly the correct output/forward function will be
called.

PR:             217883
Submitted by:   Kajetan Staszkiewicz
Sponsored by:   InnoGames GmbH

git-svn-id: svn://svn.freebsd.org/base/stable/10@316000 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315161: Try to slight untangle I/O and loop status handling.
mav [Sun, 26 Mar 2017 08:54:08 +0000 (08:54 +0000)]
MFC r315161: Try to slight untangle I/O and loop status handling.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315980 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315160: Remove code for unsupported FreeBSD versions.
mav [Sun, 26 Mar 2017 08:52:44 +0000 (08:52 +0000)]
MFC r315160: Remove code for unsupported FreeBSD versions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315978 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315163: Remove strange config_intrhook_establish() magic.
mav [Sun, 26 Mar 2017 08:51:22 +0000 (08:51 +0000)]
MFC r315163: Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315976 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315588:
kib [Sun, 26 Mar 2017 01:10:59 +0000 (01:10 +0000)]
MFC r315588:
Update the list of cpudev ioctls which require write access.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315972 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoSynchronize libcxxrt in stable/10 with stable/11.
dim [Sat, 25 Mar 2017 21:46:02 +0000 (21:46 +0000)]
Synchronize libcxxrt in stable/10 with stable/11.

MFC r284553 (by emaste):

Update libcxxrt upgrade instructions

The typeinfo file no longer exists upstream.

MFC r297299:

Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.

MFC r299144:

Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.

Interesting fixes:
3adaa2e Fix _Unwind_Exception cleanup functions
286776c Check exception cleanup function ptr before calling
edda626 Correct exception specifications on new and delete operators

MFC r303157 (by emaste):

libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7271

MFC r305396:

Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
value is used in newer versions of compiler-rt.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315412, r314852:
badger [Sat, 25 Mar 2017 20:14:08 +0000 (20:14 +0000)]
MFC r315412, r314852:

r315412:
    Don't clear p_ptevents on normal SIGKILL delivery

    The ptrace() user has the option of discarding the signal. In such a
    case, p_ptevents should not be modified. If the ptrace() user decides to
    send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
    do not have the capability to discard the signal, so continue to clear
    the mask in that case.

r314852:
    don't stop in issignal() if P_SINGLE_EXIT is set

    Suppose a traced process is stopped in ptracestop() due to receipt of a
    SIGSTOP signal, and is awaiting orders from the tracing process on how
    to handle the signal. Before sending any such orders, the tracing
    process exits. This should kill the traced process. But suppose a second
    thread handles the SIGKILL and proceeds to exit1(), calling
    thread_single(). The first thread will now awaken and will have a chance
    to check once more if it should go to sleep due to the SIGSTOP.  It must
    not sleep after P_SINGLE_EXIT has been set; this would prevent the
    SIGKILL from taking effect, leaving a stopped orphan behind after the
    tracing process dies.

    Also add new tests for this condition.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313992, r314075, r314118, r315484:
badger [Sat, 25 Mar 2017 13:33:23 +0000 (13:33 +0000)]
MFC r313992, r314075, r314118, r315484:

r315484:
    ptrace_test: eliminate assumption about thread scheduling

    A couple of the ptrace tests make assumptions about which thread in a
    multithreaded process will run after a halt. This makes the tests less
    portable across branches, and susceptible to future breakage. Instead,
    twiddle thread scheduling and priorities to match the tests'
    expectation.

r314118:
    Actually fix buildworlds other than i386/amd64/sparc64 after r313992

    Disable offending test for platforms without a userspace visible
    breakpoint().

r314075:
    Fix world build for archs where __builtin_debugtrap() does not work.

    The offending code was introduced in r313992.

r313992:
    Defer ptracestop() signals that cannot be delivered immediately

    When a thread is stopped in ptracestop(), the ptrace(2) user may request
    a signal be delivered upon resumption of the thread. Heretofore, those signals
    were discarded unless ptracestop()'s caller was issignal(). Fix this by
    modifying ptracestop() to queue up signals requested by the ptrace user that
    will be delivered when possible. Take special care when the signal is SIGKILL
    (usually generated from a PT_KILL request); no new stop events should be
    triggered after a PT_KILL.

    Add a number of tests for the new functionality. Several tests were authored
    by jhb.

PR: 212607
Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315745:
dim [Sat, 25 Mar 2017 12:29:15 +0000 (12:29 +0000)]
MFC r315745:

Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:

Author: David Chisnall <theraven@FreeBSD.org>
Date:   Wed Mar 22 12:27:08 2017 +0000

    Simplify some code.

    realloc() with a null pointer is equivalent to malloc, so we don't need
    to handle the two cases independently.

    Fixes #46

This should help with lang/beignet and other programs, which expect
__cxa_demangle(name, NULL, NULL, &status) to return zero in status.

PR: 213732

git-svn-id: svn://svn.freebsd.org/base/stable/10@315943 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315087, r315146:
mav [Sat, 25 Mar 2017 11:48:12 +0000 (11:48 +0000)]
MFC r315087, r315146:
Improve ctl(4) description, including frontends and backends.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315084: Increase device openings to tagged maximum.
mav [Sat, 25 Mar 2017 11:45:19 +0000 (11:45 +0000)]
MFC r315084: Increase device openings to tagged maximum.

Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.

Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315939 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
mav [Sat, 25 Mar 2017 11:36:06 +0000 (11:36 +0000)]
MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.

Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc.  Target mode devices are never configured, but have queues.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315361 and r315364: Hide MONITORX/MWAITX from guests.
grehan [Sat, 25 Mar 2017 05:09:03 +0000 (05:09 +0000)]
MFC  r315361 and  r315364: Hide MONITORX/MWAITX from guests.

r315361
  Add the AMD MONITORX/MWAITX feature definition introduced in
  Bulldozer/Ryzen CPUs.

r315364
  Hide the AMD MONITORX/MWAITX capability.
  Otherwise, recent Linux guests will use these instructions, resulting
  in #UD exceptions since bhyve doesn't implement MONITOR/MWAIT exits.

  This fixes boot-time hangs in recent Linux guests on Ryzen CPUs
  (and probably Bulldozer aka AMD FX as well).

git-svn-id: svn://svn.freebsd.org/base/stable/10@315928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Re-add mutex lock call that was dropped in a previous commit.
erj [Fri, 24 Mar 2017 18:28:48 +0000 (18:28 +0000)]
ixgbe(4): Re-add mutex lock call that was dropped in a previous commit.

PR: 218062
Reported by: Terry Kennedy <terry-freebsd@glaver.org>
Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@315916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoPull in r283944 from upstream libc++ trunk (by Eric Fiselier):
dim [Fri, 24 Mar 2017 18:28:13 +0000 (18:28 +0000)]
Pull in r283944 from upstream libc++ trunk (by Eric Fiselier):

  Fix std::pair on FreeBSD

  Summary:
  FreeBSD ships an old ABI for std::pair which requires that it have
  non-trivial copy/move constructors. Currently the non-trivial
  copy/move is achieved by providing explicit definitions of the
  constructors. This is problematic because it means the constructors
  don't SFINAE properly. In order to SFINAE copy/move constructors they
  have to be explicitly defaulted and hense non-trivial.

  This patch attempts to provide SFINAE'ing copy/move constructors for
  std::pair while still making them non-trivial. It does this by adding
  a base class with a non-trivial copy constructor and then allowing
  pair's constructors to be generated by the compiler. This also allows
  the constructors to be constexpr.

  Reviewers: emaste, theraven, rsmith, dim

  Subscribers: cfe-commits

  Differential Revision: https://reviews.llvm.org/D25389

This should fix building www/chromium 57.0.2987.110 on stable/10 and
stable/9 without having to use -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 (which
changes the ABI).  Direct commit to stable/10 and stable/9, since head
already has libc++ 4.0, which includes this fix.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoSubset of upstream r902 which fixes custom prompts.
des [Fri, 24 Mar 2017 14:40:53 +0000 (14:40 +0000)]
Subset of upstream r902 which fixes custom prompts.

PR: 216172

git-svn-id: svn://svn.freebsd.org/base/stable/10@315907 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r313974,r314596): open .netrc early in case we want to drop privs
des [Fri, 24 Mar 2017 14:26:01 +0000 (14:26 +0000)]
MFH (r313974,r314596): open .netrc early in case we want to drop privs
MFH (r314396,r315143): fix a crash caused by an incorrect format string
MFH (r314701): fix handling of 416 errors when requesting a range
MFH (r315455): fix parsing of IP literals (square brackets)

PR: 212065, 217723

git-svn-id: svn://svn.freebsd.org/base/stable/10@315904 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f