]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agolibkvm: Improve physical address lookup scaling.
Will Andrews [Mon, 18 Jul 2016 01:55:25 +0000 (01:55 +0000)]
libkvm: Improve physical address lookup scaling.

Instead of using a hash table to convert physical page addresses to offsets
in the sparse page array, cache the number of bits set for each 4MB chunk of
physical pages.  Upon lookup, find the nearest cached population count, then
add/subtract the number of bits from that point to the page's PTE bit.
Then multiply by page size and add to the sparse page map's base offset.

This replaces O(n) worst-case lookup with O(1) (plus a small number of bits
to scan in the bitmap).  Also, for a 128GB system, a typical kernel core of
about 8GB will now only require ~4.5MB of RAM for this approach instead of
~48MB as with the hash table.

More concretely, /usr/sbin/crashinfo against the same core improves from a
max RSS of 188MB and wall time of 43.72s (33.25 user 2.94 sys) to 135MB and
9.43s (2.58 user 1.47 sys).  Running "thread apply all bt" in kgdb has a
similar RSS improvement, and wall time drops from 4.44s to 1.93s.

Reviewed by: jhb
Sponsored by: Backtrace I/O

8 years agolibkvm: Bounds check (more) PTE indices.
Will Andrews [Mon, 18 Jul 2016 01:03:39 +0000 (01:03 +0000)]
libkvm: Bounds check (more) PTE indices.

8 years agolibkvm: Put private kvm routines in kvm_private.c.
Will Andrews [Mon, 18 Jul 2016 01:02:52 +0000 (01:02 +0000)]
libkvm: Put private kvm routines in kvm_private.c.

8 years agosed(1): Fix off by one introduced in r299211.
Pedro F. Giffuni [Sun, 17 Jul 2016 21:49:53 +0000 (21:49 +0000)]
sed(1): Fix off by one introduced in r299211.

Detected by running the gsed tests.

Submitted by: Mikhail Teterin
PR: 195929
MFC after: 3 days

8 years agoDisallow interrupt requests on disabled endpoints.
Peter Grehan [Sun, 17 Jul 2016 20:34:46 +0000 (20:34 +0000)]
Disallow interrupt requests on disabled endpoints.

Submitted by: Leon Dang
MFC after: 3 days

8 years agoRemove booke_enable_l3_cache declaration and remaining definition.
Justin Hibbits [Sun, 17 Jul 2016 19:24:28 +0000 (19:24 +0000)]
Remove booke_enable_l3_cache declaration and remaining definition.

L3 cache is not defined by Book-E, so is platform specific.  Since it was
already moved for e500-based devices into mpc85xx in r292903, just eliminate it
altogether.  Any device that supports L3 cache should have its own platform
means to enable it.

8 years agoNo need to include mpc85xx.h anymore, so remove it.
Justin Hibbits [Sun, 17 Jul 2016 19:19:50 +0000 (19:19 +0000)]
No need to include mpc85xx.h anymore, so remove it.

8 years agoFix nvlist array memory leak.
Mariusz Zaborski [Sun, 17 Jul 2016 15:36:02 +0000 (15:36 +0000)]
Fix nvlist array memory leak.

When we change nvl_array_next to NULL it means that we want to destroy or
take nvlist_array. The nvpair, which stores next nvlist of nvlist_array element
is no longer needed and can be freed.

Submitted by: Adam Starak <starak.adam@gmail.com>
MFC after: 1 week

8 years agoFix memory leak in the nvlist string array.
Mariusz Zaborski [Sun, 17 Jul 2016 15:29:31 +0000 (15:29 +0000)]
Fix memory leak in the nvlist string array.

Submitted by: Adam Starak <starak.adam@gmail.com>
MFC after: 1 week

8 years agoTEGRA: Subclass Tegra PCIE driver from ofw_pci base driver.
Michal Meloun [Sun, 17 Jul 2016 14:45:15 +0000 (14:45 +0000)]
TEGRA: Subclass Tegra PCIE driver from ofw_pci base driver.
Remove now redundant code.

8 years agoRestore PIM_ATA_EXT flag handling, lost at r300207.
Alexander Motin [Sun, 17 Jul 2016 14:17:58 +0000 (14:17 +0000)]
Restore PIM_ATA_EXT flag handling, lost at r300207.

This re-enables NCQ TRIM usage on capable hardware (bhyve).

8 years agoFix NCQ TRIM emulation.
Alexander Motin [Sun, 17 Jul 2016 14:13:47 +0000 (14:13 +0000)]
Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

8 years agoOFWPCI: Add support for NEW_PCIB.
Michal Meloun [Sun, 17 Jul 2016 13:43:46 +0000 (13:43 +0000)]
OFWPCI: Add support for NEW_PCIB.

MFC after: 3 weeks

8 years agoOFWPCI: Improve resource handling.
Michal Meloun [Sun, 17 Jul 2016 13:43:00 +0000 (13:43 +0000)]
OFWPCI: Improve resource handling.
- add new rman for prefetchable memory. Is used only if given 'ranges'
  property contains prefetchable memory range.

- not all ranges in 'ranges' property are subject for rman's filling.
  Tegra for example, have two addition records which are used for
  'pci 'register' -> 'assigned-address' -> 'ranges' machinery.
  Add sc_ranges_mask for masking not rman related ranges.

- consistently pass unknown (not managed at this level) resources
  allocation/release/adjust requests to parent.

MFC after: 3 weeks

8 years agoAdd a constant required by RFC 7496.
Michael Tuexen [Sun, 17 Jul 2016 13:33:35 +0000 (13:33 +0000)]
Add a constant required by RFC 7496.

MFC after: 3 days

8 years agoFix the PR-SCTP behaviour.
Michael Tuexen [Sun, 17 Jul 2016 13:14:51 +0000 (13:14 +0000)]
Fix the PR-SCTP behaviour.
This is done by rrs@.

MFC after: 3 days

8 years agoReflect pathnames sorting in collation order.
Andrey A. Chernov [Sun, 17 Jul 2016 13:10:57 +0000 (13:10 +0000)]
Reflect pathnames sorting in collation order.

8 years agoIn AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.
Alexander Motin [Sun, 17 Jul 2016 12:45:58 +0000 (12:45 +0000)]
In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.

This is probably a NOP change since IS register is not activery used for
interrupts below the shared, but it looked odd to clear interrupts we did
not handle.

8 years agoDo not consider the last interrupt shared if there are enough interrupts
Alexander Motin [Sun, 17 Jul 2016 12:31:31 +0000 (12:31 +0000)]
Do not consider the last interrupt shared if there are enough interrupts
for all channels.

8 years agoDon't duplicate code for SCTP, just use the ones used for UDP and TCP.
Michael Tuexen [Sun, 17 Jul 2016 11:43:27 +0000 (11:43 +0000)]
Don't duplicate code for SCTP, just use the ones used for UDP and TCP.

This fixes a bug with link local addresses. This will require and
upcoming change in the kernel to bring SCTP to the same behaviour
as UDP and TCP.

MFC after: 3 days

8 years agoIn g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing
Andrey A. Chernov [Sun, 17 Jul 2016 11:25:24 +0000 (11:25 +0000)]
In g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing
right now, but some architectures theoretically may 64-bit wchar_t and the
code looks more correct.

8 years ago1) This file full of direct char <-> wchar_t assignment, not converted, cut
Andrey A. Chernov [Sun, 17 Jul 2016 09:39:59 +0000 (09:39 +0000)]
1) This file full of direct char <-> wchar_t assignment, not converted, cut
them down. This hack still remains:
 * 2. Illegal byte sequences in filenames are handled by treating them as
 *    single-byte characters with a values of such bytes of the sequence
 *    cast to wchar_t.

2) Reword the comment in the hack above to reflect implementation.

3) Protect signed wchar_t from sign extension when a signed char is assigned
to it in the hack above.

3) Corresponding backward hack in g_Ctoc() was not implemented, so all
pathes with illegal byte sequences are skipped as result, implement it now.

4) globtilde() forget to convert expanded user home dir from multibyte to
wchar.

5) Protect globtilde() from long expansion truncation.

6) Results was not sorted according to collate as POSIX requires.

8 years agoAdd missing sctps_reasmusrmsgs counter.
Michael Tuexen [Sun, 17 Jul 2016 08:31:21 +0000 (08:31 +0000)]
Add missing sctps_reasmusrmsgs counter.
Joint work with rrs@.
MFC after: 3 days

8 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

8 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

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

8 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

8 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

8 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

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

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

8 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

8 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

8 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

8 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

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

8 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

8 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

8 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

8 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

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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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)

8 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

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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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