]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMove structures only used by the GICv3 ITS driver from a shared header to
Andrew Turner [Thu, 14 Jul 2016 17:10:54 +0000 (17:10 +0000)]
Move structures only used by the GICv3 ITS driver from a shared header to
the ITS driver file. There is no need for other drivers to need to know
about these structures.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRemove the non-INTRNG support from the GICv3 interrupt controller driver.
Andrew Turner [Thu, 14 Jul 2016 17:05:25 +0000 (17:05 +0000)]
Remove the non-INTRNG support from the GICv3 interrupt controller driver.
This is no longer needed.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRemove support for the arm64 pre-INTRNG interrupt framework from the PCI
Andrew Turner [Thu, 14 Jul 2016 16:52:18 +0000 (16:52 +0000)]
Remove support for the arm64 pre-INTRNG interrupt framework from the PCI
driver. Support for this was removed in r302375.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agomail(1): check for out of memory conditions when calling calloc(3).
Pedro F. Giffuni [Thu, 14 Jul 2016 15:09:08 +0000 (15:09 +0000)]
mail(1): check for out of memory conditions when calling calloc(3).

X-MFC with: r302771

8 years agoIncrease number of I/O APIC pins from 24 to 32 to give PCI up to 16 IRQs.
Alexander Motin [Thu, 14 Jul 2016 14:35:25 +0000 (14:35 +0000)]
Increase number of I/O APIC pins from 24 to 32 to give PCI up to 16 IRQs.

Move HPET to the top of the supported 0-31 range.

Proposed by: jhb@, grehan@

8 years agoDon't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329
Enji Cooper [Thu, 14 Jul 2016 14:16:20 +0000 (14:16 +0000)]
Don't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329

kk_KZ.UTF-8 was originally removed in r290494, but restored as an alias to
en_US.UTF-8 in r302329

MFC after: 1 week
X-MFC with: r302329
PR: 211046
Reported by: dhw, O. Hartman <ohartman@zedat.fu-berlin.de>
Sponsored by: EMC / Isilon Storage Division

8 years agoAlways panic if an invalid capability is passed to `capable(..)` instead of
Enji Cooper [Thu, 14 Jul 2016 13:55:38 +0000 (13:55 +0000)]
Always panic if an invalid capability is passed to `capable(..)` instead of
just with INVARIANTS

rwatson's point was valid in the sense that if the data passed at runtime is
invalid, it should always trip the invariant, not just in the debug case.
This is a deterrent against malicious input, or input caused by hardware
errors.

MFC after: 4 days
X-MFC with: r302577
Requested by: rwatson
Sponsored by: EMC / Isilon Storage Division

8 years agoMFV r302645: 6878 Add scrub completion info to "zpool history"
Andriy Gapon [Thu, 14 Jul 2016 11:53:39 +0000 (11:53 +0000)]
MFV r302645: 6878 Add scrub completion info to "zpool history"

illumos/illumos-gate@1825bc56e5a1f7ef6f0dc3137f3b35f5850c1100
https://github.com/illumos/illumos-gate/commit/1825bc56e5a1f7ef6f0dc3137f3b35f5850c1100

https://www.illumos.org/issues/6878
  Summary of changes:
      * Replace generic "scan done" message with "scan aborted, restarting",
        "scan cancelled", or "scan done"
      * Log number of errors using spa_get_errlog_size
      * Refactor scan restarting check into static function

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Nav Ravindranath <nav@delphix.com>
MFC after: 2 weeks

8 years agoMFV r302650: 6940 Cannot unlink directories when over quota
Andriy Gapon [Thu, 14 Jul 2016 11:51:01 +0000 (11:51 +0000)]
MFV r302650: 6940 Cannot unlink directories when over quota

illumos/illumos-gate@99189164df06057fb968ca7be701bb1a0d5da8c9
https://github.com/illumos/illumos-gate/commit/99189164df06057fb968ca7be701bb1a0d5da8c9

https://www.illumos.org/issues/6940
  Similar to #6334, but this time with empty directories:
  $ zfs create tank/quota
  $ zfs set quota=10M tank/quota
  $ zfs snapshot tank/quota@snap1
  $ zfs set mountpoint=/mnt/tank/quota tank/quota
  $ mkdir /mnt/tank/quota/dir # create an empty directory
  $ mkfile 11M /mnt/tank/quota/11M
  /mnt/tank/quota/11M: initialized 9830400 of 11534336 bytes: Disc quota exceeded
  $ rmdir /mnt/tank/quota/dir # now unlink the empty directory
  rmdir: directory "/mnt/tank/quota/dir": Disc quota exceeded
  From user perspective, I would expect that ZFS is always able to remove files
  and directories even when the quota is exceeded.

Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Simon Klinkert <simon.klinkert@gmail.com>
MFC after: 2 weeks

8 years agoMFV r302644: 6513 partially filled holes lose birth time
Andriy Gapon [Thu, 14 Jul 2016 11:48:42 +0000 (11:48 +0000)]
MFV r302644: 6513 partially filled holes lose birth time

illumos/illumos-gate@8df0bcf0df7622a075cc6e52f659d2fcfdd08cdc
https://github.com/illumos/illumos-gate/commit/8df0bcf0df7622a075cc6e52f659d2fcfdd08cdc

https://www.illumos.org/issues/6513
  If a ZFS object contains a hole at level one, and then a data block is created
  at level 0 underneath that l1 block, l0 holes will be created. However, these
  l0 holes do not have the birth time property set; as a result, incremental
  sends will not send those holes.
  Fix is to modify the dbuf_read code to fill in birth time data.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Boris Protopopov <bprotopopov@hotmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>
MFC after: 3 weeks

8 years agoMFV r302641: 6844 dnode_next_offset can detect fictional holes
Andriy Gapon [Thu, 14 Jul 2016 11:42:53 +0000 (11:42 +0000)]
MFV r302641: 6844 dnode_next_offset can detect fictional holes

illumos/illumos-gate@11ceac77ea8034bf2fe9bdd6d314f5d1e5ceeba3
https://github.com/illumos/illumos-gate/commit/11ceac77ea8034bf2fe9bdd6d314f5d1e5ceeba3

https://www.illumos.org/issues/6844
  dnode_next_offset is used in a variety of places to iterate over the holes or
  allocated blocks in a dnode. It operates under the premise that it can iterate
  over the blockpointers of a dnode in open context while holding only the
  dn_struct_rwlock as reader. Unfortunately, this premise does not hold.
  When we create the zio for a dbuf, we pass in the actual block pointer in the
  indirect block above that dbuf. When we later zero the bp in
  zio_write_compress, we are directly modifying the bp. The state of the bp is
  now inconsistent from the perspective of dnode_next_offset: the bp will appear
  to be a hole until zio_dva_allocate finally finishes filling it in. In the
  meantime, dnode_next_offset can detect a hole in the dnode when none exists.
  I was able to experimentally demonstrate this behavior with the following
  setup:
  1. Create a file with 1 million dbufs.
  2. Create a thread that randomly dirties L2 blocks by writing to the first L0
  block under them.
  3. Observe dnode_next_offset, waiting for it to skip over a hole in the middle
  of a file.
  4. Do dnode_next_offset in a loop until we skip over such a non-existent hole.
  The fix is to ensure that it is valid to iterate over the indirect blocks in a
  dnode while holding the dn_struct_rwlock by passing the zio a copy of the BP
  and updating the actual BP in dbuf_write_ready while holding the lock.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Boris Protopopov <bprotopopov@hotmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alex Reece <alex@delphix.com>
MFC after: 3 weeks

8 years agoMFV r302640: 6874 rollback and receive need to reset ZPL state to what's on disk
Andriy Gapon [Thu, 14 Jul 2016 11:39:36 +0000 (11:39 +0000)]
MFV r302640: 6874 rollback and receive need to reset ZPL state to what's on disk

illumos/illumos-gate@1fdcbd00c9cbac286b5f92e08877e8cb3c448420
https://github.com/illumos/illumos-gate/commit/1fdcbd00c9cbac286b5f92e08877e8cb3c448420

https://www.illumos.org/issues/6874
  When we do a clone swap (caused by "zfs rollback" or "zfs receive"), the ZPL
  doesn't completely reload the state from the DMU; some values remain cached in
  the zfsvfs_t.
  steps to reproduce:
  ```
  #!/bin/bash -x
  zfs destroy -R test/fs
  zfs destroy -R test/recvd
  zfs create test/fs
  zfs snapshot test/fs@a
  zfs set userquota@$USER=1m test/fs
  zfs snapshot test/fs@b
  zfs send test/fs@a | zfs recv test/recvd
  zfs send -i @a test/fs@b | zfs recv test/recvd
  zfs userspace test/recvd
     1. should show 1m quota
        dd if=/dev/urandom of=/test/recvd/file bs=1k count=1024
        sync
        dd if=/dev/urandom of=/test/recvd/file2 bs=1k count=1024
     2. should fail with ENOSPC
        sync
        zfs unmount test/recvd
        zfs mount test/recvd
        zfs userspace test/recvd
     3. if bug above, now shows 1m quota
        dd if=/dev/urandom of=/test/recvd/file3 bs=1k count=1024
     4. if bug above, now fails with ENOSPC
  ```

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 3 weeks

8 years agoremove a stray change from r302834
Andriy Gapon [Thu, 14 Jul 2016 11:13:26 +0000 (11:13 +0000)]
remove a stray change from r302834

MFC after: 3 weeks
X-MFC with: r302834

8 years agofix-up for configuration of AMD Family 10h processors borrowed from Linux
Andriy Gapon [Thu, 14 Jul 2016 11:03:05 +0000 (11:03 +0000)]
fix-up for configuration of AMD Family 10h processors borrowed from Linux

http://lxr.free-electrons.com/source/arch/x86/kernel/cpu/amd.c#L643
BIOS may configure Family 10h processors to convert WC+ cache type
to CD.  That can hurt performance of guest VMs using nested paging.

Reviewed by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D6059

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:47:49 +0000 (09:47 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:45:07 +0000 (09:45 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years agoTo mimic system glob, we definitely don't need manual upper/lower hack.
Andrey A. Chernov [Thu, 14 Jul 2016 09:40:42 +0000 (09:40 +0000)]
To mimic system glob, we definitely don't need manual upper/lower hack.
The author clearly disagree in the comment, so this patch will be not
submitted upstream.

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:37:16 +0000 (09:37 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:34:42 +0000 (09:34 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:31:52 +0000 (09:31 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years agoOptimize [Cc]flag case: don't repeatedly add the last character of
Andrey A. Chernov [Thu, 14 Jul 2016 09:26:53 +0000 (09:26 +0000)]
Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.

8 years agoDocument incomplete support of [=equiv=] and collation for ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 09:24:55 +0000 (09:24 +0000)]
Document incomplete support of [=equiv=] and collation for ranges.

8 years agoBack out non-collating [a-z] ranges (r302594).
Andrey A. Chernov [Thu, 14 Jul 2016 09:19:53 +0000 (09:19 +0000)]
Back out non-collating [a-z] ranges (r302594).
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.

8 years ago1) Eliminate possibility to call __*collate_range_cmp() with inclomplete
Andrey A. Chernov [Thu, 14 Jul 2016 09:07:25 +0000 (09:07 +0000)]
1) Eliminate possibility to call __*collate_range_cmp() with inclomplete
locale (which cause core dump) by removing whole 'table' argument
by which it passed.

2) Restore __collate_range_cmp() in __sccl().

3) Collating [a-z] range in regcomp() only for single bytes locales
(we can't do it now for other ones). In previous state only first 256
wchars are considered and all others are just silently dropped from the
range.

8 years agohyperv/vmbus: Move bus related message processing into vmbus.
Sepherosa Ziehau [Thu, 14 Jul 2016 08:40:59 +0000 (08:40 +0000)]
hyperv/vmbus: Move bus related message processing into vmbus.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7125

8 years agoBack out non-collating [a-z] ranges.
Andrey A. Chernov [Thu, 14 Jul 2016 08:18:12 +0000 (08:18 +0000)]
Back out non-collating [a-z] ranges.
Instead of changing whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and concentrace on fixing bugs in what we have now,
too many small obstacles instead, counting ports.

8 years agohyperv/vmbus: Sub-channel related fields renaming
Sepherosa Ziehau [Thu, 14 Jul 2016 08:15:13 +0000 (08:15 +0000)]
hyperv/vmbus: Sub-channel related fields renaming

And reorganize comment.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7113

8 years agohyperv/vmbus: Fix the racy channel close.
Sepherosa Ziehau [Thu, 14 Jul 2016 07:59:01 +0000 (07:59 +0000)]
hyperv/vmbus: Fix the racy channel close.

It is not safe to iterate the sub-channel list w/o lock on the
close path, while it's even more difficult to hold the lock
and iterate the sub-channel list.  We leverage the
vmbua_{get,rel}_subchan() functions to solve this dilemma.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7112

8 years agohyperv/vmbus: Field renaming to reflect reality
Sepherosa Ziehau [Thu, 14 Jul 2016 07:48:26 +0000 (07:48 +0000)]
hyperv/vmbus: Field renaming to reflect reality

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7111

8 years agohyperv/vmbus: Release vmbus channel lock before detach devices
Sepherosa Ziehau [Thu, 14 Jul 2016 07:39:34 +0000 (07:39 +0000)]
hyperv/vmbus: Release vmbus channel lock before detach devices

Device detach method may sleep.

While I'm here, rename the function, fix indentation and function
comment.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7110

8 years agohyperv/vmbus: Only add primary channels to vmbus channel list
Sepherosa Ziehau [Thu, 14 Jul 2016 07:31:43 +0000 (07:31 +0000)]
hyperv/vmbus: Only add primary channels to vmbus channel list

- Make the vmbus_chan_add more straightforward.
- Partially fix the hv_vmbus_release_unattached_channels().

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7109

8 years agohyperv/vmbus: Use sub-channel index to detect primary channel
Sepherosa Ziehau [Thu, 14 Jul 2016 07:24:03 +0000 (07:24 +0000)]
hyperv/vmbus: Use sub-channel index to detect primary channel

In case that VMBUS_CHAN_ISPRIMARY is needed in the early place of
channel setup.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7108

8 years agohyperv/vmbus: Cleanup vmbus_chan_add()
Sepherosa Ziehau [Thu, 14 Jul 2016 07:08:59 +0000 (07:08 +0000)]
hyperv/vmbus: Cleanup vmbus_chan_add()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7106

8 years agohyperv/vmbus: Nuke the channel open state.
Sepherosa Ziehau [Thu, 14 Jul 2016 06:59:04 +0000 (06:59 +0000)]
hyperv/vmbus: Nuke the channel open state.

Channel is either opened or not-opened.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7105

8 years agohyperv/vmbus: Cleanup vmbus_chan_msgproc_choffer
Sepherosa Ziehau [Thu, 14 Jul 2016 06:48:24 +0000 (06:48 +0000)]
hyperv/vmbus: Cleanup vmbus_chan_msgproc_choffer

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7104

8 years agohyperv/vmbus: Move new channel scan notification to device register
Sepherosa Ziehau [Thu, 14 Jul 2016 06:40:42 +0000 (06:40 +0000)]
hyperv/vmbus: Move new channel scan notification to device register

And nuke now unnecessary function indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7103

8 years agohyperv/vmbus: Move device register and channel free to the caller.
Sepherosa Ziehau [Thu, 14 Jul 2016 06:29:12 +0000 (06:29 +0000)]
hyperv/vmbus: Move device register and channel free to the caller.

This paves the way for more cleanup/disentangle.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7102

8 years agohyperv/vmbus: Alloc/Free monitor param in vmbus channel alloc/free.
Sepherosa Ziehau [Thu, 14 Jul 2016 06:18:11 +0000 (06:18 +0000)]
hyperv/vmbus: Alloc/Free monitor param in vmbus channel alloc/free.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7101

8 years agoInitialize first_serial to 0 in dozonetransfer(..) to fix -Wuninitialized
Enji Cooper [Thu, 14 Jul 2016 06:10:16 +0000 (06:10 +0000)]
Initialize first_serial to 0 in dozonetransfer(..) to fix -Wuninitialized
warning

MFC after: 3 days
X-MFC with: r302779
Pointyhat to: des
PR: 209177
Reported by: Jenkins (sparc64 job), gcc 4.2.1, gcc 5.3.0
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/vmbus: Get rid of rel{_id,id}, use channel id consistently.
Sepherosa Ziehau [Thu, 14 Jul 2016 06:10:00 +0000 (06:10 +0000)]
hyperv/vmbus: Get rid of rel{_id,id}, use channel id consistently.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7100

8 years agohyperv/vmbus: Remove unused bits
Sepherosa Ziehau [Thu, 14 Jul 2016 06:00:40 +0000 (06:00 +0000)]
hyperv/vmbus: Remove unused bits

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7095

8 years agohyperv/vmbus: Switch to vmbus channel message macros
Sepherosa Ziehau [Thu, 14 Jul 2016 05:49:14 +0000 (05:49 +0000)]
hyperv/vmbus: Switch to vmbus channel message macros

Prepare for more cleanup.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7094

8 years agohyperv/vmbus: Move channel offer message definition to vmbus_reg.h
Sepherosa Ziehau [Thu, 14 Jul 2016 05:33:33 +0000 (05:33 +0000)]
hyperv/vmbus: Move channel offer message definition to vmbus_reg.h

- Avoid bit fields.
- Avoid unnecessary indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7093

8 years agohyperv: hv_guid -> struct hyperv_guid.
Sepherosa Ziehau [Thu, 14 Jul 2016 05:25:31 +0000 (05:25 +0000)]
hyperv: hv_guid -> struct hyperv_guid.

This paves way for the further cleanup/disentangle.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7092

8 years agohyperv/vmbus: Remove unused bits
Sepherosa Ziehau [Thu, 14 Jul 2016 05:14:12 +0000 (05:14 +0000)]
hyperv/vmbus: Remove unused bits

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7091

8 years agomail(1): Bring some fixes from other BSDs.
Pedro F. Giffuni [Thu, 14 Jul 2016 02:25:29 +0000 (02:25 +0000)]
mail(1): Bring some fixes from other BSDs.

Fix missing forked job changes from r302776 in wait_child().

Obtained from: NetBSD

8 years agoRestore lost comment from r301295.
Cy Schubert [Thu, 14 Jul 2016 01:16:07 +0000 (01:16 +0000)]
Restore lost comment from r301295.

PR: 211027
Reported by: Trond.Endrestol@ximalas.info
Pointy hat to: cy@ (me)
MFC after: 3 days

8 years agoDocument DDB's "alltrace" and "show all trace" commands.
Mark Johnston [Thu, 14 Jul 2016 00:42:27 +0000 (00:42 +0000)]
Document DDB's "alltrace" and "show all trace" commands.

MFC after: 3 days

8 years agoRemove more references to mroute6d, which was removed in r298512.
Mark Johnston [Thu, 14 Jul 2016 00:41:37 +0000 (00:41 +0000)]
Remove more references to mroute6d, which was removed in r298512.

8 years agoMake the new 'set date and time' dialog default to skip
Allan Jude [Thu, 14 Jul 2016 00:41:19 +0000 (00:41 +0000)]
Make the new 'set date and time' dialog default to skip

X-MFC-With: 302790
Requested by: nwhitehorn

8 years agoMove some gmirror metadata update messages to a higher debug level.
Mark Johnston [Thu, 14 Jul 2016 00:40:24 +0000 (00:40 +0000)]
Move some gmirror metadata update messages to a higher debug level.

These can be printed quite frequently from a mostly-idle mirror, cluttering
the console.

MFC after: 1 week

8 years agoAllow ACPI wakeup code and page tables to be stored in non-contiguous pages.
Mark Johnston [Thu, 14 Jul 2016 00:38:04 +0000 (00:38 +0000)]
Allow ACPI wakeup code and page tables to be stored in non-contiguous pages.

Since these pages are allocated from a narrow range of memory, this makes
the allocation more likely to succeed.

Suggested by: kib
Reviewed by: jkim, kib
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D7154

8 years agoRemove gcore's -s option.
Mark Johnston [Thu, 14 Jul 2016 00:32:27 +0000 (00:32 +0000)]
Remove gcore's -s option.

It has no effect and is always implicitly set since ptrace(2) stops the
target process.

8 years agobsdinstall: Prompt user to set the date and time after selecting timezone
Allan Jude [Wed, 13 Jul 2016 23:49:45 +0000 (23:49 +0000)]
bsdinstall: Prompt user to set the date and time after selecting timezone

Not having the correct date and time makes many PKI based things not work

In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start

Submitted by: des (original patch)
MFC after: 7 days

8 years agoAdd memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.
Andrew Turner [Wed, 13 Jul 2016 23:03:34 +0000 (23:03 +0000)]
Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.

Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoFix the type used to hold the value returned from getopt. On arm64 char is
Andrew Turner [Wed, 13 Jul 2016 22:53:30 +0000 (22:53 +0000)]
Fix the type used to hold the value returned from getopt. On arm64 char is
unsigned so will never be -1.

Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agozpool(8): update Hot Spares section to mention zfsd(8)
Eric van Gyzen [Wed, 13 Jul 2016 21:27:10 +0000 (21:27 +0000)]
zpool(8): update Hot Spares section to mention zfsd(8)

Reviewed and reworded by: asomers
MFC after: 3 days
Sponsored by: Dell Inc.

8 years agoAllwinner Gigabit EMAC performance improvements.
Jared McNeill [Wed, 13 Jul 2016 20:46:54 +0000 (20:46 +0000)]
Allwinner Gigabit EMAC performance improvements.

 - Support DEVICE_POLLING
 - Increase TX descriptors to 1024
 - Add support for passing a chain of mbufs to if_input, reducing the
   number of calls to mtx_unlock/mtx_lock under load.
 - Remove duplicate byteswap when setting TX_INT_CTL in TX descriptor.
 - Set undocumented "TX_NEXT_FRAME" bit in TX control 1 register.
   According to the A83T BSP, setting this bit allows the DMA engine to
   operate on a packet while receiving another.

Tested on A83T (1000Mbps PHY) and H3 (100Mbps PHY).

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D7031

8 years agoH3/A83T: Use PLL_PERIPH/2 for AHB2 parent clock.
Jared McNeill [Wed, 13 Jul 2016 20:44:02 +0000 (20:44 +0000)]
H3/A83T: Use PLL_PERIPH/2 for AHB2 parent clock.

Reviewed by: manu

8 years agoFix a page fault in ip6_setpktopt(), occurring when the pflog module is
Dimitry Andric [Wed, 13 Jul 2016 19:41:19 +0000 (19:41 +0000)]
Fix a page fault in ip6_setpktopt(), occurring when the pflog module is
loaded, and syncthing is started, which uses setsockopt(IPV6_PKGINFO).

This is because pflog interfaces do not normally have an IPv6 address,
causing the ND_IFINFO() macro to dereference a NULL pointer.

Reviewed by: ae
PR: 210943
MFC after: 3 days

8 years agoAdd explicit detection of KVM hypervisor
Eric Badger [Wed, 13 Jul 2016 19:19:18 +0000 (19:19 +0000)]
Add explicit detection of KVM hypervisor

Set vm_guest to a new enum value (VM_GUEST_KVM) when kvm is detected and use
vm_guest in conditionals testing for KVM.

Also, fix a conditional checking if we're running in a VM which caught only
the generic VM case, but not more specific VMs (KVM, VMWare, etc.).  (Spotted
by: vangyzen).

Differential revision: https://reviews.freebsd.org/D7172
Sponsored by: Dell Inc.
Approved by: kib (mentor), vangyzen (mentor)
Reviewed by: alc
MFC after: 4 weeks

8 years agoRemove a tunable and always reset system clock while resuming with ACPI.
Jung-uk Kim [Wed, 13 Jul 2016 19:16:32 +0000 (19:16 +0000)]
Remove a tunable and always reset system clock while resuming with ACPI.

Requested by: bde (long ago)

8 years agoAfter removing collation for [a-z] ranges in r302512, do it here too.
Andrey A. Chernov [Wed, 13 Jul 2016 19:02:59 +0000 (19:02 +0000)]
After removing collation for [a-z] ranges in r302512, do it here too.

Instead of trying to expand whole range at regcomp() stage as we do,
GNU regex allocates separate ranges [start,end] set each character
is checked against, so collation is possible and turned on for ranges here.

When something like that will be implemented or our obsoleted regex code
will be replaced to something like TRE, and in case we decide to use
collation in [a-z] ranges, all changes related to r302512 can be backed out,
but now we need consistency.

8 years agoAfter removing collation for [a-z] ranges in r302512, do it here too.
Andrey A. Chernov [Wed, 13 Jul 2016 18:51:19 +0000 (18:51 +0000)]
After removing collation for [a-z] ranges in r302512, do it here too.

Instead of trying to expand whole range at regcomp() stage as we do,
GNU regex allocates separate ranges [start,end] set each character
is checked against, so collation is possible and turned on for ranges here.

When something like that will be implemented or our obsoleted regex code
will be replaced to something like TRE, and in case we decide to use
collation in [a-z] ranges, all changes related to r302512 can be backed out,
but now we need consistency.

8 years agomerge upstream hg 06347b1f76fe (fix IXFR)
Dag-Erling Smørgrav [Wed, 13 Jul 2016 18:26:05 +0000 (18:26 +0000)]
merge upstream hg 06347b1f76fe (fix IXFR)

PR: 209177
MFC after: 3 days

8 years agopw should sanitize the argument of -w.
Alan Somers [Wed, 13 Jul 2016 17:09:20 +0000 (17:09 +0000)]
pw should sanitize the argument of -w.

Otherwise, it will silently disable the login for the selected account if
the argument is unrecognizable.

usr.sbin/pw/pw.h
usr.sbin/pw/pw_conf.c
usr.sbin/pw/pw_user.c
Use separate rules to validate boolean parameters and passwd
parameters.  Error out if a password parameter cannot be parsed.

usr.sbin/pw/tests/Makefile
usr.sbin/pw/tests/crypt.c
usr.sbin/pw/tests/pw_useradd.sh
usr.sbin/pw/tests/pw_usermod.sh
Add tests for the validation.  Also, enhance existing
password-related tests to actually validate that the correct hash is
written to master.passwd.

Reviewed by: bapt
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6840

8 years agoAfter removing collation for [a-z] ranges in r302512, mimic system
Andrey A. Chernov [Wed, 13 Jul 2016 16:49:48 +0000 (16:49 +0000)]
After removing collation for [a-z] ranges in r302512, mimic system
glob() here too.

I try to keep the change minimal to not touch contribed code much.
I'll send it upstream when it will be merged to the main branches,
but we need this change now here.

8 years agomail(1): Bring some fixes from other BSDs.
Pedro F. Giffuni [Wed, 13 Jul 2016 16:45:26 +0000 (16:45 +0000)]
mail(1): Bring some fixes from other BSDs.

- Use varargs properly
- Use pid_t
- Better handling of error conditions on forked jobs.
- Some prototype and warning cleanups.

Obtained from: NetBSD (some originaly from OpenBSD)

8 years agore-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of snapshot's root
Andriy Gapon [Wed, 13 Jul 2016 15:16:51 +0000 (15:16 +0000)]
re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of snapshot's root

The change has been undone in r301275 on the assumption that it was no
longer required.  But that was incorrect, because in this case (and only
in this case) the snapshot root vnode is looked up before z_parent is
fixed up.

MFC after: 5 days

8 years agomail(1): check for out of memory conditions when calling calloc(3).
Pedro F. Giffuni [Wed, 13 Jul 2016 14:59:17 +0000 (14:59 +0000)]
mail(1): check for out of memory conditions when calling calloc(3).

Suggested by: oshogbo
MFC after: 3 days

8 years agoTrace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
Konstantin Belousov [Wed, 13 Jul 2016 14:37:58 +0000 (14:37 +0000)]
Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.

Reviewed by: jhb
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7158

8 years agoAfter removing collation for [a-z] ranges in r302512, do it here too.
Andrey A. Chernov [Wed, 13 Jul 2016 10:01:31 +0000 (10:01 +0000)]
After removing collation for [a-z] ranges in r302512, do it here too.

I'll try to keep the change very minimal to not touch contribed code much.
I'll send it upstream when it will be merged to main branches,
but we need the change right now here.

8 years agohyperv/vmbus: Cleanup channel rescind
Sepherosa Ziehau [Wed, 13 Jul 2016 09:44:24 +0000 (09:44 +0000)]
hyperv/vmbus: Cleanup channel rescind

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7090

8 years agohyperv/vmbus: Remove unused code
Sepherosa Ziehau [Wed, 13 Jul 2016 09:36:46 +0000 (09:36 +0000)]
hyperv/vmbus: Remove unused code

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7089

8 years agohyperv/vmbus: Reorganize MNF event sending.
Sepherosa Ziehau [Wed, 13 Jul 2016 09:28:46 +0000 (09:28 +0000)]
hyperv/vmbus: Reorganize MNF event sending.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7088

8 years agohyperv: Signal event input parameter is shared w/ MNF
Sepherosa Ziehau [Wed, 13 Jul 2016 09:19:33 +0000 (09:19 +0000)]
hyperv: Signal event input parameter is shared w/ MNF

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7087

8 years agohyperv: All Hypercall parameters have same alignment requirement.
Sepherosa Ziehau [Wed, 13 Jul 2016 09:11:03 +0000 (09:11 +0000)]
hyperv: All Hypercall parameters have same alignment requirement.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7086

8 years agohyperv/vmbus: Install different task function for batch/non-batch channels
Sepherosa Ziehau [Wed, 13 Jul 2016 08:30:14 +0000 (08:30 +0000)]
hyperv/vmbus: Install different task function for batch/non-batch channels

This avoids bunch of unnecessary checks on hot path and simplifies the
channel processing.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7085

8 years agoAfter removing collation for [a-z] ranges in r302512, do it here too.
Andrey A. Chernov [Wed, 13 Jul 2016 08:13:09 +0000 (08:13 +0000)]
After removing collation for [a-z] ranges in r302512, do it here too.

Approved by:    jilles

8 years agoFully back out r302594 case 2) since overflow may happens.
Andrey A. Chernov [Wed, 13 Jul 2016 07:56:01 +0000 (07:56 +0000)]
Fully back out r302594 case 2) since overflow may happens.

8 years agohyperv/vmbus: Remove unnecessary callback check.
Sepherosa Ziehau [Wed, 13 Jul 2016 06:55:21 +0000 (06:55 +0000)]
hyperv/vmbus: Remove unnecessary callback check.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7046

8 years agohyperv/vmbus: Pack bool field into flags field
Sepherosa Ziehau [Wed, 13 Jul 2016 06:46:29 +0000 (06:46 +0000)]
hyperv/vmbus: Pack bool field into flags field

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7038

8 years agohyperv/bufring: Remove unused fields
Sepherosa Ziehau [Wed, 13 Jul 2016 06:39:04 +0000 (06:39 +0000)]
hyperv/bufring: Remove unused fields

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7037

8 years agohyperv/vmbus: Nuke unused field from hv_vmbus_channel.
Sepherosa Ziehau [Wed, 13 Jul 2016 06:30:33 +0000 (06:30 +0000)]
hyperv/vmbus: Nuke unused field from hv_vmbus_channel.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7036

8 years agohyperv: Get rid of hv_device, which is unnecessary indirection.
Sepherosa Ziehau [Wed, 13 Jul 2016 06:17:15 +0000 (06:17 +0000)]
hyperv: Get rid of hv_device, which is unnecessary indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7034

8 years agohyperv/hn: Avoid the hv_device
Sepherosa Ziehau [Wed, 13 Jul 2016 05:58:46 +0000 (05:58 +0000)]
hyperv/hn: Avoid the hv_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7033

8 years agohyperv/vmbus: Deprecate the usage of hv_device.
Sepherosa Ziehau [Wed, 13 Jul 2016 05:47:09 +0000 (05:47 +0000)]
hyperv/vmbus: Deprecate the usage of hv_device.

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7032

8 years agohyperv/util: Avoid the hv_device
Sepherosa Ziehau [Wed, 13 Jul 2016 05:35:28 +0000 (05:35 +0000)]
hyperv/util: Avoid the hv_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7028

8 years agohyperv/stor: Avoid the hv_device and nuke the broken get_stor_device
Sepherosa Ziehau [Wed, 13 Jul 2016 05:28:07 +0000 (05:28 +0000)]
hyperv/stor: Avoid the hv_device and nuke the broken get_stor_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7027

8 years agohyperv/vmbus: Add channel ivar accessor.
Sepherosa Ziehau [Wed, 13 Jul 2016 05:19:45 +0000 (05:19 +0000)]
hyperv/vmbus: Add channel ivar accessor.

This makes life easier during the transition period to nuke the hv_device.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7026

8 years agohyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar
Sepherosa Ziehau [Wed, 13 Jul 2016 05:11:45 +0000 (05:11 +0000)]
hyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7025

8 years agohyperv/vmbus: Add vmbus method for GUID base device probing.
Sepherosa Ziehau [Wed, 13 Jul 2016 05:01:12 +0000 (05:01 +0000)]
hyperv/vmbus: Add vmbus method for GUID base device probing.

Reduce the exposure of hv_device.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7024

8 years agohyperv/vmbus: Remove the embedded offer message from hv_vmbus_channel
Sepherosa Ziehau [Wed, 13 Jul 2016 04:51:37 +0000 (04:51 +0000)]
hyperv/vmbus: Remove the embedded offer message from hv_vmbus_channel

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7021

8 years agohyperv/vmbus: Add type/instance guid fields into hv_vmbus_channel
Sepherosa Ziehau [Wed, 13 Jul 2016 04:39:16 +0000 (04:39 +0000)]
hyperv/vmbus: Add type/instance guid fields into hv_vmbus_channel

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7020

8 years agohyperv/vmbus: Add flags field into hv_vmbus_channel for MNF indication
Sepherosa Ziehau [Wed, 13 Jul 2016 04:31:08 +0000 (04:31 +0000)]
hyperv/vmbus: Add flags field into hv_vmbus_channel for MNF indication

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7019

8 years agohyperv/vmbus: Make subchan index a field of hv_vmbus_channel.
Sepherosa Ziehau [Wed, 13 Jul 2016 03:35:22 +0000 (03:35 +0000)]
hyperv/vmbus: Make subchan index a field of hv_vmbus_channel.

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7015

8 years agohyperv/vmbus: Make channel id a field of hv_vmbus_channel.
Sepherosa Ziehau [Wed, 13 Jul 2016 03:24:29 +0000 (03:24 +0000)]
hyperv/vmbus: Make channel id a field of hv_vmbus_channel.

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7014

8 years agohyperv/vmbus: Merge hv_connection.c into hv_channel.c
Sepherosa Ziehau [Wed, 13 Jul 2016 03:14:29 +0000 (03:14 +0000)]
hyperv/vmbus: Merge hv_connection.c into hv_channel.c

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7004

8 years agoReduce the set of things on the disc1 image to those on the bootonly image.
Nathan Whitehorn [Wed, 13 Jul 2016 02:07:36 +0000 (02:07 +0000)]
Reduce the set of things on the disc1 image to those on the bootonly image.
Notably, this removes the toolchain from the CD-ROM image (it remains on DVD
images) and pushes the CD-ROM image well below the 700 MB mark.

MFC after: 10 days

8 years agoRevert r302670 and r302671 for now.
Bryan Drewery [Wed, 13 Jul 2016 01:35:53 +0000 (01:35 +0000)]
Revert r302670 and r302671 for now.

MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.