]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agohyperv/vmbus: Function rename
Sepherosa Ziehau [Fri, 15 Jul 2016 07:16:46 +0000 (07:16 +0000)]
hyperv/vmbus: Function rename

And reorder the error prone parameters list.

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

8 years agohyperv/vmbus: Cleanup channel sending
Sepherosa Ziehau [Fri, 15 Jul 2016 07:07:17 +0000 (07:07 +0000)]
hyperv/vmbus: Cleanup channel sending

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

8 years agohyperv/vmbus: Move channel packet types definition to vmbus.h
Sepherosa Ziehau [Fri, 15 Jul 2016 06:58:21 +0000 (06:58 +0000)]
hyperv/vmbus: Move channel packet types definition to vmbus.h

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

8 years agohyperv/vmbus: Move channel packet flags definition to vmbus.h
Sepherosa Ziehau [Fri, 15 Jul 2016 06:49:45 +0000 (06:49 +0000)]
hyperv/vmbus: Move channel packet flags definition to vmbus.h

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

8 years agohyeprv/vmbus: Rework prplist sending.
Sepherosa Ziehau [Fri, 15 Jul 2016 06:40:59 +0000 (06:40 +0000)]
hyeprv/vmbus: Rework prplist sending.

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

8 years ago[ath] [ath_hal] break out the duration calculation to optionally include SIFS.
Adrian Chadd [Fri, 15 Jul 2016 06:39:35 +0000 (06:39 +0000)]
[ath] [ath_hal] break out the duration calculation to optionally include SIFS.

The pre-11n calculations include SIFS, but the 11n ones don't.

The reason is that (mostly) the 11n hardware is doing the SIFS calculation
for us but the pre-11n hardware isn't.  This means that we're over-shooting
the times in the duration field for non-11n frames on 11n hardware, which
is OK, if not a little inefficient.

Now, this is all fine for what the hardware needs for doing duration math
for ACK, RTS/CTS, frame length, etc, but it isn't useful for doing PHY
duration calculations.  Ie, given a frame to TX and its timestamp, what
would the end of the actual transmission time be; and similar for an
RX timestamp and figuring out its original length.

So, this adds a new field to the duration routines which requests
SIFS or no SIFS to be included.  All the callers currently will call
it requesting SIFS, so this /should/ be a glorious no-op.  I'm however
planning some future work around airtime fairness and positioning which
requires these routines to have SIFS be optional.

Notably though, the 11n version doesn't do any SIFS addition at the moment.
I'll go and tweak and verify all of the packet durations before I go and
flip that part on.

Tested:

* AR9330, STA mode
* AR9330, AP mode
* AR9380, STA mode

8 years agohyperv/vmbus: Rework sglist sending.
Sepherosa Ziehau [Fri, 15 Jul 2016 06:29:19 +0000 (06:29 +0000)]
hyperv/vmbus: Rework sglist sending.

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

8 years agohyperv/vmbus: Redefine channel packet.
Sepherosa Ziehau [Fri, 15 Jul 2016 06:16:39 +0000 (06:16 +0000)]
hyperv/vmbus: Redefine channel packet.

The channel packet header will be shared w/ PRP (physical region page)
list channel packet and SG (scatter gather) list channel packet.

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

8 years agohyperv/vmbus: Field rename
Sepherosa Ziehau [Fri, 15 Jul 2016 06:08:48 +0000 (06:08 +0000)]
hyperv/vmbus: Field rename

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

8 years agohyperv/vmbus: Set vcpuid to 0, if MSR_HV_VP_INDEX does not exist.
Sepherosa Ziehau [Fri, 15 Jul 2016 05:59:27 +0000 (05:59 +0000)]
hyperv/vmbus: Set vcpuid to 0, if MSR_HV_VP_INDEX does not exist.

Mainly for compatibility.  While I'm here, rename cpuid related
fields in hv_vmbus_channel.

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

8 years agohyperv/vmbus: Busdma-fy channel bufring.
Sepherosa Ziehau [Fri, 15 Jul 2016 05:51:58 +0000 (05:51 +0000)]
hyperv/vmbus: Busdma-fy channel bufring.

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

8 years agohyperv/vmbus: Add vmbus_chan_gpadl_connect, which takes GPA physaddr
Sepherosa Ziehau [Fri, 15 Jul 2016 05:40:34 +0000 (05:40 +0000)]
hyperv/vmbus: Add vmbus_chan_gpadl_connect, which takes GPA physaddr

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

8 years agohyperv/vmbus: Use iovec for bufring scatter/gather list.
Sepherosa Ziehau [Fri, 15 Jul 2016 05:29:04 +0000 (05:29 +0000)]
hyperv/vmbus: Use iovec for bufring scatter/gather list.

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

8 years agohyperv/vmbus: Remove unused function definition/declaration.
Sepherosa Ziehau [Fri, 15 Jul 2016 05:15:21 +0000 (05:15 +0000)]
hyperv/vmbus: Remove unused function definition/declaration.

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

8 years agohyperv/vmbus: Function rename
Sepherosa Ziehau [Fri, 15 Jul 2016 05:06:15 +0000 (05:06 +0000)]
hyperv/vmbus: Function rename

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

8 years agohyperv/vmbus: Remove unused struct
Sepherosa Ziehau [Fri, 15 Jul 2016 04:54:07 +0000 (04:54 +0000)]
hyperv/vmbus: Remove unused struct

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

8 years agoDocument that missing KERNCONF files will now cause buildkernel to fail.
Cy Schubert [Fri, 15 Jul 2016 04:50:40 +0000 (04:50 +0000)]
Document that missing KERNCONF files will now cause buildkernel to fail.

Suggested by: ngie@
Differential Revision: D7167

8 years agoWhen building multiple kernels using KERNCONF, non-existent KERNCONF
Cy Schubert [Fri, 15 Jul 2016 04:43:38 +0000 (04:43 +0000)]
When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

Reviewed by: ngie@
MFC after: 1 week
Differential Revision: D7167

8 years agohyperv/vmbus: Merge hv_channel_mgmt.c into hv_channel.c
Sepherosa Ziehau [Fri, 15 Jul 2016 04:42:08 +0000 (04:42 +0000)]
hyperv/vmbus: Merge hv_channel_mgmt.c into hv_channel.c

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

8 years agoFix rendering issues.
John Baldwin [Thu, 14 Jul 2016 23:35:55 +0000 (23:35 +0000)]
Fix rendering issues.

- Use Ta to separate column headers.
- Correct width of the 'Code' column in the last table.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7118

8 years agoFix aio system call wrappers in librt.
John Baldwin [Thu, 14 Jul 2016 23:28:53 +0000 (23:28 +0000)]
Fix aio system call wrappers in librt.

- Update aio_return/waitcomplete wrappers for the ssize_t return type.
- Fix the aio_return() wrapper to fail with EINVAL on a pending job.
  This matches the semantics of the in-kernel system call.  Also,
  aio_return() returns errors via errno, not via the return value.

Reviewed by: kib (earlier version)
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7120

8 years agoInclude command line arguments in core dump process info.
John Baldwin [Thu, 14 Jul 2016 23:20:05 +0000 (23:20 +0000)]
Include command line arguments in core dump process info.

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

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D7116

8 years agoMove nested include of <sys/queue.h> inside _KERNEL.
John Baldwin [Thu, 14 Jul 2016 23:14:10 +0000 (23:14 +0000)]
Move nested include of <sys/queue.h> inside _KERNEL.

This removes namespace pollution for userland brought in by r299122.

PR: 210319
Submitted by: knu
MFC after: 1 week

8 years agoStart jails non-parallel if jail_parallel_start is NO. This was true
Jamie Gritton [Thu, 14 Jul 2016 20:17:08 +0000 (20:17 +0000)]
Start jails non-parallel if jail_parallel_start is NO.  This was true
for an explicitly specified jail list; now it's also true for all jails.

PR: 209112
MFC after: 3 days

8 years agoFix up the order in which jail creation processes are run, to preserve
Jamie Gritton [Thu, 14 Jul 2016 20:15:55 +0000 (20:15 +0000)]
Fix up the order in which jail creation processes are run, to preserve
the config file's order in the non-parallel-start case.

PR: 209112
MFC after: 3 days

8 years agoWait for jails to complete startup if jail_parallel_start is YES,
Jamie Gritton [Thu, 14 Jul 2016 19:51:54 +0000 (19:51 +0000)]
Wait for jails to complete startup if jail_parallel_start is YES,
instead of assuming they'll take less than one second.

PR: 203172
Submitted by: dmitry2004@yandex.ru

8 years agoLet DDB's buf printer handle NULL pointers in the buf page array.
Mark Johnston [Thu, 14 Jul 2016 18:49:05 +0000 (18:49 +0000)]
Let DDB's buf printer handle NULL pointers in the buf page array.

A buf's b_pages and b_npages fields may be inconsistent after a panic.
For instance, vfs_vmio_invalidate() sets b_npages to zero only after all
pages are unwired and their page array entries are cleared.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFinish removing the non-INTRNG support from sys/arm64.
Andrew Turner [Thu, 14 Jul 2016 17:31:29 +0000 (17:31 +0000)]
Finish removing the non-INTRNG support from sys/arm64.

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

8 years agoRemove the non-INTRNG support from the ThunderX PCIe drivers.
Andrew Turner [Thu, 14 Jul 2016 17:23:49 +0000 (17:23 +0000)]
Remove the non-INTRNG support from the ThunderX PCIe drivers.

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

8 years agoMove gic_v3_irqsrc into the GICv3 driver source as it's only needed there.
Andrew Turner [Thu, 14 Jul 2016 17:16:51 +0000 (17:16 +0000)]
Move gic_v3_irqsrc into the GICv3 driver source as it's only needed there.
Remove unused macros from the GICv3 header.

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

8 years agoMake PCI interupts allocation static when using bootrom (UEFI).
Alexander Motin [Thu, 14 Jul 2016 17:16:10 +0000 (17:16 +0000)]
Make PCI interupts allocation static when using bootrom (UEFI).

This makes factual interrupt routing match one shipped with UEFI firmware.
With old firmware this make legacy interrupts work reliable for functions 0
of PCI slots 3-6.  Updated UEFI image fixes problem completely.

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