freebsd.git
8 years agoMFV r301238:
delphij [Fri, 3 Jun 2016 08:00:22 +0000 (08:00 +0000)]
MFV r301238:

ntp 4.2.8p8.

Security: CVE-2016-4957, CVE-2016-4953, CVE-2016-4954
Security: CVE-2016-4955, CVE-2016-4956
Security: FreeBSD-SA-16:24.ntp
With hat: so

8 years agoGet struct sctp_net_route in-sync with struct route again.
tuexen [Fri, 3 Jun 2016 07:43:04 +0000 (07:43 +0000)]
Get struct sctp_net_route in-sync with struct route again.

8 years agoStore the peers vtag in host byte order in the cookie, since all
tuexen [Fri, 3 Jun 2016 07:24:41 +0000 (07:24 +0000)]
Store the peers vtag in host byte order in the cookie, since all
consumers expect it that way.
This fixes the vtag when sending en ERROR chunk.

MFC after: 1 week

8 years agoAdd blacklist support to fingerd
lidl [Fri, 3 Jun 2016 07:00:28 +0000 (07:00 +0000)]
Add blacklist support to fingerd

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5916

8 years agoAdd blacklist support to rshd
lidl [Fri, 3 Jun 2016 06:58:20 +0000 (06:58 +0000)]
Add blacklist support to rshd

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6594

8 years agoAdd blacklist support to ftpd
lidl [Fri, 3 Jun 2016 06:24:03 +0000 (06:24 +0000)]
Add blacklist support to ftpd

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6703

8 years agoAdd blacklistd.conf manpage
lidl [Fri, 3 Jun 2016 06:15:52 +0000 (06:15 +0000)]
Add blacklistd.conf manpage

Install the blacklistd.conf man page, missed in the original commit.

Submitted by: Herbert J. Skuhra ( herbert at mailbox.org )
Reviewed by: rpaulo
Approved by: rpaulo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6702

8 years agoVendor import of ntp-4.2.8p8.
delphij [Fri, 3 Jun 2016 05:55:24 +0000 (05:55 +0000)]
Vendor import of ntp-4.2.8p8.

8 years agosfxge(4): support EVQ timer workaround via MCDI
arybchik [Fri, 3 Jun 2016 05:27:34 +0000 (05:27 +0000)]
sfxge(4): support EVQ timer workaround via MCDI

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/6675

8 years ago[drm] fix up hex_dump_to_buffer to not overflow linebuf.
adrian [Fri, 3 Jun 2016 05:01:35 +0000 (05:01 +0000)]
[drm] fix up hex_dump_to_buffer to not overflow linebuf.

That check wasn't enough to handle appending a two byte character
following it.

This prevented my T400 (Intel Core 2 Duo P8400) from attaching;
it would panic from a stack overflow detection.

8 years agodhclient(1): correct obvious mismatch in get_char().
pfg [Fri, 3 Jun 2016 03:40:39 +0000 (03:40 +0000)]
dhclient(1): correct obvious mismatch in get_char().

Correct switch between current and previous line buffers when
encountering a carriage return in the input.

CID: 1305719
Obtained from: OpenBSD (CVS rev. 1.30)
MFC after: 3 days

8 years agoUpdate to ALPHA2 in preparation of a new set of snapshot builds.
gjb [Fri, 3 Jun 2016 00:06:24 +0000 (00:06 +0000)]
Update to ALPHA2 in preparation of a new set of snapshot builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoFix up the Infiniband code to handle the new arpresolve.
gnn [Thu, 2 Jun 2016 20:53:43 +0000 (20:53 +0000)]
Fix up the Infiniband code to handle the new arpresolve.

8 years agoRemove libstdc++ again.
bdrewery [Thu, 2 Jun 2016 20:31:02 +0000 (20:31 +0000)]
Remove libstdc++ again.

This was mis-merged in r298107 which missed r289389.

8 years agoPull in r271548 from upstream llvm trunk (by me):
dim [Thu, 2 Jun 2016 19:54:38 +0000 (19:54 +0000)]
Pull in r271548 from upstream llvm trunk (by me):

  Only attempt to detect AVG if SSE2 is available

  Summary:
  In PR29973 Sanjay Patel reported an assertion failure when a certain
  loop was optimized, for a target without SSE2 support.  It turned out
  this was because of the AVG pattern detection introduced in rL253952.

  Prevent the assertion failure by bailing out early in
  `detectAVGPattern()`, if the target does not support SSE2.

  Also add a minimized test case.

  Reviewers: congh, eli.friedman, spatel

  Subscribers: emaste, llvm-commits

  Differential Revision: http://reviews.llvm.org/D20905

This should fix assertion failures ("Requires at least SSE2!") when
building the games/0ad port with CPUTYPE=pentium3.

Reported by: madpilot

8 years agoAdd basic blacklist build support
lidl [Thu, 2 Jun 2016 19:06:04 +0000 (19:06 +0000)]
Add basic blacklist build support

Reviewed by: rpaulo
Approved by: rpaulo
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5913

8 years agoAdd support for CESA on Armada38x
zbb [Thu, 2 Jun 2016 18:41:33 +0000 (18:41 +0000)]
Add support for CESA on Armada38x

Changes:
- added new SoC ID in CESA attach
- allowed crypto driver IDs other than 0
- added CESA nodes to Armada38x .dts files
- enabled required devices in kernconf

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6220

8 years agoAdd HMAC-SHA256 support in CESA
zbb [Thu, 2 Jun 2016 18:39:33 +0000 (18:39 +0000)]
Add HMAC-SHA256 support in CESA

Only HMAC-SHA256 is added as it is the only SHA-2 variant supported by
cryptodev. It is not possible to register hardware support for other
algorithms in the family including regular non-keyed SHA256.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6219

8 years agoTruncate HMAC output only if requested by the client
zbb [Thu, 2 Jun 2016 18:37:50 +0000 (18:37 +0000)]
Truncate HMAC output only if requested by the client

The output of HMAC was previously truncated to 12 bytes. This was only
correct in case of one particular crypto client - the new version of IPSEC.
Fix by taking into account the cri_mlen field in cryptoini session request
filled in by the client.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6218

8 years agoSplit CESA memory resource into TDMA and CESA regs
zbb [Thu, 2 Jun 2016 18:35:35 +0000 (18:35 +0000)]
Split CESA memory resource into TDMA and CESA regs

TDMA and CESA registers are placed in different ranges of memory. Split
memory resource in DTS to reflect that. This change is needed to support
multiple CESA nodes as otherwise the ranges of different nodes would
overlap.

In consequence, CESA_WRITE and CESA_READ macros have been split depending
on which range of registers is accessed. Offsets for CESA registers have
been modified as the base address has changed.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6217

8 years agoConfigure CPU window to second CESA SRAM
zbb [Thu, 2 Jun 2016 18:33:26 +0000 (18:33 +0000)]
Configure CPU window to second CESA SRAM

Check if there is a second CESA SRAM node in FDT and add a CPU window
for it. Define A38X specific macro for setting device attribute for
each node.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6216

8 years agoMap CESA SRAM memory in driver attach for Armada38x
zbb [Thu, 2 Jun 2016 18:31:36 +0000 (18:31 +0000)]
Map CESA SRAM memory in driver attach for Armada38x

On other platforms with CESA accelerator the SRAM memory is mapped in
early init before driver is attached. This method only works correctly
with mappings no smaller than L1 section size (1MB). There may be more
SRAM blocks and they may have smaller sizes than 1MB as is the case
for Armada38x. Instead, map SRAM memory with bus_space_map() in CESA
driver attach. Note that we can no longer assume that VA == PA for the
SRAM.

Submitted by: Michal Stanek <mst@semihalf.com
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6215

8 years agoFixup path in NetBSD supplied documentation for FreeBSD
lidl [Thu, 2 Jun 2016 18:25:32 +0000 (18:25 +0000)]
Fixup path in NetBSD supplied documentation for FreeBSD

NetBSD installs the blacklist-helper script in /libexec, and
it goes into /usr/libexec on FreeBSD.  Update the docs to
match FreeBSD's installation location.

Reviewed by: rpaulo
Approved by: rpaulo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6592

8 years agoRevert part of r294418 ("Correct ranges...")
zbb [Thu, 2 Jun 2016 18:24:00 +0000 (18:24 +0000)]
Revert part of r294418 ("Correct ranges...")

Commit was temporary fix due to rman_res_t defined as 32-bit u_long.
After redefining it as 64-bit variable workaround is not needed and
was removed.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D6214

8 years agoThis change re-adds L2 caching for TCP and UDP, as originally added in D4306
gnn [Thu, 2 Jun 2016 17:51:29 +0000 (17:51 +0000)]
This change re-adds L2 caching for TCP and UDP, as originally added in D4306
but removed due to other changes in the system. Restore the llentry pointer
to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as
appropriate.

Submitted by: Mike Karels
Differential Revision: https://reviews.freebsd.org/D6262

8 years agoFix two types which resulted in setting the address long wrong
tuexen [Thu, 2 Jun 2016 17:31:37 +0000 (17:31 +0000)]
Fix two types which resulted in setting the address long wrong
for IPv6 addresses.

Reported by: pfg@
CID: 1347086
MFC after: 1 week

8 years agocitrus: Remove redundant code in _citrus_esdb_get_list().
pfg [Thu, 2 Jun 2016 17:28:39 +0000 (17:28 +0000)]
citrus: Remove redundant code in _citrus_esdb_get_list().

It appears "sorted" may have not been implemented. Sorted or not,
we always follow the same action so simplify the code.
Leave a note for future generations.

CID: 1347084

8 years agoExploit r301213 to fix in6 ifaddr locking in pfxlist_onlink_check().
markj [Thu, 2 Jun 2016 17:21:57 +0000 (17:21 +0000)]
Exploit r301213 to fix in6 ifaddr locking in pfxlist_onlink_check().

Reviewed by: ae, hrs
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6639

8 years agoAlways start IPv6 DAD asynchronously.
markj [Thu, 2 Jun 2016 17:17:15 +0000 (17:17 +0000)]
Always start IPv6 DAD asynchronously.

Otherwise we transmit the first neighbour solicitation in the context of the
caller of nd6_dad_start(), which can easily result in lock recursion. When
DAD is to be started after some delay, we send the first NS from the DAD
callout handler, so just change the implementation to do this in the
non-delayed case as well.

Reviewed by: ae, hrs
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6639

8 years agoReset the page busy lock state after failing to insert into the object.
markj [Thu, 2 Jun 2016 17:11:24 +0000 (17:11 +0000)]
Reset the page busy lock state after failing to insert into the object.

Freeing a shared-busy page is not permitted.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6670

8 years agoDon't preserve the page's object linkage in vm_page_insert_after().
markj [Thu, 2 Jun 2016 16:58:47 +0000 (16:58 +0000)]
Don't preserve the page's object linkage in vm_page_insert_after().

Per the KASSERT at the beginning of the function, we expect that the page
does not belong to any object, so its object and pindex fields are
meaningless. Reset them in the rare case that vm_radix_insert() fails.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6669

8 years agotaskqueue: plug a leak in _taskqueue_create
mjg [Thu, 2 Jun 2016 15:52:34 +0000 (15:52 +0000)]
taskqueue: plug a leak in _taskqueue_create

While here make some style fixes and postpone the sprintf so that it is
only done when the function can no longer fail.

CID: 1356041

8 years agoFix exit status of "service routing start <af> <iface>"
asomers [Thu, 2 Jun 2016 15:31:24 +0000 (15:31 +0000)]
Fix exit status of "service routing start <af> <iface>"

etc/rc.d/routing
Ignore the exit status of options_{inet,inet6,atm}. It's
meaningless.

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

8 years agousb/uhso: Don't bail out on first USB error.
pfg [Thu, 2 Jun 2016 15:30:58 +0000 (15:30 +0000)]
usb/uhso: Don't bail out on first USB error.

CID: 1305680
Submitted by: hselasky
MFC after: 3 days

8 years agoFix typos.
br [Thu, 2 Jun 2016 15:14:40 +0000 (15:14 +0000)]
Fix typos.

8 years agoxen-netfront: use callout_reset_curcpu instead of callout_reset
royger [Thu, 2 Jun 2016 14:25:10 +0000 (14:25 +0000)]
xen-netfront: use callout_reset_curcpu instead of callout_reset

This should help distribute the load of the callbacks.

Suggested by: hps
Sponsored by: Citrix Systems R&D

8 years agoAdded support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers.
kadesai [Thu, 2 Jun 2016 12:26:55 +0000 (12:26 +0000)]
Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers.

Submitted by:   Sumit Saxena <Sumit.Saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO/BROADCOM Limited

8 years agourtw: fix unused variable assignments.
avos [Thu, 2 Jun 2016 12:01:58 +0000 (12:01 +0000)]
urtw: fix unused variable assignments.

Append CWmax and retry limitation to tp->maxretry instead of rewriting it
(will restore pre-r198194 behavior).

Noticed by: pfg, hps

Reported by: Coverity
CID: 1304937, 1304920

8 years agoxen-netfront: perform an interface reset when changing options
royger [Thu, 2 Jun 2016 11:21:00 +0000 (11:21 +0000)]
xen-netfront: perform an interface reset when changing options

The PV backend will only pick the new options when the interface is detached
and reattached again, so perform a full reset when changing options. This is
very fast, and should not be noticeable by the user.

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D6658

8 years agoxen-netfront: release grant references used for the shared rings
royger [Thu, 2 Jun 2016 11:19:16 +0000 (11:19 +0000)]
xen-netfront: release grant references used for the shared rings

Just calling gnttab_end_foreign_access_ref doesn't free the references,
instead call gnttab_end_foreign_access with a NULL page argument in order to
have the grant references freed. The code that maps the ring
(xenbus_map_ring) already uses gnttab_grant_foreign_access which takes care
of allocating a grant reference.

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D6608

8 years agoxen-netfront: fix two hotplug related issues
royger [Thu, 2 Jun 2016 11:18:02 +0000 (11:18 +0000)]
xen-netfront: fix two hotplug related issues

This patch fixes two issues seen on hot-unplug. The first one is a panic
caused by calling ether_ifdetach after freeing the internal netfront queue
structures. ether_ifdetach will call xn_qflush, and this needs to be done
before freeing the queues. This prevents the following panic:

Fatal trap 9: general protection fault while in kernel mode
cpuid = 2; apic id = 04
instruction pointer = 0x20:0xffffffff80b1687f
stack pointer         = 0x28:0xfffffe009239e770
frame pointer         = 0x28:0xfffffe009239e780
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 0 (thread taskq)
[ thread pid 0 tid 100015 ]
Stopped at      strlen+0x1f:    movq    (%rcx),%rax
db> bt
Tracing pid 0 tid 100015 td 0xfffff800038a6000
strlen() at strlen+0x1f/frame 0xfffffe009239e780
kvprintf() at kvprintf+0xfa0/frame 0xfffffe009239e890
vsnprintf() at vsnprintf+0x31/frame 0xfffffe009239e8b0
kassert_panic() at kassert_panic+0x5a/frame 0xfffffe009239e920
__mtx_lock_flags() at __mtx_lock_flags+0x164/frame 0xfffffe009239e970
xn_qflush() at xn_qflush+0x59/frame 0xfffffe009239e9b0
if_detach() at if_detach+0x17e/frame 0xfffffe009239ea10
netif_free() at netif_free+0x97/frame 0xfffffe009239ea30
netfront_detach() at netfront_detach+0x11/frame 0xfffffe009239ea40
[...]

Another panic can be triggered by hot-plugging a NIC:

Fatal trap 18: integer divide fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer = 0x20:0xffffffff80902203
stack pointer         = 0x28:0xfffffe00508d3660
frame pointer         = 0x28:0xfffffe00508d36a0
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 2960 (ifconfig)
[ thread pid 2960 tid 100088 ]
Stopped at      xn_txq_mq_start+0x33:   divl    %esi,%eax
db> bt
Tracing pid 2960 tid 100088 td 0xfffff8000850aa00
xn_txq_mq_start() at xn_txq_mq_start+0x33/frame 0xfffffe00508d36a0
ether_output() at ether_output+0x570/frame 0xfffffe00508d3720
arprequest() at arprequest+0x433/frame 0xfffffe00508d3820
arp_ifinit() at arp_ifinit+0x49/frame 0xfffffe00508d3850
xn_ioctl() at xn_ioctl+0x1a2/frame 0xfffffe00508d3890
in_control() at in_control+0x882/frame 0xfffffe00508d3910
ifioctl() at ifioctl+0xda1/frame 0xfffffe00508d39a0
kern_ioctl() at kern_ioctl+0x246/frame 0xfffffe00508d3a00
sys_ioctl() at sys_ioctl+0x171/frame 0xfffffe00508d3ae0
amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe00508d3bf0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00508d3bf0
--- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011e185a, rsp =
0x7fffffffe478, rbp = 0x7fffffffe4c0 ---

This is caused by marking the driver as active before it's fully
initialized, and thus calling xn_txq_mq_start with num_queues set to 0.

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D6646

8 years agoxen-netfront: switch to using an interrupt handler
royger [Thu, 2 Jun 2016 11:16:35 +0000 (11:16 +0000)]
xen-netfront: switch to using an interrupt handler

In order to use custom taskqueues we would have to mask the interrupt, which
is basically what is already done for an interrupt handler, or else we risk
loosing interrupts. This switches netfront to the same interrupt handling
that was done before multiqueue support was added.

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: always keep the Rx ring full of requests
royger [Thu, 2 Jun 2016 11:14:26 +0000 (11:14 +0000)]
xen-netfront: always keep the Rx ring full of requests

This is based on Linux commit 1f3c2eba1e2d866ef99bb9b10ade4096e3d7607c from
David Vrabel:

A full Rx ring only requires 1 MiB of memory.  This is not enough memory
that it is useful to dynamically scale the number of Rx requests in the ring
based on traffic rates, because:

a) Even the full 1 MiB is a tiny fraction of a typically modern Linux
   VM (for example, the AWS micro instance still has 1 GiB of memory).

b) Netfront would have used up to 1 MiB already even with moderate
   data rates (there was no adjustment of target based on memory
   pressure).

c) Small VMs are going to typically have one VCPU and hence only one
   queue.

Keeping the ring full of Rx requests handles bursty traffic better than
trying to converge on an optimal number of requests to keep filled.

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: fix receiving TSO packets
royger [Thu, 2 Jun 2016 11:12:11 +0000 (11:12 +0000)]
xen-netfront: fix receiving TSO packets

Currently FreeBSD is not properly fetching the TSO information from the Xen
PV ring, and thus the received packets didn't have all the necessary
information, like the segment size or even the TSO flag set.

Sponsored by: Citrix Systems R&D

8 years agoxen: rewrite Xen error translation
royger [Thu, 2 Jun 2016 07:45:01 +0000 (07:45 +0000)]
xen: rewrite Xen error translation

Using the public Xen error code header.

Submitted by: Akshay Jaggi <akshay1994.leo@gmail.com>
Reviewed by: royger

8 years agoxen: add missing #define in include guard.
royger [Thu, 2 Jun 2016 07:43:02 +0000 (07:43 +0000)]
xen: add missing #define in include guard.

Submitted by: Akshay Jaggi <akshay1994.leo@gmail.com>
Reviewed by: royger

8 years ago[iwm] valid_{tx,rx}_ant from radio_cfg is only needed for 8000 family.
adrian [Thu, 2 Jun 2016 06:22:59 +0000 (06:22 +0000)]
[iwm] valid_{tx,rx}_ant from radio_cfg is only needed for 8000 family.

* The "if (!data->valid_tx_ant || !data->valid_rx_ant) {" check was getting
  triggered with a 3165 chipset.

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD 3655dfb6fc311fc83e5ce8370dd91b4cd4a37991

8 years ago[iwm] Fix several nitpicks in iwm(4).
adrian [Thu, 2 Jun 2016 05:43:16 +0000 (05:43 +0000)]
[iwm] Fix several nitpicks in iwm(4).

    Move some declarations to if_iwmreg.h.
    Remove iwm_fw_alive(); just call iwm_post_alive() directly.
    Simplify iwm_mvm_add_sta().
    Return timeout error from iwm_apm_init().
    Print a message when init (i.e. boot) firmware fails to load.
    Remove some commented-out code which wouldn't compile anyway.
    Move iwm_mvm_tx_fifo to if_iwmreg.h to match better where Linux puts it.

    Taken-From: OpenBSD (if_iwm.c r1.80 and if_iwmreg.h r1.11)

Submitted by:  Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD 29fcb331e5620ae145a6ab9cdda830e22fff626a

8 years ago[iwm] Add bit-polling in Rx-DMA init code path.
adrian [Thu, 2 Jun 2016 05:00:52 +0000 (05:00 +0000)]
[iwm] Add bit-polling in Rx-DMA init code path.

    Taken-From: OpenBSD (if_iwm.c r1.80)

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD ed35558754288911048cb607e57c688273ebd8d4

8 years ago[iwm] Clean up iwm(4) scanning logic a bit.
adrian [Thu, 2 Jun 2016 04:54:56 +0000 (04:54 +0000)]
[iwm] Clean up iwm(4) scanning logic a bit.

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD 8f3ffab9136e33263d424275ec28f57ad2096437

8 years ago[iwm] Use IWM_MAX_CMD_PAYLOAD_SIZE to improve command length checks.
adrian [Thu, 2 Jun 2016 04:53:28 +0000 (04:53 +0000)]
[iwm] Use IWM_MAX_CMD_PAYLOAD_SIZE to improve command length checks.

  Taken-From: OpenBSD (parts of if_iwm.c r1.57 and if_iwmreg.h r1.10)

Obtained from: DragonflyBSD b70c1eaad06257c5c7f4d8110d21642ebec14f42

8 years ago[iwm] add if_iwm_led.c into the build.
adrian [Thu, 2 Jun 2016 04:42:45 +0000 (04:42 +0000)]
[iwm] add if_iwm_led.c into the build.

8 years ago[iwm] add LED blinking for iwm hardware that supports it.
adrian [Thu, 2 Jun 2016 04:42:28 +0000 (04:42 +0000)]
[iwm] add LED blinking for iwm hardware that supports it.

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD, Linux iwlwifi/mvm

8 years ago[ath] correctly shift the QCA9565 LNA config into the mci config variable.
adrian [Thu, 2 Jun 2016 04:25:54 +0000 (04:25 +0000)]
[ath] correctly shift the QCA9565 LNA config into the mci config variable.

Tested:

* QCA9565, STA + BT mode

8 years agoAddress feedback from hrs@ re: r301059 (ifconfig subnet mask)
allanjude [Thu, 2 Jun 2016 03:16:02 +0000 (03:16 +0000)]
Address feedback from hrs@ re: r301059 (ifconfig subnet mask)

- Use NI_MAXHOST to size buffers for getnameinfo()
- remove non-standard 'full' inet6 address printing
- remove 'no scope' option
- use strchr(3) to optimize replacing separator character in lladdrs

Reviewed by: gnn, jhb
Differential Revision: https://reviews.freebsd.org/D2856

8 years agoFix kernel build. Improper definition location of a variable.
gnn [Thu, 2 Jun 2016 01:59:41 +0000 (01:59 +0000)]
Fix kernel build.  Improper definition location of a variable.

8 years ago[ath] commit initial bluetooth coexistence support for the MCI NICs.
adrian [Thu, 2 Jun 2016 00:51:36 +0000 (00:51 +0000)]
[ath] commit initial bluetooth coexistence support for the MCI NICs.

This is the initial framework to call into the MCI HAL routines and drive
the basic state engine.

The MCI bluetooth coex model uses a command channel between wlan and
bluetooth, rather than a 2-wire or 3-wire signaling protocol to control things.
This means the wlan and bluetooth chip exchange a lot more information and
signaling, even at the per-packet level.  The NICs in question can share
the input LNA and output PA on the die, so they absolutely can't stomp
on each other in a silly fashion.  It also allows for the bluetooth side
to signal when profiles come and go, so the driver can take appropriate
control.  There's also the possibility of dynamic bluetooth/wlan duty cycle
control which I haven't yet really played with.

It configures things up with a static "wlan wins everything" coexistence,
configures up the available 2GHz channel map for bluetooth, sets a static
duty cycle for bluetooth/wifi traffic priority and drives the basics needed to
keep the MCI HAL code happy.

It doesn't do any actual coexistence except to default to "wlan wins everything",
which at least demonstrates that things do indeed work.  Bluetooth inquiry frames
still trump wifi (including beacons), so that demonstrates things really do
indeed seem to work.

Tested:

* AR9462 (WB222), STA mode + bt
* QCA9565 (WB335), STA mode + bt

TODO:

* .. the rest of coexistence.  yes, bluetooth, not people.  That stuff's hard.
* It doesn't do the initial BT side calibration, which requires a WLAN chip
  reset.  I'll fix up the reset path a bit more first before I enable that.
* The 1-ant and 2-ant configuration bits aren't being set correctly in
  if_ath_btcoex.c - I'll dig into that and fix it in a subsequent commit.
* It's not enabled by default for WB222/WB225 even though I believe it now
  can be - I'll chase that up in a subsequent commit.

Obtained from: Qualcomm Atheros, Linux ath9k

8 years agoBelatedly bump .Dd date for Dummynet AQM import in r300779.
truckman [Thu, 2 Jun 2016 00:42:15 +0000 (00:42 +0000)]
Belatedly bump .Dd date for Dummynet AQM import in r300779.

8 years agoAdd myself as src commiter.
landonf [Wed, 1 Jun 2016 23:20:32 +0000 (23:20 +0000)]
Add myself as src commiter.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D6686

8 years agoRemove the BUGS entry in memguard's man page.
markj [Wed, 1 Jun 2016 22:34:21 +0000 (22:34 +0000)]
Remove the BUGS entry in memguard's man page.

UMA refcounting is gone as of r296243, so this bug no longer exists. In
particular, it's now possible to guard mbuf clusters with memguard.

8 years agoFix memguard(9) in kernels with INVARIANTS enabled.
markj [Wed, 1 Jun 2016 22:31:35 +0000 (22:31 +0000)]
Fix memguard(9) in kernels with INVARIANTS enabled.

With r284861, UMA zones use the trash ctor and dtor by default. This is
incompatible with memguard, which frees the backing page when the item
is freed. Modify the UMA debug functions to be no-ops if the item was
allocated from memguard. This also fixes constructors such as
mb_ctor_pack(), which invokes the trash ctor in addition to performing
some initialization.

Reviewed by: glebius
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D6562

8 years agoImprove the English in a comment
asomers [Wed, 1 Jun 2016 22:21:42 +0000 (22:21 +0000)]
Improve the English in a comment

sys/cddl/contrib/opensolaris/uts/common/sys/acl.h:
Improve the english in a comment.  No functional changes

Submitted by: gibbs
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

8 years agoWhen we are in panic, always go the asynchronous path in g_mirror_destroy(),
glebius [Wed, 1 Jun 2016 22:11:54 +0000 (22:11 +0000)]
When we are in panic, always go the asynchronous path in g_mirror_destroy(),
otherwise the system will hang.

This is a temporarily least intrusive crutch to get certain panicing systems
dumping. The proper fix should question is g_mirror_destroy() should be called
on a panicing system at all.

Discussed with: mav

8 years agoImport NetBSD's blacklist source from vendor tree
lidl [Wed, 1 Jun 2016 22:04:10 +0000 (22:04 +0000)]
Import NetBSD's blacklist source from vendor tree

This import includes The basic blacklist library and utility programs,
to add a system-wide packet filtering notification mechanism to
FreeBSD.

The rational behind the daemon was given by Christos Zoulas in a
presentation at vBSDcon 2015: https://youtu.be/fuuf8G28mjs

Reviewed by: rpaulo
Approved by: rpaulo
Obtained from: NetBSD
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5912

8 years agothr_*(2): Add xrefs to what libthr implements using each syscall.
jilles [Wed, 1 Jun 2016 21:58:13 +0000 (21:58 +0000)]
thr_*(2): Add xrefs to what libthr implements using each syscall.

Add text to thr_exit(2) and thr_new(2) discouraging their use in
applications since calling these in a process with libthr loaded will
confuse libthr and is likely to cause hangs or crashes.

The thr_kill2(2) call is not used by libthr and may be useful in special
applications.

The other calls can be used in applications but it should not be necessary.

8 years agoTag import of NetBSD's external/bsd/blacklist
lidl [Wed, 1 Jun 2016 21:52:12 +0000 (21:52 +0000)]
Tag import of NetBSD's external/bsd/blacklist

Reviewed by: rpaulo
Approved by: rpaulo
Sponsored by: The FreeBSD Foundation

8 years agoReviewed by: rpaulo
lidl [Wed, 1 Jun 2016 21:48:22 +0000 (21:48 +0000)]
Reviewed by: rpaulo
Approved by: rpaulo
Obtained from: NetBSD external/bsd/blacklist @ 20160409
Relnotes: YES
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5912

8 years agoSkein was not meant to be connected to libcrypto
allanjude [Wed, 1 Jun 2016 20:55:25 +0000 (20:55 +0000)]
Skein was not meant to be connected to libcrypto

It is not a password hashing algorithm

Reported by: cem

8 years agoDon't call setgrent() in an unportable way.
ed [Wed, 1 Jun 2016 20:45:21 +0000 (20:45 +0000)]
Don't call setgrent() in an unportable way.

For FreeBSD 12, I'm considering updating setgrent() to have a function
prototype that conforms to POSIX. FreeBSD seems to be the only operating
system that lets setgrent() return an integer. It's also inconsistent
with setpwent().

It looks like our libcasper depends on setgrent() returning an integer.
Get rid of that.

Reviewed by: oshogbo
Differential Revision: https://reviews.freebsd.org/D6659

8 years agoRevert r301137 and r301163, and implement a correct fix
gjb [Wed, 1 Jun 2016 20:44:28 +0000 (20:44 +0000)]
Revert r301137 and r301163, and implement a correct fix
for the CONFS issue with dma.conf and ppp.conf.

Thank you very much to Bryan Drewery for looking into the
problem and providing this fix.

Pointyhat: gjb
Sponsored by: The FreeBSD Foundation

8 years agoIf the fast path unbusy in vm_page_replace() fails, slow path needs to
kib [Wed, 1 Jun 2016 20:39:00 +0000 (20:39 +0000)]
If the fast path unbusy in vm_page_replace() fails, slow path needs to
acquire the page lock, which recurses.  Avoid the recursion by reusing
the code from vm_page_remove() in a new helper
vm_page_xunbusy_maybelocked().

Reviewed by: alc
Sponsored by: The FreeBSD Foundation

8 years agoImplement a hack to re-enable installation of the dma.conf.
gjb [Wed, 1 Jun 2016 20:06:55 +0000 (20:06 +0000)]
Implement a hack to re-enable installation of the dma.conf.

The 'CONFS' entries in share/mk/bsd.confs.mk explicitly check
for the 'installconfig', but does not behave properly with the
'distribute' target.

This seems to be related to the previously-reported issues
with files within /etc in the past.

Reported by: Ben Woods
Sponsored by: The FreeBSD Foundation

8 years agoReplace constant expressions that contain multiplications by
truckman [Wed, 1 Jun 2016 20:04:24 +0000 (20:04 +0000)]
Replace constant expressions that contain multiplications by
fractional floating point values with integer divides.  This will
eliminate any chance that the compiler will generate code to evaluate
the expression using floating point at runtime.

Suggested by: bde
Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after: 8 days (with r300779 and r300949)

8 years agoFix the library name.
oshogbo [Wed, 1 Jun 2016 19:54:17 +0000 (19:54 +0000)]
Fix the library name.

Reviewed by: bdrewery

8 years agops(1): Expand variables to match expanded fields
cem [Wed, 1 Jun 2016 19:54:05 +0000 (19:54 +0000)]
ps(1): Expand variables to match expanded fields

ki_flag and ki_tdflag have been 'long', not 'int', since 2000 and 2005,
respectively.

Submitted by: Shawn Wills <swills at isilon dot com>
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument behavior of wait introduced in the r286698.
oshogbo [Wed, 1 Jun 2016 19:49:38 +0000 (19:49 +0000)]
Document behavior of wait introduced in the r286698.

Suggested by: glebius
Reviewed by: wblock, bjk
Differential Revision: https://reviews.freebsd.org/D6080

8 years agoiw_cxgbe: Fix panic that occurs when c4iw_ev_handler tries to acquire
np [Wed, 1 Jun 2016 18:46:54 +0000 (18:46 +0000)]
iw_cxgbe: Fix panic that occurs when c4iw_ev_handler tries to acquire
comp_handler_lock but c4iw_destroy_cq has already freed the CQ memory
(which is where the lock resides).

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

8 years agoMicrooptimize locking primitives by avoiding unnecessary atomic ops.
mjg [Wed, 1 Jun 2016 18:32:20 +0000 (18:32 +0000)]
Microoptimize locking primitives by avoiding unnecessary atomic ops.

Inline version of primitives do an atomic op and if it fails they fallback to
actual primitives, which immediately retry the atomic op.

The obvious optimisation is to check if the lock is free and only then proceed
to do an atomic op.

Reviewed by: jhb, vangyzen

8 years agoThe (i < PROMPTLEN - 1) test added by r300442 in the code for the default
truckman [Wed, 1 Jun 2016 16:56:29 +0000 (16:56 +0000)]
The (i < PROMPTLEN - 1) test added by r300442 in the code for the default
case of \c in the prompt format string is a no-op.  We already passed
this test at the top of the loop, and i has not yet been incremented in
this path.  Change this test to (i < PROMPTLEN - 2).

Reported by: Coverity
CID: 1008328
Reviewed by: cem
MFC after: 1 week

8 years agosed(1): Fix a mismatch and sync with the OpenBSD's commit.
pfg [Wed, 1 Jun 2016 16:53:02 +0000 (16:53 +0000)]
sed(1): Fix a mismatch and sync with the OpenBSD's commit.

This was causing some strange behaviour.

Reported by: olivier
Obtained from: OpenBSD (CVS rev. 1.28)

8 years agoRevert r289096:
gjb [Wed, 1 Jun 2016 16:45:08 +0000 (16:45 +0000)]
Revert r289096:

Files listed in 'CONFS' are not properly included in new
installations (missing from base.txz), for reasons I still
do not fully understand.

This reverts the change excluding /etc/ppp/ppp.conf from
a new installation.  /etc/dma/dma.conf is also affected,
but requires a different solution, still being investigated.

Reported by: Ben Woods
Sponsored by: The FreeBSD Foundation

8 years agolibthr: Use formatted PANIC()
cem [Wed, 1 Jun 2016 16:12:26 +0000 (16:12 +0000)]
libthr: Use formatted PANIC()

No functional change, although _thread_printf() may be slightly less functional
or render some values differently from libc snprintf(3).  No ABI change.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6672

8 years agolibthr: _thread_vprintf: Enhance support for %p, %#x
cem [Wed, 1 Jun 2016 16:11:09 +0000 (16:11 +0000)]
libthr: _thread_vprintf: Enhance support for %p, %#x

No functional change.  No ABI change.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6672

8 years agolibthr: Add vprintf variant of _thread_printf, formatted PANIC()
cem [Wed, 1 Jun 2016 16:09:56 +0000 (16:09 +0000)]
libthr: Add vprintf variant of _thread_printf, formatted PANIC()

No ABI change.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6672

8 years ago[ath_hal] add azimuth timestamp payload marking for AR9380 and later chips.
adrian [Wed, 1 Jun 2016 15:56:07 +0000 (15:56 +0000)]
[ath_hal] add azimuth timestamp payload marking for AR9380 and later chips.

8 years agourtwn: unbreak CTS-to-self protection mode.
avos [Wed, 1 Jun 2016 15:47:19 +0000 (15:47 +0000)]
urtwn: unbreak CTS-to-self protection mode.

Do not set HWRTSEN bit when CTS-to-self is used; CTS2SELF bit triggers
CTS frame transmission by itself (and it does not work when HWRTSEN bit
is set).

Tested with:
 * RTL8188CUS, HOSTAP mode (11g)
 * RTL8188EU, STA mode (11g)

8 years agoFix tzsetup not installing /etc/localtime for UTC
smh [Wed, 1 Jun 2016 15:39:11 +0000 (15:39 +0000)]
Fix tzsetup not installing /etc/localtime for UTC

If tzsetup UTC is run then it successfully configured the system for UTC
including installing /etc/localtime however if the user ran just tzsetup
for interactive configuration and select UTC no /etc/localtime was installed
which resulted in failures for utilities which require said file.

Change set_zone_utc to call install_zoneinfo("UTC") to ensure that
/etc/localtime is created for interactive UTC selection.

Users who have previously run tzsetup in interactive mode and select UTC
can install the missing /etc/localtime by running tzsetup -r.

Also correct static miss-match for set_zone_utc.

MFC after: 2 weeks
Relnotes: Yes
Sponsored by: Multiplay

8 years agoEnable filemon on all architectures.
bdrewery [Wed, 1 Jun 2016 15:19:49 +0000 (15:19 +0000)]
Enable filemon on all architectures.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agourtwn: fix non-ERP BSS detection in HOSTAP mode.
avos [Wed, 1 Jun 2016 14:57:53 +0000 (14:57 +0000)]
urtwn: fix non-ERP BSS detection in HOSTAP mode.

Receive all beacons in HOSTAP mode; they will give more information about
present non-ERP / legacy BSSs (used to choose protection mode).

Tested with RTL8188CUS (HOSTAP, urtwn) + RTL8821AU (HOSTAP, 11b mode).

8 years agosfxge(4): cleanup: remove unused variables in common code
arybchik [Wed, 1 Jun 2016 14:16:16 +0000 (14:16 +0000)]
sfxge(4): cleanup: remove unused variables in common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoAdd support for loadable kernel modules.
br [Wed, 1 Jun 2016 14:12:31 +0000 (14:12 +0000)]
Add support for loadable kernel modules.

Submitted by: Yukishige Shibata <y-shibat@mtd.biglobe.ne.jp>

8 years agosfxge(4): cleanup: add missing space after if keyword
arybchik [Wed, 1 Jun 2016 14:11:40 +0000 (14:11 +0000)]
sfxge(4): cleanup: add missing space after if keyword

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoBuild riscv modules as PIC.
br [Wed, 1 Jun 2016 14:05:32 +0000 (14:05 +0000)]
Build riscv modules as PIC.

Submitted by: Yukishige Shibata <y-shibat@mtd.biglobe.ne.jp>

8 years agoAdd a riscv define.
br [Wed, 1 Jun 2016 14:03:13 +0000 (14:03 +0000)]
Add a riscv define.

Submitted by: Yukishige Shibata <y-shibat@mtd.biglobe.ne.jp>

8 years agosfxge(4): set moderation in efx_ev_qcreate
arybchik [Wed, 1 Jun 2016 14:03:07 +0000 (14:03 +0000)]
sfxge(4): set moderation in efx_ev_qcreate

This simplifies setting an initial interrupt moderation value, and
avoids most calls to evx_ev_qmoderate from contexts where MCDI is
not allowed (MCDI is need for an EVQ timer workaround in a later patch).

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6673

8 years agoDon't build some modules on RISC-V.
br [Wed, 1 Jun 2016 13:43:43 +0000 (13:43 +0000)]
Don't build some modules on RISC-V.

Submitted by: Yukishige Shibata <y-shibat@mtd.biglobe.ne.jp>

8 years ago* Enable KDTRACE options as we support DTrace now.
br [Wed, 1 Jun 2016 12:19:00 +0000 (12:19 +0000)]
* Enable KDTRACE options as we support DTrace now.
* Add bpf device to kernel config.

8 years agoReduce the priority of cxgbei(4) driver, so it doesn't get chosen
trasz [Wed, 1 Jun 2016 12:04:04 +0000 (12:04 +0000)]
Reduce the priority of cxgbei(4) driver, so it doesn't get chosen
by default.  This is a workaround for a too simplistic ICL module
choosing mechanism.  To use it, specify offload in ctl.conf
or iscsi.conf.

This fixes a problem where "kldload cxgbei" wedges the iSCSI stack,
if you don't have a Chelsio card installed, or the endpoints of the
iSCSI session are not reachable through addresses configured
on that interface.

Reviewed by: np@
MFC after: 1 month

8 years agoDescribe default value for "offload".
trasz [Wed, 1 Jun 2016 11:45:06 +0000 (11:45 +0000)]
Describe default value for "offload".

MFC after: 1 month

8 years agoDon't use fixup for C99 and up, the compiler result is already correct.
ache [Wed, 1 Jun 2016 10:14:25 +0000 (10:14 +0000)]
Don't use fixup for C99 and up, the compiler result is already correct.

Suggested by: bde

MFC after:      1 week