]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoA failed installation once restarted will often error out
Allan Jude [Sat, 16 Jul 2016 19:35:04 +0000 (19:35 +0000)]
A failed installation once restarted will often error out

If an encrypted install is attempted and fails for any reason, the disk
cannot be erased by the installer because the partition is in use by GELI

At the start of the installation process, all ZFS pools are exported and
all GELI instances are detached, to allow a restarted install to proceed

PR: 210814
Reported by: jonathan
MFC after: 10 days

7 years agoFix encrypted MBR install
Allan Jude [Sat, 16 Jul 2016 18:28:44 +0000 (18:28 +0000)]
Fix encrypted MBR install

The pools are exported and reimported in order to write the bootcode
This causes an error when the bootpool is later mounted by common code
The bootpool is now imported with the -N flag to prevent mounting

Reported by: Michael Dexter
MFC after: 5 days

7 years agoAdd support for Allwinner H3 EMAC.
Jared McNeill [Sat, 16 Jul 2016 18:06:41 +0000 (18:06 +0000)]
Add support for Allwinner H3 EMAC.

H3 EMAC is the same as A83T/A64 except the SoC includes an (optional)
internal 10/100 PHY. Both internal and external PHYs are supported on H3
with this driver.

7 years agoPath generation was not according to collate
Andrey A. Chernov [Sat, 16 Jul 2016 13:26:18 +0000 (13:26 +0000)]
Path generation was not according to collate

Approved by:    jilles

7 years agoAnother issue reported on http://seclists.org/oss-sec/2016/q3/68 is
Konstantin Belousov [Sat, 16 Jul 2016 13:24:58 +0000 (13:24 +0000)]
Another issue reported on http://seclists.org/oss-sec/2016/q3/68 is
that struct kevent member ident has uintptr_t type, which is silently
truncated to int in the call to fget().  Explicitely check for the
valid range.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDeal with a portential memory allocation failure, which was reported
Michael Tuexen [Sat, 16 Jul 2016 12:25:37 +0000 (12:25 +0000)]
Deal with a portential memory allocation failure, which was reported
by the clang static code analyzer.
Joint work with rrs@.

MFC after: 3 days

7 years agoRevert unwanted change leaked into r302932.
Alexander Motin [Sat, 16 Jul 2016 09:44:31 +0000 (09:44 +0000)]
Revert unwanted change leaked into r302932.

7 years agoIncrease I82545_MAX_TXSEGS from 20 to 64 and add checks for it.
Alexander Motin [Sat, 16 Jul 2016 09:08:33 +0000 (09:08 +0000)]
Increase I82545_MAX_TXSEGS from 20 to 64 and add checks for it.

There seems no hard limit on number of segments per packet in the chip,
and 20 appeared insufficient.  Hope 64 will be enough, but if not -- add
check to report that and drop the packet instead of corrupting stack.

7 years agoDon't free a data chunk twice.
Michael Tuexen [Sat, 16 Jul 2016 08:11:43 +0000 (08:11 +0000)]
Don't free a data chunk twice.
Found by the clang static code analyzer running for the userland stack.

MFC after: 3 days

7 years agoNow that potentially buggy versions of Xen are automatically detected
Colin Percival [Sat, 16 Jul 2016 08:04:00 +0000 (08:04 +0000)]
Now that potentially buggy versions of Xen are automatically detected
(see r302635), there is no need to force msix interrupt migration off
via loader.conf.

Reverts: r302184
MFC after: 3 days

7 years agoAddress a potential memory leak found a the clang static code analyzer
Michael Tuexen [Sat, 16 Jul 2016 07:48:01 +0000 (07:48 +0000)]
Address a potential memory leak found a the clang static code analyzer
running on the userland stack.

MFC after: 3 days

7 years agoRename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.
John Baldwin [Sat, 16 Jul 2016 00:54:46 +0000 (00:54 +0000)]
Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.

Suggested by: kib

7 years agoAdd a regression test to make sure the Russian collation is actually working
Baptiste Daroussin [Fri, 15 Jul 2016 23:43:23 +0000 (23:43 +0000)]
Add a regression test to make sure the Russian collation is actually working

when importing collation support from Dragonfly/Illumos amdmi3@ tested the
collation branch and reported an issue with Russian collation. John Marino fixed
the issue in Dragonfly and I merged it back to FreeBSD.

Now that Illumos is working on merging our fixes they (Lauri Tirkkonen) found
issues with the commit that fixes the russian collation in UTF-8 that resulted
in a crash with strxfrm(3) and the ISO-8859-5 locale (fixed in FreeBSD r302916).
This small test was written to ensure we do not bring back the old issue with
russian collation while fixing the other issue.

7 years agoIn ptrace_vm_entry(), do not call vmspace_free() while owning a vm
Konstantin Belousov [Fri, 15 Jul 2016 23:26:33 +0000 (23:26 +0000)]
In ptrace_vm_entry(), do not call vmspace_free() while owning a vm
object lock.

The vmspace_free() operations might need to lock map, object etc on
last dereference.  Postpone the free until object's inspection is
done.

Reported and tested by: will
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd a regression test about the crash with strxfrm and ISO8859-5 locales
Baptiste Daroussin [Fri, 15 Jul 2016 23:24:00 +0000 (23:24 +0000)]
Add a regression test about the crash with strxfrm and ISO8859-5 locales

7 years agoEnsure that the -a, -W, -L options for SCTP behave similar
Michael Tuexen [Fri, 15 Jul 2016 23:13:57 +0000 (23:13 +0000)]
Ensure that the -a, -W, -L options for SCTP behave similar
as for TCP.

MFC after: 3 days

7 years agoRevert 302324 and properly fix the crash with ISO-8859-5 locales
Baptiste Daroussin [Fri, 15 Jul 2016 23:03:20 +0000 (23:03 +0000)]
Revert 302324 and properly fix the crash with ISO-8859-5 locales

PR: 211135
Reported by: jkim
Tested by: jkim
MFC after: 2 days

7 years agomail(1): Minor declaration updates.
Pedro F. Giffuni [Fri, 15 Jul 2016 20:27:21 +0000 (20:27 +0000)]
mail(1): Minor declaration updates.

Missing from r302903.

7 years agomail(1): Avoid closing negative file descriptors.
Pedro F. Giffuni [Fri, 15 Jul 2016 19:43:24 +0000 (19:43 +0000)]
mail(1): Avoid closing negative file descriptors.

CID: 10081051008106
MFC after: 1 week

7 years agoFix dlsym(RTLD_NEXT) handling to only return the next library in last library cases.
Bryan Drewery [Fri, 15 Jul 2016 19:07:00 +0000 (19:07 +0000)]
Fix dlsym(RTLD_NEXT) handling to only return the next library in last library cases.

The root of the problem here is that TAILQ_FOREACH_FROM will default to
the head of the list if passed NULL, which will be the case if there are
no libraries loaded after this one.  Thus all libraries, including the
current, were iterated in that case rather than none.

This was broken in r294373.

Reviewed by: markj (earlier version), cem, kib, ngie
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7216

7 years agoWhen calling netstat -Laptcp the local address values are not aligned
Michael Tuexen [Fri, 15 Jul 2016 17:40:34 +0000 (17:40 +0000)]
When calling netstat -Laptcp the local address values are not aligned
with the corresponding entry in the table header.
r295136 increased the value width from 14 to 32 without the corresponding
change to the table header. This commit adds the change to the table
header width.

MFC after: 3 days

7 years agoAdd net.inet6.ip6.intr_queue_maxlen sysctl. It can be used to
Andrey V. Elsukov [Fri, 15 Jul 2016 17:09:30 +0000 (17:09 +0000)]
Add net.inet6.ip6.intr_queue_maxlen sysctl. It can be used to
change netisr queue limit for IPv6 at runtime.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

7 years agoFix a bug which results in a core dump when running netstat with
Michael Tuexen [Fri, 15 Jul 2016 15:55:36 +0000 (15:55 +0000)]
Fix a bug which results in a core dump when running netstat with
the -W option and having a listening SCTP socket.
The bug was introduced in r279122 when adding support for libxo.

MFC after: 3 days

7 years agomail(1): Update more prototypes.
Pedro F. Giffuni [Fri, 15 Jul 2016 15:37:54 +0000 (15:37 +0000)]
mail(1): Update more prototypes.

Also rename delete and undelete_messages to deletecmd and undeletecmd
respectively in an attempt to sync with other BSDs.

Obtained from: OpenBSD

7 years agoAdd a mask of optional ptrace() events.
John Baldwin [Fri, 15 Jul 2016 15:32:09 +0000 (15:32 +0000)]
Add a mask of optional ptrace() events.

ptrace() now stores a mask of optional events in p_ptevents.  Currently
this mask is a single integer, but it can be expanded into an array of
integers in the future.

Two new ptrace requests can be used to manipulate the event mask:
PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK
sets the current event mask.

The current set of events include:
- PTRACE_EXEC: trace calls to execve().
- PTRACE_SCE: trace system call entries.
- PTRACE_SCX: trace syscam call exits.
- PTRACE_FORK: trace forks and auto-attach to new child processes.
- PTRACE_LWP: trace LWP events.

The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have
been replaced by PTRACE_SCE and PTRACE_SCX.  PTRACE_FORK replaces
P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.

The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for
compatibility but now simply toggle corresponding flags in the
event mask.

While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both
modify the event mask and continue the traced process.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7044

7 years agoAdd a test for user signal delivery.
John Baldwin [Fri, 15 Jul 2016 15:28:33 +0000 (15:28 +0000)]
Add a test for user signal delivery.

This test verifies we get the correct ptrace event details when a signal
is posted to a traced process from userland.

Reviewed by: kib (part of D7044)

7 years agoAdd documentation for the sigevent structure.
John Baldwin [Fri, 15 Jul 2016 15:12:56 +0000 (15:12 +0000)]
Add documentation for the sigevent structure.

- Add a sigevent(3) manpage to give a general overview of the sigevent
  structure and the available notification mechanisms.
- Document that AIO requests contain a nested sigevent structure that can
  be used to request completion notification.
- Expand the sigevent details in other manuals to note details such as
  the extra values stored in a queued signal's information or in a posted
  kevent.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7122

7 years agoRevert r302865 and it's sister r302866 as r302865 causes some breakage.
Cy Schubert [Fri, 15 Jul 2016 15:09:48 +0000 (15:09 +0000)]
Revert r302865 and it's sister r302866 as r302865 causes some breakage.

Reported by: Guy Yur <guyyur@gmail.com>

7 years agoAdd new System Hardening menu and options to bsdinstall.
Bartek Rutkowski [Fri, 15 Jul 2016 15:07:24 +0000 (15:07 +0000)]
Add new System Hardening menu and options to bsdinstall.

This patch add new 'hardening' file responsible for new bsdinstall
'System Hardening' menu allowing users to set some sane and carefully
picked system security options (like random process id's, hiding
other users/groups processes and others).

All options are OFF by default in this patch due to POLA principle
with intention to turn change some of them to ON by default in future.

Reviewed by: adrian, allanjude, bdrewery, nwhitehorn
Approved by: adrian, allanjude
MFC after: 7 days

7 years agoImplement bus_print_child to print the resources used by the ITS driver.
Andrew Turner [Fri, 15 Jul 2016 13:25:47 +0000 (13:25 +0000)]
Implement bus_print_child to print the resources used by the ITS driver.

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

7 years agoFix regression introduced by r302350. The change of return value for a
Gleb Smirnoff [Fri, 15 Jul 2016 09:28:32 +0000 (09:28 +0000)]
Fix regression introduced by r302350. The change of return value for a
callout that wasn't scheduled at all was unintentional and yielded in
several panics.

PR: 210884

7 years agoDo not allow creation of char or block special nodes with VNOVAL dev_t.
Konstantin Belousov [Fri, 15 Jul 2016 09:23:18 +0000 (09:23 +0000)]
Do not allow creation of char or block special nodes with VNOVAL dev_t.

As was reported on http://seclists.org/oss-sec/2016/q3/68, tmpfs code
contains assertion that rdev != VNOVAL.  On FreeBSD, there is no other
consequences except triggering the assert.  To be compatible with
systems where device nodes have some significance, reject mknod(2)
call with dev == VNOVAL at the syscall level.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agohyperv/vmbus: Cleanup channel sysctl tree creation
Sepherosa Ziehau [Fri, 15 Jul 2016 08:40:22 +0000 (08:40 +0000)]
hyperv/vmbus: Cleanup channel sysctl tree creation

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

7 years agohyperv/vmbus: Cosmetic vmbus channel close cleanup
Sepherosa Ziehau [Fri, 15 Jul 2016 08:31:53 +0000 (08:31 +0000)]
hyperv/vmbus: Cosmetic vmbus channel close cleanup

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

7 years agohyperv/vmbus: Function rename
Sepherosa Ziehau [Fri, 15 Jul 2016 08:23:33 +0000 (08:23 +0000)]
hyperv/vmbus: Function rename

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

7 years agohyperv/vmbus: Back out r302888 temporarily
Sepherosa Ziehau [Fri, 15 Jul 2016 08:13:44 +0000 (08:13 +0000)]
hyperv/vmbus: Back out r302888 temporarily

Committed by accident w/ duplicated commit log

MFC after: 1 week
Sponsored by: Microsoft OSTC

7 years agohyperv/hn: Busdma-fy rxbuf and chimney sending buffer
Sepherosa Ziehau [Fri, 15 Jul 2016 08:08:13 +0000 (08:08 +0000)]
hyperv/hn: Busdma-fy rxbuf and chimney sending buffer

Nuke unused channel GPADL API.

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

7 years agohyperv/hn: Busdma-fy rxbuf and chimney sending buffer
Sepherosa Ziehau [Fri, 15 Jul 2016 08:06:48 +0000 (08:06 +0000)]
hyperv/hn: Busdma-fy rxbuf and chimney sending buffer

Nuke unused channel GPADL API.

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

7 years agohyperv/vmbus: Cleanup channel packet receiving.
Sepherosa Ziehau [Fri, 15 Jul 2016 07:53:45 +0000 (07:53 +0000)]
hyperv/vmbus: Cleanup channel packet receiving.

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

7 years agohyperv/vmbus: Cleanup channel receiving.
Sepherosa Ziehau [Fri, 15 Jul 2016 07:45:30 +0000 (07:45 +0000)]
hyperv/vmbus: Cleanup channel receiving.

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

7 years agohyperv/vmbus: Factor out macros to do channel packet length conversion.
Sepherosa Ziehau [Fri, 15 Jul 2016 07:35:01 +0000 (07:35 +0000)]
hyperv/vmbus: Factor out macros to do channel packet length conversion.

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

7 years agohyperv/vmbus: Field rename
Sepherosa Ziehau [Fri, 15 Jul 2016 07:26:31 +0000 (07:26 +0000)]
hyperv/vmbus: Field rename

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

7 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

7 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

7 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

7 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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

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

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

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

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

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

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

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

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

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

7 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

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

7 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