SVNews

NOTE: This service is experimental and subject to change! Use at your own risk!

Year:   Month: - or - Filter committers: - or -
Filter paths:
Include diffs if smaller than lines.

2016 - 05 - 25   (today)
02:51:15 - r300643
( 22 minutes ago)
by truckman
Affects:  /head/bin/mv/mv.c
Close from_fd if malloc() fails to avoid a file descriptor leak.

Reported by: Coverity
CID: 1007203
MFC after: 1 week
02:10:30 - r300642
(1 hour 3 minutes ago)
by truckman
Affects:  /head/bin/sh/sh.1
Match the descriptions of the \H and \h prompt string sequences to reality.
They were swapped.

X-Confirmed by: jilles
MFC after: 1 week
01:48:44 - r300641
(1 hour 25 minutes ago)
by cy
Affects: 
(2 files)
/stable/10/contrib/ipfilter/man/ipf.5
MFC r300177 and r300179: fix two typos in man page.
01:37:39 - r300640
(1 hour 36 minutes ago)
by ken
Affects:  /head/sys/cam/ata/ata_da.c
Fix a few ada(4) driver issues:

 o Some Samsung drives do not support the ATA READ LOG EXT or READ
  LOG DMA EXT commands, despite indicating that they do in their
  IDENTIFY data. So, fix this in two ways:
  1. Only start the log directory probe (ADA_STATE_LOGDIR) if
  the drive claims to be an SMR drive in the first place.
  We don't need to do the extra probing for other devices.
  This will also serve to prevent problems with other
  drives that have the same issue.
  2. Add quirks for the two Samsung drives that have been
  reported so far (thanks to Oleg Nauman and Alex Petrov).
  If there is a reason to do a Read Log later on, we will
  know that it doesn't work on these drives.

 o Add a quirk entry to mark Seagate Lamarr Drive Managed drives as
  drive managed. They don't report this in their Identify data.

sys/cam/ata/ata_da.c:
  Add two new quirks:
  1. ADA_Q_LOG_BROKEN, for drives that claim to support Read
  Log but don't really.
  2. ADA_Q_SMR_DM, for drives that are Drive Managed SMR, but
  don't report it. This can matter for software that
  wants to know when it should make an extra effort to
  write sequentially.

  Record two Samsung drives that don't support Read Log, and
  one Seagate drive that doesn't report that it is a SMR drive.
  The Seagate drive is already recorded in the da(4) driver.

  We may have to come up with a similar solution in the da(4)
  driver for SATA drives that don't properly support Read Log.

  In adasetflags(), Dont' set the ADA_FLAG_CAN_LOG bit if the
  device has the LOG_BROKEN quirk set. Also, look at the
  SMR_DM quirk and set the device type accordingly if it is
  actually a drive managed drive.

  When deciding whether to go into the LOGDIR probe state,
  look to see whether the device claims to be an SMR device.
  If not, don't bother with the LOGDIR probe state.

Sponsored by: Spectra Logic
01:37:25 - r300639
(1 hour 36 minutes ago)
by truckman
Affects:  /head/usr.sbin/ypldap/aldap.c
/head/usr.sbin/ypldap/ber.c
/head/usr.sbin/ypldap/ldapclient.c
Fix Coverity CIDs 1340544 Resource leak and 1340543 Use after free

At line 479 of ldapclient.c in client_build_req(), the error return
leaks ldap_attrs (CID 1340544). It looks like this can happen if
the first utoa() call in aldap_get_stringset() fails. It looks
like other leaks can happen if other utoa() calls fail since scanning
this array when it is freed stops when the first NULL is encountered.
Fix these problems by not storing NULL in the array when utoa()
fails, and by freeing ret and returning NULL if nothing is stored
in the array. That way the caller will never see the
ldap_attrs[0] == NULL case, so delete that check.

The ber_printf_element() calls ber_free_elements() on its ber
argument and returns NULL on failure. When each of its callers
detects failure, they do a goto fail, which then calls ber_free_elements()
with the same pointer (CID 1340543). Fix is to delete the
ber_free_elements() from ber_printf_element()

Reported by: Coverity
CID: 1340543, 1340544
Reviewed by: araujo
Differential Revision: https://reviews.freebsd.org/D6550
01:35:02 - r300638
(1 hour 38 minutes ago)
by cy
Affects:  /head/etc/rc.d/ntpd
Use the expiry date to determine whether to replace the DB copy of
leapfile instead of using the leapfile serial number (create
timestamp).

PR: 209577
MFC after: 3 days
01:23:19 - r300637
(1 hour 50 minutes ago)
by jhibbits
Affects:  /head/sys/dev/dpaa/portals_common.c
Set the TLB caching properties for portals at attach time.

This was found while reworking the device tree nodes for dtsec to match the
Linux device tree. Instead of waiting and expecting later code to call
dpaa_portal_map_registers(), do the equivalent immediately upon mapping.
Otherwise, it's possible to access the pages before that function is called, and
hang the CPU.
00:25:38 - r300636
(2 hours 48 minutes ago)
by truckman
Affects:  /head/usr.sbin/ypserv/yp_dnslookup.c
Delay calling yp_malloc_dnsent() until after some additional sanity
checks to avoid leaking memory on error returns.

Reported by: Coverity
CID: 1007416
MFC after: 1 week
00:16:52 - r300635
(2 hours 56 minutes ago)
by truckman
Affects:  /head/usr.sbin/ypserv/yp_server.c
Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.

Reported by: Coverity
CID: 1007414
MFC after: 1 week
00:13:01 - r300634
(3 hours ago)
by cem
Affects:  /head/sys/boot/efi/loader/main.c
efi loader: Match format string to EFI_ERROR_CODE()

Silence a format specifier warning.

Sponsored by: EMC / Isilon Storage Division
2016 - 05 - 24   (yesterday)
23:41:36 - r300633
(3 hours 32 minutes ago)
by truckman
Affects:  /head/usr.sbin/acpi/acpidb/acpidb.c
Fix acpidb CIDs 1011279 (Buffer not null terminated) and 978405 and
1199380 (Resource leak).

load_dsdt() calls strncpy() to copy a filename and Coverity warns
that the destination buffer may not be NUL terminated. Fix this
by using strlcpy() instead. If silent truncation occurs, then the
filename was not valid anyway.

load_dsdt() leaks an fd (CID 978405) and a memory region allocated
using mmap() (CID 1199380) when it returns. Fix these by calling
close() and munmap() as appropriate.

Don't bother fixing the minor memory leak "list", allocated by
AcGetAllTablesFromFile() (CID 1355191).

Check for truncation when creating the temp file name.

Set a flag to indicate that the temp file should be unlinked.
Relying on a strcmp() test could delete the input file in contrived
cases.

Reported by: Coverity
CID: 1011279, 978405, 1199380
Reviewed by: jkim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6368
23:36:43 - r300632
(3 hours 37 minutes ago)
by truckman
Affects:  /head/usr.sbin/acpi/acpidump/acpi.c
Fix acpidump CID 1011278 (Buffer not null terminated) and other issues

Coverity reports that a buffer used for temporary file generation
might not be NUL terminated by strncpy(). This is probably not
true because the input gets passed through realpath(), but if the
path name is sufficiently long the name could be truncated and cause
other problems. The code for generating the temp file names is
also overly complex. Instead of a bunch of calls to strncpy() and
and strncat(), simplify the code by using snprintf() and add checks
for unexpected truncation.

The output file created by iasl -d is predictable. Fix this by
using mkdtemp() to create a directory to hold the iasl input and
output files.

Check the return values of more syscalls.

Reported by: Coverity
CID: 1011278
Reviewed by: jkim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6360
23:19:03 - r300631
(3 hours 54 minutes ago)
by bdrewery
Affects:  /head/share/man/man5/src.conf.5
Regenerate
23:15:52 - r300630
(3 hours 57 minutes ago)
by bdrewery
Affects:  /head/tools/build/options/WITH_META_MODE
WITH_META_MODE: Correct description of missing .meta file.

Sponsored by: EMC / Isilon Storage Division
23:04:16 - r300629
(4 hours 9 minutes ago)
by jhb
Affects: 
(8 files)
/stable/10/sys/conf/kmod.mk
/stable/8/sys/conf/kmod.mk
/stable/9/sys/conf/kmod.mk
MFC 299310:
Don't store generated firmware object files in the source directory.

Trim the leading directory of a firmware source file from the resulting
target object file name so the object file is stored in the object
directory. Previously, using 'FIRMWS= /path/to/fw.bin:fw.bin' would
store the generated 'fw.bin.fwo' file in the /path/to directory. Now
it stores it in the object directory of the kernel module being built.
21:20:17 - r300628
(5 hours 53 minutes ago)
by adrian
Affects: 
(13 files)
/head/sys/dev/bhnd/*
[bhnd] Normalize bhnd(4) device matching API

This unifies handling of core, chip, and board-level device
matching, and adds support for matching device drivers
against the bus attach type (e.g. SoC vs WiFi adapter).

Core-level quirks on Broadcom's chipsets generally are specific
to some combination of chip model, core revision, chip
package (e.g. 12x9 SMT package), SROM revision, etc.

Unifying the match APIs for all three attribute types (core, chip,
board/srom) allows defining a single device quirk table that
matches across all of those attributes.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6515
21:13:33 - r300627
(6 hours ago)
by kib
Affects:  /head/sys/kern/kern_event.c
Silence false LOR report due to the taskqueue mutex and kqueue lock
named the same.

Reported by: Doug Luce <doug@freebsd.con.com>
Sponsored by: The FreeBSD Foundation
21:09:05 - r300626
(6 hours 4 minutes ago)
by jhb
Affects:  /head/sys/kern/sys_socket.c
/head/tests/sys/aio/aio_test.c
Return the correct status when a partially completed request is cancelled.

After the previous changes to fix requests on blocking sockets to complete
across multiple operations, an edge case exists where a request can be
cancelled after it has partially completed. POSIX doesn't appear to
dictate exactly how to handle this case, but in general I feel that
aio_cancel() should arrange to cancel any request it can, but that any
partially completed requests should return a partial completion rather
than ECANCELED. To that end, fix the socket AIO cancellation routine to
return a short read/write if a partially completed request is cancelled
rather than ECANCELED.

Sponsored by: Chelsio Communications
20:06:41 - r300625
(7 hours 7 minutes ago)
by ngie
Affects:  /head/sys/rpc/svc.c
Remove unnecessary memset(.., 0, ..)'s

The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO)
under the covers, so zeroing out memory is already handled by the underlying
calls

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
19:52:05 - r300624
(7 hours 21 minutes ago)
by ngie
Affects:  /head/lib/libc/rpc/getnetconfig.c
Fix up r300385

I accidentally glossed over the fact that tmp is manipulated via strchr, so
if we tried to free `tmp` after r300385, it would have crashed.

Create a separate pointer (tmp2) to track the original allocation of `tmp`,
and free `tmp2` if `p->nc_lookups` can't be malloced

MFC after: 4 days
X-MFC with: r300385
Reported by: Coverity
CID: 1356026
Sponsored by: EMC / Isilon Storage Division
19:26:58 - r300623
(7 hours 46 minutes ago)
by asomers
Affects:  /projects/zfsd/head/cddl/usr.sbin/zfsd/case_file.cc
/projects/zfsd/head/etc/mtree/BSD.root.dist
/projects/zfsd/head/etc/mtree/BSD.var.dist
Move zfsd's case files to /var/db/zfsd/cases

It was never really appropriate to store these thing in /etc

cddl/usr.sbin/zfsd/case_file.cc
  Change the case file location

etc/mtree/BSD.root.dist
  Don't create /etc/zfs/cases

etc/mtree/BSD.var.dist
  Do create /var/db/zfsd/cases

Sponsored by: Spectra Logic Corp
19:20:30 - r300622
(7 hours 53 minutes ago)
by kib
Affects:  /head/sys/vm/vm_page.c
In vm_page_cache(), only drop the vnode after radix insert failure
for empty page cache when the object type if OBJT_VNODE.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
18:53:06 - r300621
(8 hours 20 minutes ago)
by ngie
Affects:  /head/lib/libc/rpc/clnt_bcast.c
Remove redundant NULLing of outbuf_pmap

If reallocf ever failed, outbuf_pmap would already be NULL

MFC after: 1 week
X-MFC with: r300620
Reported by: cem
Sponsored by: EMC / Isilon Storage Division
18:44:50 - r300620
(8 hours 28 minutes ago)
by ngie
Affects:  /head/lib/libc/rpc/clnt_bcast.c
Use reallocf instead of malloc to fix leak with outbuf_pmap

The previous code overwrote outbuf_pmap's memory with malloc once per
loop iteration, which leaked its memory; use reallocf instead to ensure
that memory is properly free'd each loop iteration.

Add a outbuf_pmap = NULL in the failure case to avoid a double-free
at the bottom of the function.

Differential Revision: https://reviews.freebsd.org/D6495
MFC after: 1 week
Reported by: Coverity
CID: 1038776
Reviewed by: markj, pfgj
Sponsored by: EMC / Isilon Storage Division
17:38:27 - r300619
(9 hours 35 minutes ago)
by bz
Affects:  /head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
Try to unbreak the build after r300611 by including the header
defining VM_MIN_KERNEL_ADDRESS.

Sponsored by: DARPA/AFRL
16:41:37 - r300618
(10 hours 32 minutes ago)
by br
Affects: 
(27 files)
/head/cddl/*
/head/sys/*
Add initial DTrace support for RISC-V.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
16:30:05 - r300617
(10 hours 43 minutes ago)
by br
Affects:  /head/sys/conf/Makefile.riscv
Set dependencies for genassym.c.
This fixes non-parallel build.
15:39:57 - r300616
(11 hours 33 minutes ago)
by adrian
Affects:  /head/sys/dev/bhnd/soc/bhnd_soc.c
[bhnd] fix compilation due to incompatible types

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6532
14:34:36 - r300615
(12 hours 39 minutes ago)
by trasz
Affects:  /head/sys/dev/iscsi/icl.c
Add kern.icl.iser_offloads sysctl.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
13:59:13 - r300614
(13 hours 14 minutes ago)
by br
Affects:  /head/sys/riscv/riscv/exception.S
Store the original value of stack pointer to the exception frame
(the value we had before supervisor exception occurred).
This helps consumers (e.g. DTrace) to not proceed additional calculations.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
13:58:07 - r300613
(13 hours 15 minutes ago)
by skreuzer
Affects:  /head/release/doc/en_US.ISO8859-1/relnotes/article.xml
Bump copyright year

Approved by: gjb@ (implicit)
13:57:23 - r300612
(13 hours 16 minutes ago)
by sbruno
Affects:  /head/sys/dev/an/if_an.c
Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
than sc->areq. This is a bounds check to ensure we're not just cramming
arbitrarily sized nonsense into the driver and overflowing the heap.

PR: 209545
Submitted by: cturt@hardenedbsd.org
MFC after: 2 weeks
13:57:23 - r300611
(13 hours 16 minutes ago)
by andrew
Affects:  /head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
Mark all memory before the kernel as toxic to DTrace.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
12:40:03 - r300610
(14 hours 33 minutes ago)
by mav
Affects:  /head/sys/dev/ntb/if_ntb/if_ntb.c
Re-enable write combining, disabled by default at r295486.

if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s
to 8-10Gbit/s on my tests.

MFC after: 1 week
12:20:23 - r300609
(14 hours 53 minutes ago)
by arybchik
Affects:  /head/sys/dev/sfxge/common/efsys.h
/head/sys/dev/sfxge/sfxge.c
sfxge(4): enable Medford support

Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6510
12:19:15 - r300608
(14 hours 54 minutes ago)
by arybchik
Affects:  /head/sys/dev/sfxge/sfxge_version.h
sfxge(4): bump driver version to the closest out-of-tree version

Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
12:16:57 - r300607
(14 hours 56 minutes ago)
by arybchik
Affects: 
(72 files)
/head/share/man/man4/sfxge.4
/head/sys/dev/sfxge/*
sfxge(4): cleanup: update copyright to 2016

Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6509
12:15:30 - r300606
(14 hours 58 minutes ago)
by arybchik
Affects:  /head/sys/dev/sfxge/common/efsys.h
/head/sys/dev/sfxge/common/efx_check.h
/head/sys/dev/sfxge/common/medford_nic.c
sfxge(4): provide option to disable not a local MAC address check

Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by: Laurence Evans <levans at solarflare.com>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6508
12:14:19 - r300605
(14 hours 59 minutes ago)
by arybchik
Affects:  /head/sys/dev/sfxge/common/ef10_ev.c
/head/sys/dev/sfxge/common/efx_ev.c
sfxge(4): be ready to receive events immediately after event queues are created

Submitted by: Mark Spender <mspender at solarflare.com>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6507
12:06:56 - r300604
(15 hours 6 minutes ago)
by andrew
Affects:  /head/sys/kern/subr_intr.c
Limit calling pmc_hook to when the interrupt comes while running userspace.
We may enable interrupts from within the callback, e.g. in a data abort
during copyin. If we receive an interrupt at that time pmc_hook will be
called again and, as it is handling userspace stack tracing, will hit a
KASSERT as it checks if the trapframe is from userland.

With this I can run hwpmc with intrng on a ThunderX and have it trace all
CPUs.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
11:47:14 - r300603
(15 hours 26 minutes ago)
by tuexen
Affects:  /head/sys/net/if_tun.h
Allow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires
changing the type on the mtu field in struct tuninfo from short to
unsigned short.
This is used, for example, by packetdrill to test with MTUs up to the
maximum value.

Differential Revision: 6452
11:44:43 - r300602
(15 hours 29 minutes ago)
by des
Affects:  /head/lib/libradius/radlib.h
The NAS-Identifier attribute is a string, not an integer.

MFC after: 1 week
10:46:23 - r300601
(16 hours 27 minutes ago)
by kib
Affects: 
(2 files)
/stable/10/sys/ufs/ffs/ffs_vfsops.c
MFC r300084:
Do enable io accounting for read-only mounts and mounts which are
remounted to writeable after initial read-only. Assign to
dev->si_mountpt earlier to account the accesses done at the mount
time.
10:41:34 - r300600
(16 hours 32 minutes ago)
by kib
Affects: 
(2 files)
/stable/10/sys/ufs/ffs/ffs_inode.c
MFC r300083:
If IO_SYNC was passed to ffs_truncate(), request synchronous inode
update from the final ffs_update().
10:39:55 - r300599
(16 hours 33 minutes ago)
by kib
Affects: 
(2 files)
/stable/10/sys/ufs/ufs/ufs_lookup.c
MFC r300082:
For async UFS mounts, shrink the directory asynchronously, at least do
not pass IO_SYNC to ffs_truncate() unneccessary.
10:36:33 - r300598
(16 hours 37 minutes ago)
by kib
Affects: 
(2 files)
/stable/10/sys/ufs/ffs/ffs_vfsops.c
MFC r300030:
Fix comments.
10:34:24 - r300597
(16 hours 39 minutes ago)
by kib
Affects: 
(2 files)
/stable/10/sys/ufs/ufs/ufs_lookup.c
MFC r300027:
Fix typo in the message.
10:21:39 - r300596
(16 hours 52 minutes ago)
by kib
Affects:  /head/sys/vm/vm_page.c
In vm_page_alloc_contig(), on vm_page_insert() failure, mark each
freed page as VPO_UNMANAGED. Otherwise vm_pge_free_toq() insists on
owning the page lock.

Previously, VPO_UNMANAGED was only set up to the last processed page.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
10:16:03 - r300595
(16 hours 57 minutes ago)
by kib
Affects:  /head/sys/vm/swap_pager.c
Remove Giant around allocation of the swap pager with non-NULL handle.
Existing issue of not protecting pager_object_list iteration in
vm_pager_object_lookup() by sw_alloc_mtx is not affected by Giant
removal.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
09:23:04 - r300594
(17 hours 50 minutes ago)
by kevlo
Affects:  /head/sys/compat/linuxkpi/common/include/linux/io.h
Add __iowrite32_copy() to the Linux kernel compatibility layer.

Reviewed by: hselasky
08:54:41 - r300593
(18 hours 19 minutes ago)
by trasz
Affects:  /head/sys/dev/iscsi/icl.c
Rename kern.icl.drivers to kern.icl.offloads, for consistency.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
08:44:45 - r300592
(18 hours 28 minutes ago)
by trasz
Affects: 
(6 files)
/head/sys/cam/ctl/ctl_frontend_iscsi.c
/head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
/head/sys/dev/iscsi/*
Add mechanism for choosing iSER-capable ICL modules.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
07:52:53 - r300591
(19 hours 20 minutes ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/src/linux_pci.c
Use the DROP_GIANT() and PICKUP_GIANT() macros instead of making
assumptions about how the Giant mutex is locked.

MFC after: 1 week
Sponsored by: Mellanox Technologies
07:46:20 - r300590
(19 hours 27 minutes ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/compat.h
/head/sys/compat/linuxkpi/common/src/linux_compat.c
/head/sys/compat/linuxkpi/common/src/linux_pci.c
Set "current" for all PCI enumeration callbacks.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
07:21:23 - r300589
(19 hours 52 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/cam/scsi/scsi_enc_safte.c
/stable/10/sys/cam/scsi/scsi_enc_ses.c
MFC r299373: Allow sleepable allocations in enclosure daemon threads.

There were at least two places where M_NOWAIT was used without NULL check.
This change should fix NULL-dereference panic there and possibly improve
operation in other ways under memory pressure.
07:19:52 - r300588
(19 hours 53 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/cam/ctl/ctl_tpc.c
MFC r299347, r299348: Validate XCOPY range offsets and lengths.
07:19:00 - r300587
(19 hours 54 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/cam/ctl/ctl_tpc.c
MFC r299346: More XCOPY parameters validation.
07:18:22 - r300586
(19 hours 55 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/cam/ctl/ctl_tpc.c
MFC r299329: Improve validation of some POPULATE TOKEN parameters.
07:17:09 - r300585
(19 hours 56 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/fb/vesa.c
MFC r300072: Fix NULL-dereference panic if VESA reports zero modes.
07:15:53 - r300584
(19 hours 57 minutes ago)
by mav
Affects: 
(4 files)
/stable/10/sys/dev/isp/isp_freebsd.c
/stable/10/sys/dev/isp/isp_target.c
/stable/10/sys/dev/isp/ispvar.h
MFC r300218: Add proper reporting for early task management errors.

This covers unknown requests and requests to unknown virtual ports.
Previously it "worked" only because of timeout handling on initiator.
07:15:10 - r300583
(19 hours 58 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp.c
MFC r300217: Add IOCB debugging for ISPCTL_RESET_DEV and ISPCTL_ABORT_CMD.
07:14:24 - r300582
(19 hours 59 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp_target.c
MFC r300157: Unify Multi ID target code by reusing isp_find_chan_by_did().
07:13:42 - r300581
(20 hours ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp.c
MFC r300058: Make RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable.

It is normal for ZOMBIE ports to be logged out. This status is not really
an error until Gone Device Timeout expires, so make CAM retry after delay.
07:12:53 - r300580
(20 hours ago)
by mav
Affects: 
(4 files)
/stable/10/sys/dev/isp/isp.c
/stable/10/sys/dev/isp/isp_library.c
/stable/10/sys/dev/isp/ispvar.h
MFC r300052: Completely remove broken now autologin port flag.

Firmware automatically logs in only to local loop ports, and those ports
can be easily identified without extra flag by zero domain and area IDs.
07:12:11 - r300579
(20 hours 1 minute ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp_freebsd.c
MFC r299957: Reduce verbosity of "now sending synthesized status" message.
07:11:31 - r300578
(20 hours 2 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp.c
MFC r299955: No need to check login status for ZOMBIE ports.

ZOMBIE ports are always logged out, and so initiator may try to relogin.
07:10:50 - r300577
(20 hours 2 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/isp/isp_target.c
MFC r299691: Fix FCP_CMD LENGTH mask in ATIO7 IOCB.

This caused "long IU length (16384) ignored" errors following by others.
07:07:11 - r300576
(20 hours 6 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
hyperv/vmbus: Free message taskqueue during interrupt teardown

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6506
07:06:04 - r300575
(20 hours 7 minutes ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/cdev.h
Use make_dev_s() instead of make_dev() to avoid race setting
"si_drv1". Convert panic() into regular error while at it.

Suggested by: jhb @
MFC after: 1 week
Sponsored by: Mellanox Technologies
06:42:14 - r300574
(20 hours 31 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
hyperv/vmbus: Factor out functions for vmbus interrupt set/teardown

This paves way for further cleanup and fix.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6505
06:10:21 - r300573
(21 hours 3 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_connection.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/head/sys/dev/hyperv/vmbus/vmbus_var.h
hyperv/vmbus: Git rid of sc version of pcpu data extraction macro

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6503
06:01:39 - r300572
(21 hours 12 minutes ago)
by sephe
Affects: 
(4 files)
/head/sys/dev/hyperv/vmbus/*
hyperv/vmbus: Use busdma(9) for messages and event flags

And
- Move message and event flags to vmbus_softc per-cpu data.
- Get rid of hv_setup_arg, which serves no purpose now.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6502
05:51:51 - r300571
(21 hours 21 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_hv.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
hyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file

Avoid unnecessary exposure.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6501
05:43:55 - r300570
(21 hours 29 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
hyperv/vmbus: Rename local variable and break long lines

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6500
05:29:41 - r300569
(21 hours 44 minutes ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_ioctl.c
Don't leak fp in case where fo_ioctl() returns an error.

Reported by: C Turt <ecturt@gmail.com>
MFC after: 1 week
05:26:52 - r300568
(21 hours 46 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hyperv_busdma.c
hyperv/busdma: Take BUS_DMA_ZERO into account

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6499
05:18:26 - r300567
(21 hours 55 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
hyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6498
05:11:55 - r300566
(22 hours 1 minute ago)
by ngie
Affects: 
(10 files)
/stable/9/contrib/bsnmp/snmp_usm/usm_snmp.c
/stable/9/contrib/bsnmp/snmpd/*
/stable/9/usr.sbin/bsnmpd/bsnmpd/Makefile
MFstable/10 r233128,r300561:

r233128 (by harti):

memset() wants the size of the structure to clear, not the size
of the pointer to it.

r300561:

MFC r299465,r299807,r299808,r299817,r299831,r299832,r300167:

r299465 (by cem):

bsnmp: Don't overrun privkey buffer by copying wrong size

The 'priv_key' array is SNMP_PRIV_KEY_SIZ bytes, not SNMP_AUTH_KEY_SIZ.

CIDs: 1008326, 1009675

r299807:

Replace QUADFMT with %ju and QUADXFMT with %jx and cast values with uintmax_t

This will cure some -Wformat warnings

r299808:

Use sizeof(..)s for the destination buffers instead of hardcoded values
corresponding
to the destination buffer sizes

r299817:

Use SNMPD_INPUT_FAILED instead of SNMP_CODE_FAILED

SNMPD_INPUT_FAILED is `enum snmpd_input_err` type (which matches the return
code from the function). SNMP_CODE_FAILED is `enum snmp_code` type.

r299831:

Remove NO_WERROR and add WARNS?= 6

This now compiles cleanly on all architectures

Tested with: clang 3.8, gcc 4.2.1, gcc 4.5, make tinderbox

r299832:

Remove trailing whitespace in license tort

r300167 (by glebius):

Revert r299830, it has couple of fatal errors.

The CMSG_ family of macros take care of alignment, so we don't need r299830
at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile.

Together with: peter
05:06:01 - r300565
(22 hours 7 minutes ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/head/sys/dev/hyperv/vmbus/vmbus_var.h
hyperv/vmbus: Move vmbus interrupt counter into vmbus softc

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6497
05:02:24 - r300564
(22 hours 11 minutes ago)
by truckman
Affects:  /head/usr.sbin/pw/pw_log.c
Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes

The length of the name returned from the $LOGNAME and $USER can be
very long and it was being concatenated to a fixed length buffer
with no bounds checking. Fix this problem by limiting the length
of the name copied.

Additionally, this name is actually used to create a format string
to be used in adding log file entries so embedded % characters in
the name could confuse *printf(), and embedded whitespace could
confuse a log file parser. Handle the former by escaping each %
with an additional %, and handle the latter by simply stripping it
out.

Clean up the code by moving the variable declarations to the top
of the function, formatting them to conform with style, and moving
intialization elsewhere.

Reduce code indentation by returning early in a couple of places.

Reported by: Coverity
CID: 1006692
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6490
04:58:58 - r300563
(22 hours 14 minutes ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
[bwn] begin separating out the attach path from the SIBA specific bits.

* convert phy_getinfo() to take a "gmode" flag, rather than the siba
  TGSHIGH flags and then check for 2GHz. This should ensure that
  gmode is set correctly even on DUALPHY NICs.
* move the siba_powerup() call and the TGSHIGH decoding into a
  call to bwn_is_bus_siba(), and return an error if it's called
  on anything else. We don't yet do anything else, but when we do..

Tested:

* BCM4322, 11a STA
04:55:00 - r300562
(22 hours 18 minutes ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn_pci.c
[bwn] add BCM43225 to the BHND device list.

This is all for the bhnd(4) work in progress. It's enough to probe/attach
all the bhnd internals, but we're missing OTP support and some cleanup
code. And, well, all the rest of the bhnd(4) migration.

So no, this won't give you BCM43225 support. Sorry!
04:49:58 - r300561
(22 hours 23 minutes ago)
by ngie
Affects: 
(6 files)
/stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c
/stable/10/contrib/bsnmp/snmpd/*
/stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile
MFC r299465,r299807,r299808,r299817,r299831,r299832,r300167:

r299465 (by cem):

bsnmp: Don't overrun privkey buffer by copying wrong size

The 'priv_key' array is SNMP_PRIV_KEY_SIZ bytes, not SNMP_AUTH_KEY_SIZ.

CIDs: 1008326, 1009675

r299807:

Replace QUADFMT with %ju and QUADXFMT with %jx and cast values with uintmax_t

This will cure some -Wformat warnings

r299808:

Use sizeof(..)s for the destination buffers instead of hardcoded values
corresponding
to the destination buffer sizes

r299817:

Use SNMPD_INPUT_FAILED instead of SNMP_CODE_FAILED

SNMPD_INPUT_FAILED is `enum snmpd_input_err` type (which matches the return
code from the function). SNMP_CODE_FAILED is `enum snmp_code` type.

r299831:

Remove NO_WERROR and add WARNS?= 6

This now compiles cleanly on all architectures

Tested with: clang 3.8, gcc 4.2.1, gcc 4.5, make tinderbox

r299832:

Remove trailing whitespace in license tort

r300167 (by glebius):

Revert r299830, it has couple of fatal errors.

The CMSG_ family of macros take care of alignment, so we don't need r299830
at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile.

Together with: peter
04:34:45 - r300560
(22 hours 38 minutes ago)
by ngie
Affects: 
(6 files)
/stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
/stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
/stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
MFC r299764,r299765,r299769,r299770,r299774,r299802,r299803,r299805,r299814:

r299764:

Use the size of the destination buffer, not the source buffer.

Technically this is a no-op, but mute the clang warning in case the malloc call
above for fstring ever changes in the future

r299765:

Fix theoretical buffer overflow issues in snmp_oid2asn_oid

Increase the size of `string` by 1 to account for the '\0' terminator. In the
event
that `str` doesn't contain any non-alpha chars, i would be set to MAXSTR, and
the subsequent strlcpy call would overflow by a character.

Remove unnecessary `string[i] = '\0'` -- this is already handled by strlcpy.

r299769:

Use the size of the destination buffer instead of the malloc size, repeated, in
order
to mute a -Wstrlcpy-strlcat-size warning

r299770:

Fix up r299764

I meant to use nitems, not sizeof(..) with the destination buffer. Using
sizeof(..)
on a pointer will always truncate the output in the destination buffer
incorrectly

Pointyhat to: ngie

r299774:

Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc

How errno is saved before and restored after strtoul calls needs a rethink

r299802:

Fix up both r299764 and r299770

nitems was wrong too, as it was being tested against a pointer instead of a
buffer on
the stack.

Since the old code was just doing malloc, then strlcpy'ing the contents of the
source
buffer into the destination buffer, replace it all with a call to strdup..

Supersized Duncecap to: ngie

r299803:

Replace malloc + memset(.., 0, ..) with calloc calls

r299805:

Fix up r299769

Similar to r299802, it was noted that using nitems on scalar pointers is
invalid.

Use strdup instead of malloc + strlcpy (which is what the old code was doing
anyhow).

Pointyhat to: ngie

r299814:

Replace malloc + memset(.., 0, ..) with calloc calls
04:23:58 - r300559
(22 hours 49 minutes ago)
by ngie
Affects: 
(5 files)
/stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
/stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/*
MFC
r299764,r299765,r299767,r299769,r299770,r299774,r299802,r299803,r299805,r299814:

r299764:

Use the size of the destination buffer, not the source buffer.

Technically this is a no-op, but mute the clang warning in case the malloc call
above for fstring ever changes in the future

r299765:

Fix theoretical buffer overflow issues in snmp_oid2asn_oid

Increase the size of `string` by 1 to account for the '\0' terminator. In the
event
that `str` doesn't contain any non-alpha chars, i would be set to MAXSTR, and
the subsequent strlcpy call would overflow by a character.

Remove unnecessary `string[i] = '\0'` -- this is already handled by strlcpy.

r299767:

Mute sign compare warning by casting rc to u_int to match nbindings' type

rc cannot be negative -- that was already tested for earlier on in
the function

r299769:

Use the size of the destination buffer instead of the malloc size, repeated, in
order
to mute a -Wstrlcpy-strlcat-size warning

r299770:

Fix up r299764

I meant to use nitems, not sizeof(..) with the destination buffer. Using
sizeof(..)
on a pointer will always truncate the output in the destination buffer
incorrectly

Pointyhat to: ngie

r299774:

Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc

How errno is saved before and restored after strtoul calls needs a rethink

r299802:

Fix up both r299764 and r299770

nitems was wrong too, as it was being tested against a pointer instead of a
buffer on
the stack.

Since the old code was just doing malloc, then strlcpy'ing the contents of the
source
buffer into the destination buffer, replace it all with a call to strdup..

Supersized Duncecap to: ngie

r299803:

Replace malloc + memset(.., 0, ..) with calloc calls

r299805:

Fix up r299769

Similar to r299802, it was noted that using nitems on scalar pointers is
invalid.

Use strdup instead of malloc + strlcpy (which is what the old code was doing
anyhow).

Pointyhat to: ngie

r299814:

Replace malloc + memset(.., 0, ..) with calloc calls
04:18:15 - r300558
(22 hours 55 minutes ago)
by ngie
Affects: 
(5 files)
/stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
/stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
MFstable/10 r300471:

MFC r299712,r299759,r299760,r299761,r299762:

r299712:

Fix some trivial clang/gcc warnings in bsnmptc.c

- By definition, `enum snmp_tc` can't be false (the implied starting sequence
  index for the enum is 0). Don't test for it being < 0.
- Staticize `struct snmp_text_conv` to mute a -Wmissing-variable-declarations
  warning from clang.
- Remove set but unused variable, ptr, in parse_bridge_id(..) and
  parse_bport_id(..) to mute warning from gcc 4.9+.
- Mark value and string unused in snmp_inetaddr2oct(..) and parse_inetaddr(..)
  as they're just stub functions.

r299759:

Use calloc instead of memset(.., 0, ..) + malloc

r299760:

Sort variables in parse_ascii(..) per style(9)

r299761:

parse_ascii: make count size_t to mute a -Wsign-compare issue

count is always unsigned.

r299762:

Mark snmptoolctx unused in parse_authentication(..), parse_privacy(..),
parse_context(..), and parse_user_security(..).
03:15:46 - r300557
(23 hours 57 minutes ago)
by peter
Affects:  /head/usr.sbin/apmd/apmd.c
/head/usr.sbin/apmd/apmdlex.l
/head/usr.sbin/apmd/apmdparse.y
It seems <sys/types.h> is a new prerequisite for <bitstring.h> after
r300539. Attempt to fix the build for i386.
03:13:27 - r300556
(1 day ago)
by jhb
Affects:  /head/sys/kern/sys_socket.c
/head/tests/sys/aio/aio_test.c
Don't prematurely return short completions on blocking sockets.

Always requeue an AIO job at the head of the socket buffer's queue if
sosend() or soreceive() returns EWOULDBLOCK on a blocking socket.
Previously, requests were only requeued if they returned EWOULDBLOCK
and completed no data. Now after a partial completion on a blocking
socket the request is queued and the remaining request is retried when
the socket is ready. This allows writes larger than the currently
available space on a blocking socket to fully complete. Reads on a
blocking socket that satifsy the low watermark can still return a short
read (same as read()).

In order to track previously completed data, the internal 'status'
field of the AIO job is used to store the amount of previously
computed data.

Non-blocking sockets continue to return short completions for both
reads and writes.

Add a test for a "large" AIO write on a blocking socket that writes
twice the socket buffer size to a UNIX domain socket.

Sponsored by: Chelsio Communications
03:08:32 - r300555
(1 day ago)
by pfg
Affects: 
(2 files)
/stable/10/usr.bin/sed/process.c
sed: rewrite the main loop.

Rewrite the main loop of the "sed s/..." command, shortening it by ten
lines and simplifying it by removing the switch statement implementing
/g, /1, and /2 separately and repetitively.

This will be needed to bring a fix from OpenBSD later.

Obtained from: OpenBSD (schwarze CVS Rev. 1.18)
03:00:24 - r300554
(1 day ago)
by pfg
Affects: 
(2 files)
/stable/9/usr.bin/sed/sed.1
MFV r299377:
sed.1: Correction for the case insensitive case.

Use the capital I instead of the lowercase.

Submitted by: Mikhail T.
02:57:13 - r300553
(1 day ago)
by pfg
Affects: 
(2 files)
/stable/10/usr.bin/sed/sed.1
MFV r299377:
sed.1: Correction for the case insensitive case.

Use the capital I instead of the lowercase.

Submitted by: Mikhail T.
02:44:44 - r300552
(1 day ago)
by kp
Affects: 
(2 files)
/stable/10/sys/netpfil/pf/pf_norm.c
MFC 300307:

pf: Fix fragment timeout

We were inconsistent about the use of time_second vs. time_uptime.
Always use time_uptime so the value can be meaningfully compared.

Submitted by: "Max" <maximos@als.nnov.ru>
01:42:21 - r300551
(1 day 1 hour ago)
by sbruno
Affects:  /head/sys/dev/ciss/ciss.c
Update some of the TBD entries in ciss(4) to match what's in the pci
IDS data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
01:33:49 - r300550
(1 day 1 hour ago)
by loos
Affects: 
(4 files)
/head/sys/conf/*
/head/sys/dev/*
Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
unrelated code.

Discussed with: nwhitehorn (a long time ago)
01:20:30 - r300549
(1 day 1 hour ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
/head/sys/dev/bwn/if_bwn_phy_common.c
[bwn] add extra debugging for non-SIBA devices.

This is a no-op at the present moment, but will eventually remind me
where the SIBA specific demons lie.

Tested:

* BCM4322, STA mode
01:12:19 - r300548
(1 day 2 hours ago)
by adrian
Affects: 
(20 files)
/head/sys/conf/files
/head/sys/dev/bhnd/*
/head/sys/modules/bhnd/*
[bhnd] Implement pass-through resource management for ChipCommon.

This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY
resources with its children, allowing us to hang devices off of
bhnd_chipc that rely on access to a subset of the device register space
that bhnd_chipc itself must also allocate.

We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY
wasn't limited to use with allocations at the same size/offset.

As a work-around, I implemented something similar to vga_pci.c, which
implements similar reference counting of of PCI BAR resources for its
children.

With these changes, chipc will use reference counting of SYS_RES_MEMORY
allocation/activation requests, to decide when to allocate/activate/
deactivate/release resources from the parent bhnd(4) bus.

The requesting child device is allocated a new resource from chipc's
rman, pointing to (possibly a subregion of) the refcounted bhnd resources
allocated by chipc.

Other resource types are just passed directly to the parent bhnd bus;
RF_SHAREABLE works just fine with IRQs.

I also lifted the SPROM device code out into a common driver, since this
now allows me to hang simple subclasses off of a common driver off of both
bhndb_pci and bhnd_chipc.

Tested:

* (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still
  attaches and can be queried.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: mizkha@gmail.com
Differential Revision: https://reviews.freebsd.org/D6471
00:57:11 - r300547
(1 day 2 hours ago)
by truckman
Affects: 
(9 files)
/head/*
Fix multiple Coverity Out-of-bounds access false postive issues in CAM

The currently used idiom for clearing the part of a ccb after its
header generates one or two Coverity errors for each time it is
used. All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON)
error because of the treatment of the header as a two element array,
with a pointer to the non-existent second element being passed as
the starting address to bzero(). Some instances also alsp generate
Out-of-bounds access (OVERRUN) errors, probably because the space
being cleared is larger than the sizeofstruct ccb_hdr).

In addition, this idiom is difficult for humans to understand and
it is error prone. The user has to chose the proper struct ccb_*
type (which does not appear in the surrounding code) for the sizeof()
in the length calculation. I found several instances where the
length was incorrect, which could cause either an actual out of
bounds write, or incompletely clear the ccb.

A better way is to write the code to clear the ccb itself starting
at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate
the length based on the specific type of struct ccb_* being cleared
as specified by the union ccb member being used. The latter can
normally be seen in the nearby code. This is friendlier for Coverity
and other static analysis tools because they will see that the
intent is to clear the trailing part of the ccb.

Wrap all of the boilerplate code in a convenient macro that only
requires a pointer to the desired union ccb member (or a pointer
to the union ccb itself) as an argument.

Reported by: Coverity
CID: 1007578, 1008684, 1009724, 1009773, 1011304, 1011306
CID: 1011307, 1011308, 1011309, 1011310, 1011311, 1011312
CID: 1011313, 1011314, 1011315, 1011316, 1011317, 1011318
CID: 1011319, 1011320, 1011321, 1011322, 1011324, 1011325
CID: 1011326, 1011327, 1011328, 1011329, 1011330, 1011374
CID: 1011390, 1011391, 1011392, 1011393, 1011394, 1011395
CID: 1011396, 1011397, 1011398, 1011399, 1011400, 1011401
CID: 1011402, 1011403, 1011404, 1011405, 1011406, 1011408
CID: 1011409, 1011410, 1011411, 1011412, 1011413, 1011414
CID: 1017461, 1018387, 1086860, 1086874, 1194257, 1229897
CID: 1229968, 1306229, 1306234, 1331282, 1331283, 1331294
CID: 1331295, 1331535, 1331536, 1331539, 1331540, 1341623
CID: 1341624, 1341637, 1341638, 1355264, 1355324
Reviewed by: scottl, ken, delphij, imp
MFH: 1 month
Differential Revision: https://reviews.freebsd.org/D6496
00:23:39 - r300546
(1 day 2 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Only set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk

Sponsored by: ScaleEngine Inc.
00:22:29 - r300545
(1 day 2 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Add support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot

Sponsored by: ScaleEngine Inc.
00:14:58 - r300544
(1 day 2 hours ago)
by asomers
Affects:  /head/sys/kern/subr_unit.c
/head/sys/sys/bitstring.h
Fix build of kern/subr_unit.c, broken by r300539

Reported by: peter
Pointyhat to: asomers
Sponsored by: Spectra Logic Corp
2016 - 05 - 23   (2 days ago)
23:00:47 - r300543
(1 day 4 hours ago)
by jkim
Affects:  /head/sys/amd64/amd64/pmap.c
Document POPCNT erratum for 6th Generation Intel Core processors.
22:01:06 - r300542
(1 day 5 hours ago)
by bapt
Affects:  /head/share/misc/pci_vendors
Update pci_vendors to 2016.05.23
21:58:47 - r300541
(1 day 5 hours ago)
by asomers
Affects:  /projects/zfsd/head/lib/libdevdctl/Makefile
/projects/zfsd/head/share/mk/src.libnames.mk
Make libdevdctl a private library.

libdevdctl's API wasn't designed to be stable. Rather than deal with
compatibility pain later, simply make it a private library.

lib/libdevdctl/Makefile
  set PRIVATELIB

share/mk/src.libnames.mk
  Add libdevdctl to _PRIVATELIBS

Sponsored by: Spectra Logic Corp
21:29:57 - r300540
(1 day 5 hours ago)
by bdrewery
Affects:  /head/share/man/man9/namei.9
Be more clear about LOCKLEAF being exclusive and add LOCKSHARED.
20:29:18 - r300539
(1 day 6 hours ago)
by asomers
Affects: 
(6 files)
/head/*
Add bit_count to the bitstring(3) api

Add a bit_count function, which efficiently counts the number of bits set in
a bitstring.

sys/sys/bitstring.h
tests/sys/sys/bitstring_test.c
share/man/man3/bitstring.3
  Add bit_alloc

sys/kern/subr_unit.c
  Use bit_count instead of a naive counting loop in check_unrhdr, used
  when INVARIANTS are enabled. The userland test runs about 6x faster
  in a generic build, or 8.5x faster when built for Nehalem, which has
  the POPCNT instruction.

sys/sys/param.h
  Bump __FreeBSD_version due to the addition of bit_alloc

UPDATING
  Add a note about the ABI incompatibility of the bitstring(3)
  changes, as suggested by lidl.

Suggested by: gibbs
Reviewed by: gibbs, ngie
MFC after: 9 days
X-MFC-With: 299090, 300538
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6255
20:19:07 - r300538
(1 day 6 hours ago)
by asomers
Affects:  /head/tests/sys/kern/Makefile
Commit a missing change from 299090

tests/sys/kern/Makefile
  Reenable a disabled compiler warning, the need for which was
  eliminated by r299090.

Reviewed by: ngie
MFC after: 4 weeks
X-MFC-With: 299090
Sponsored by: Spectra Logic Corp
20:18:11 - r300537
(1 day 6 hours ago)
by markj
Affects:  /head/sys/netinet6/nd6.c
Mark the prefix and default router list sysctl handlers MPSAFE.

MFC after: 2 weeks
20:15:08 - r300536
(1 day 6 hours ago)
by markj
Affects:  /head/sys/netinet6/nd6.c
Acquire the nd6 lock in the prefix list sysctl handler.

The nd6 lock will be used to synchronize access to the NDP prefix list.

MFC after: 2 weeks
Tested by: Jason Wolfe (as part of a larger change)
20:13:17 - r300535
(1 day 7 hours ago)
by ian
Affects:  /head/sys/arm/cavium/cns11xx/econa_machdep.c
Spaces->tab in comment.
20:12:38 - r300534
(1 day 7 hours ago)
by ian
Affects:  /head/sys/arm/arm/cpufunc_asm_xscale.S
Oops, fix a paste-o commited in r300533.
20:07:17 - r300533
(1 day 7 hours ago)
by ian
Affects: 
(10 files)
/head/sys/arm/*
Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses
where possible. In the places that doesn't work (multi-line inline asm,
and places where the old armv4 cpufuncs mechanism is used), annotate the
accesses with a comment that includes SCTLR. Now a grep -i sctlr can find
all the system control register manipulations.

No functional changes.
19:52:08 - r300532
(1 day 7 hours ago)
by ken
Affects:  /head/sys/cam/ata/ata_da.c
Fix ada(4) trim support quirk setting.

I broke broke the quirk in the ada(4) driver disabling NCQ trim support
in revision 300207. The support flags were set before the quirks were
loaded.

sys/cam/ata/ata_da.c:
  Call adasetflags() after loading quirks, so that we'll set the
  flags accurately.

Sponsored by: Spectra Logic
19:46:58 - r300531
(1 day 7 hours ago)
by cem
Affects:  /head/sys/dev/ntb/ntb_hw/ntb_hw.c
ntb_hw(4): Only record the first three MSIX vectors

Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

Reported by: mav (earlier version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6489
18:20:15 - r300530
(1 day 8 hours ago)
by asomers
Affects: 
(136 files)
/projects/zfsd/head/tests/sys/Makefile
/projects/zfsd/head/tests/sys/cddl/Makefile
/projects/zfsd/head/tests/sys/cddl/zfs/*
Update ZFS test suite Makefiles for the package base initiative

* Put a PACKAGE=tests line in every dir that installs files
* replace bsd.own.mk with src.opts.mk
* Replace FILES with ${PACKAGE}FILES
* Condtionalize the whole thing on MK_CDDL and MK_ZFS

Sponsored by: Spectra Logic Corp
18:16:21 - r300529
(1 day 8 hours ago)
by skra
Affects:  /head/sys/arm/freescale/imx/imx_gpio.c
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

Reviewed by: ian
18:12:52 - r300528
(1 day 9 hours ago)
by skra
Affects:  /head/sys/arm/freescale/imx/imx_gpio.c
INTRNG - use gpio generic interrupt modes definitions added in r298738.

Reviewed by: ian
17:41:53 - r300527
(1 day 9 hours ago)
by asomers
Affects: 
(4 files)
/projects/zfsd/head/lib/libdevdctl/*
Delete dead code from r266602

lib/libdevdctl/event_buffer.cc
lib/libdevdctl/event_buffer.h
lib/libdevdctl/reader.cc
lib/libdevdctl/reader.h
  These files should've been deleted in 266602

Sponsored by: Spectra Logic Corp
17:27:42 - r300526
(1 day 9 hours ago)
by bdrewery
Affects:  /head/share/mk/sys.mk
Properly allow META_MODE to be set from environment.

Sponsored by: EMC / Isilon Storage Division
17:11:32 - r300525
(1 day 10 hours ago)
by bdrewery
Affects:  /head/share/mk/bsd.compiler.mk
Use sed(1) to determine cc version rather than tail(1) since it is already in
ITOOLS.

This fixes 'tail: not found' warnings in installworld after r300351.

Sponsored by: EMC / Isilon Storage Division
17:06:46 - r300524
(1 day 10 hours ago)
by skreuzer
Affects:  /head/release/doc/en_US.ISO8859-1/relnotes/article.xml
Document r298998, OpenSSL updated to 1.0.2h.

Approved by: gjb@ (implicit with re@ hat on)
17:04:13 - r300523
(1 day 10 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Only export and re-import the root pool if installing on MBR

This step is required in order to dd the boot2 bits into the ZFS partition

Sponsored by: ScaleEngine Inc.
16:59:05 - r300522
(1 day 10 hours ago)
by alc
Affects:  /head/sys/vm/vm_fault.c
Correct an error in a comment: One of the conditions for page allocation
is actually the opposite of that stated in the comment.

Remove an unnecessary assignment. Use an assertion to document the fact
that no assignment is needed.

Rewrite another comment to clarify that the page is not completely valid.

Reviewed by: kib
16:49:26 - r300521
(1 day 10 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Fix missing pool name in zfs set command
16:37:04 - r300520
(1 day 10 hours ago)
by loos
Affects: 
(2 files)
/stable/10/sys/dev/amdtemp/amdtemp.c
MFC r298270:

Add PCI ID for family 10h model 30h to amdtemp(4).

This adds support to CPU found in PC Engines APU2 series.

Sponsored by: Rubicon Communications (Netgate)
16:24:34 - r300519
(1 day 10 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division
16:20:50 - r300518
(1 day 10 hours ago)
by loos
Affects: 
(2 files)
/stable/10/sys/netinet/ip_input.c
MFC r297985:

Do not overwrite the dchg variable.

It does not cause any real issues because the variable is overwritten
only when the packet is forwarded (and the variable is not used anymore).

Obtained from: pfSense
Sponsored by: Rubicon Communications (Netgate)
16:19:51 - r300517
(1 day 10 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic-long.h
Implement "atomic_long_add_unless()" in the LinuxKPI and fix the
implementation of "atomic_long_inc_not_zero()".

Found by: ngie @
MFC after: 1 week
Sponsored by: Mellanox Technologies
16:12:11 - r300516
(1 day 11 hours ago)
by mav
Affects:  /stable/10/sys/dev/ntb/if_ntb/if_ntb.c
/stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c
Add respective tunables to all sysctls.

This is direct commit to stable/10, since head does not need it any more.
16:02:54 - r300515
(1 day 11 hours ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_001_pos.ksh
Fix zfsd_hotspare_001_pos

tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_001_pos.ksh
  Relax a check_state operation. It was checking for a divergence
  "zpool status" output between FreeBSD and SpectraBSD that is
  probably unintentional. Now, the test can pass on both FreeBSD and
  SpectraBSD.

Sponsored by: Spectra Logic Corp
16:02:29 - r300514
(1 day 11 hours ago)
by loos
Affects: 
(2 files)
/stable/10/sbin/pfctl/parse.y
MFC r297984:

Make pfctl(8) more flexible when parsing bandwidth values.

This is the current behaviour in OpenBSD and a similar patch exist in
pfSense too.

Obtained from: OpenBSD (partly - rev. 1.625)
Sponsored by: Rubicon Communications (Netgate)
15:44:39 - r300513
(1 day 11 hours ago)
by skreuzer
Affects:  /head/release/doc/en_US.ISO8859-1/relnotes/article.xml
Document r296190, openresolv updated to 3.7.3.

Approved by: gjb@ (implicit with re@ hat on)
15:37:12 - r300512
(1 day 11 hours ago)
by skreuzer
Affects:  /head/release/doc/en_US.ISO8859-1/relnotes/article.xml
Document r298161, sqlite3 updated to 3.12.1.

Approved by: gjb@ (implicit with re@ hat on)
15:33:56 - r300511
(1 day 11 hours ago)
by skreuzer
Affects:  /head/release/doc/en_US.ISO8859-1/relnotes/article.xml
Document r298192, file(1) updated to 5.26.

Approved by: gjb@ (implicit with re@ hat on)
15:26:35 - r300510
(1 day 11 hours ago)
by andrew
Affects:  /head/sys/kern/subr_intr.c
Add the needed hwpmc hooks to subr_intr.c. This is needed for the correct
operation of hwpmc on, for example, arm64 with intrng.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
15:11:01 - r300509
(1 day 12 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Fix error in bsdinstall where additional filesystems cannot be mounted

Do not set canmount=noauto on the boot environment at create time, because
this causes / to not be mounted, and since the chroot is read only, new
mountpoints cannot be created.

The property is set later, when other properties are adjusted

Reported by: HardenedBSD
Sponsored by: ScaleEngine Inc.
13:59:48 - r300508
(1 day 13 hours ago)
by kp
Affects:  /head/sys/netpfil/pf/pf.c
pf: Fix more ICMP mistranslation

In the default case fix the substitution of the destination address.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week
13:19:20 - r300507
(1 day 13 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/time.h
A missing definition needed by ktime_to_ms().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
13:18:15 - r300506
(1 day 13 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/bitops.h
Fix some data types and add "inline" keyword for __reg_op() function.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
13:17:37 - r300505
(1 day 13 hours ago)
by arybchik
Affects:  /head/sys/dev/sfxge/common/efsys.h
sfxge(4): cleanup: remove unused EFX preempt macros

The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
12:58:24 - r300504
(1 day 14 hours ago)
by trasz
Affects:  /head/usr.sbin/iscsid/Makefile
Build iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
for iSER.

Obtained from: Mellanox Technologies
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
12:53:17 - r300503
(1 day 14 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/bitops.h
Implement ror32() in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:52:22 - r300502
(1 day 14 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/uaccess.h
Define more copy to/from userspace functions in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:41:29 - r300501
(1 day 14 hours ago)
by kp
Affects:  /head/sys/netpfil/pf/pf.c
pf: Fix ICMP translation

Fix ICMP source address rewriting in rdr scenarios.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week
12:35:07 - r300500
(1 day 14 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/kernel.h
Add more printf() related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:13:16 - r300499
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/src/linux_pci.c
Set an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:10:28 - r300498
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/ktime.h
Add more ktime related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:06:34 - r300497
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/kref.h
Implement "kref_put_mutex()" for the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
12:03:40 - r300496
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/list.h
/head/sys/compat/linuxkpi/common/src/linux_compat.c
Add more list_xxx() functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:57:23 - r300495
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/completion.h
Make header file standalone by including definitions for needed
linux_wait_xxx() functions.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:53:00 - r300494
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/io.h
Implement "_outb()" to the LinuxKPI for i386 and amd64 only.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:50:05 - r300493
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/cdev.h
Add support for "cdev_add_ext()" to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:47:54 - r300492
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/gfp.h
Add more GFP related defines to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:44:46 - r300491
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic-long.h
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
11:41:35 - r300490
(1 day 15 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/bitops.h
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
10:31:54 - r300489
(1 day 16 hours ago)
by hselasky
Affects:  /head/sys/kern/kern_synch.c
Use DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside
pause_sbt(). This allows pause() to continue working during a panic()
which is not invoking KDB. This is useful when debugging graphics
drivers using the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
09:44:06 - r300488
(1 day 17 hours ago)
by n_hibma
Affects:  /stable/10/sys/net/if.c
MFC 299559:

  Allow silencing of 'promiscuous mode enabled/disabled'
  messages.
07:32:34 - r300487
(1 day 19 hours ago)
by sephe
Affects: 
(4 files)
/head/sys/dev/hyperv/vmbus/*
hyperv/vmbus: Move IDT vector to vmbus_softc

Prepare to get rid of the hv_setup_arg.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6449
07:23:19 - r300486
(1 day 19 hours ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/head/sys/dev/hyperv/vmbus/vmbus_var.h
hyperv/vmbus: Get rid of vmbus_devp

While I'm here, nuke useless print in vmbus_attach().

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6447
07:21:16 - r300485
(1 day 19 hours ago)
by avg
Affects: 
(2 files)
/stable/9/sys/kern/vfs_subr.c
MFC r299916: vfs_read_dirent: increment ncookies after adding a cookie
07:21:01 - r300484
(1 day 19 hours ago)
by avg
Affects: 
(2 files)
/stable/10/sys/kern/vfs_subr.c
MFC r299916: vfs_read_dirent: increment ncookies after adding a cookie
07:17:53 - r300483
(1 day 19 hours ago)
by avg
Affects: 
(3 files)
/stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
MFC r300024: zfs_ioc_rename: fix a reversed condition

PR: 209093
07:15:23 - r300482
(1 day 19 hours ago)
by avg
Affects: 
(2 files)
/stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
MFC r300024: zfs_ioc_rename: fix a reversed condition

PR: 209093
07:14:04 - r300481
(1 day 19 hours ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_connection.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
hyperv/vmbus: Declare Synic message and event w/ proper types

Avoid ugly casts.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6446
07:06:53 - r300480
(1 day 20 hours ago)
by sephe
Affects: 
(4 files)
/head/sys/dev/hyperv/vmbus/*
hyperv: Move Hypercall setup to an early place.

It does not belong to the vmbus.

While I'm here rework the Hypercall setup, e.g. use busdma(9)
and avoid bit fields.

Discussed with: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6445
06:52:42 - r300479
(1 day 20 hours ago)
by sephe
Affects:  /head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
hyperv/hn: Use hyperv busdma(9) helper.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6444
06:35:11 - r300478
(1 day 20 hours ago)
by sephe
Affects: 
(5 files)
/head/sys/conf/*
/head/sys/dev/hyperv/*
/head/sys/modules/hyperv/vmbus/Makefile
hyperv: Add helpers for busdma(9) operation

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6443
06:13:35 - r300477
(1 day 21 hours ago)
by markj
Affects:  /user/alc/PQ_LAUNDRY/sys/vm/vm_page.c
/user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c
Run dirty pages through the inactive queue before the laundry queue.

This change modifies the active queue aging scan to place dirty pages in
the inactive queue rather than the laundry queue. vm_page_advise() is
modified similarly.

One side effect of this change is that dirty pages are given more time
to be reactivated instead of being paged out. However, this is not its
primary motivation. Pushing dirty pages through the inactive queue
establishes a temporal relationship between the inactive and laundry
queues and results in a more cohesive LRU page replacement mechanism. In
the absence of this change, the pagedaemon and laundry threads have
little information about each other's activity, and we can say little
about the relative ages of the pages at the beginning of the inactive
and laundry queues at a given point in time. However, in general we
would prefer to avoid laundering a given page until some number of clean
pages have been reclaimed in an attempt to satisfy a page shortage. The
implemented laundering policy uses the ratio of dirty to clean inactive
pages to set a minimum threshold for laundering, but without a shared
queue, we cannot be satisfied that all less-recently-used clean pages
have been reclaimed before deciding to launder a dirty page.

A downside to this change is that the pagedaemons are forced to expend
more CPU cycles handling dirty pages, as they must now examine dirty
pages twice. However, this cost is small relative to that of a swap
pageout. It may be reasonable to move vnode-backed pages directly to the
laundry queue, but this change aims to minimize differences in behaviour
with respect to HEAD.

Reviewed by: alc
06:04:38 - r300476
(1 day 21 hours ago)
by markj
Affects:  /user/alc/PQ_LAUNDRY/sys/sys/vmmeter.h
/user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c
Add a basic laundering policy.

This policy stems from the notion that there are two reasons to launder
pages:

1. Shortfall, in which the inactive and free queues are depleted, and
  the system must launder dirty pages in order to reclaim memory.

2. Fairness: the system should periodically launder dirty pages to
  ensure that applications cannot excessively influence the system's
  memory reclaimation behaviour. Note that this does not imply that
  clear and dirty pages must be treated equally: page laundering is an
  expensive operation. However, the relative costs of reclaiming a
  clean vs. dirty page should be bounded in some well-defined way, and
  in particular, it should not be possible to force the system to
  reclaim only clean pages indefinitely. Under memory pressure the
  system should eventually launder some dirty pages, even when inactive
  clean pages are plentiful.

Thus, laundering targets are chosen based on the current state of the
paging queues. In shortfall, the laundry thread attempts to meet the
shortfall within 0.5s, the pagedaemon sleep period. Because it is the
sole source of clean pages, no attempts are made to limit the laundering
rate: the laundry thread goes all-out.

If the system is not in shortfall, the laundry thread may elect to
launder some dirty pages in an attempt to satisfy the fairness policy.
This is referred to as background laundering. Several conditions must be
met for background laundering to occur:

a) The laundry queue must contain a significant amount of the system's
  inactive memory: if the number of dirty pages is miniscule, nothing
  is gained by laundering them. Moreover, write clustering works better
  if the number of dirty pages is allowed to grow to some threshold
  before any laundering is performed. The ratio of clean to dirty pages
  serves as a threshold here, controlled by bkgrd_launder_ratio. By
  default, dirty pages must constitute at least 1% of inactive memory
  for background laundering to occur.

b) The number of free pages must be low. If there is plentiful free
  memory, there's no reason to launder pages. The number of free pages
  must be smaller than bkgrd_launder_thresh for background laundering
  to occur. By default, this is chosen to be the max of half the free
  target and 3/2s of the pagedaemon wakeup threshold. The idea is to
  start laundering before the pagedaemon wakes up.

c) The pagedaemon thread(s) must be active. If the number of free pages
  is low but the system is not under memory pressure, we should not
  continue background laundering indefinitely. We use
  vm_cnt.v_pdwakeups as a proxy for pagedaemon activity: when a
  background laundering run begins, the pdwakeups value is recorded; a
  second run cannot begin until pdwakeups has been incremented at least
  once.

When the conditions for background laundering are met, the laundry
thread determines the target number of pages and begins laundering. It
attempts to meet the target within one second unless the corresponding
laundering rate would exceed bkgrd_launder_max (32MB/s by default). The
target is given by 0.5*l(L)*FT/l(I), where FT is the free page threshold
used by the pagedaemon. In particular, the number of pages laundered is
proportional to the ratio of dirty to clean inactive pages. When
performing background laundering, the pagedaemon counts reactivated
pages towards its target.

Reviewed by: alc
06:01:04 - r300475
(1 day 21 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
MFC r299710,r299711,r299763,r299783,r299811:

r299710:

Staticize global variables only used in bsnmpimport.c to fix
-Wmissing-variable-declarations warnings

r299711:

Fold two malloc + memset(.., 0, ..) calls into equivalent calloc calls

r299763:

Mute -Wstrlcpy-strlcat-size warning by using nitems with the size of the buffer

This is a no-op as the malloc above set the size of the buffer to the size used
below, but this keeps things consistent in case the malloc call changes somehow.

r299783:

Convert tok from enum tok to int32_t in function calls

get_token(..) returns int32_t, not enum tok, and in many cases tests for items
not in enum tok (e.g. '('). Make the typing consistent with get_token, which
includes a domino effect of changing enum tok to int32_t.

r299811:

Use strdup instead of malloc + strlcpy

Fix error messages on failure for calloc/strdup
05:52:47 - r300474
(1 day 21 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_bwn.c
[siba] update device ids.

Tested:

* BCM4322 11abgn, STA mode
05:45:52 - r300473
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/ncal/ncal.c
MFC r300005

swprintf() and apparently wcsftime() want the their output buffer size
specified in terms of the the number of wide characters and not
sizeof(buffer).

Reported by: Coverity
CID: 1007605, 1007606
05:43:59 - r300472
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/rarpd/rarpd.c
MFC r300002

When clearing rtmsg, pass &rtmsg to bzero() instead of the address of
just the header

Reported by: Coverity
CID: 1007568, 1194256
05:41:53 - r300471
(1 day 21 hours ago)
by ngie
Affects: 
(3 files)
/stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
/stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
MFC r299712,r299759,r299760,r299761,r299762:

r299712:

Fix some trivial clang/gcc warnings in bsnmptc.c

- By definition, `enum snmp_tc` can't be false (the implied starting sequence
  index for the enum is 0). Don't test for it being < 0.
- Staticize `struct snmp_text_conv` to mute a -Wmissing-variable-declarations
  warning from clang.
- Remove set but unused variable, ptr, in parse_bridge_id(..) and
  parse_bport_id(..) to mute warning from gcc 4.9+.
- Mark value and string unused in snmp_inetaddr2oct(..) and parse_inetaddr(..)
  as they're just stub functions.

r299759:

Use calloc instead of memset(.., 0, ..) + malloc

r299760:

Sort variables in parse_ascii(..) per style(9)

r299761:

parse_ascii: make count size_t to mute a -Wsign-compare issue

count is always unsigned.

r299762:

Mark snmptoolctx unused in parse_authentication(..), parse_privacy(..),
parse_context(..), and parse_user_security(..).
05:41:23 - r300470
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/ppp/link.c
MFC r299991

Don't walk off the end of the array when proto isn't explicitly
listed above. Instead update the catch-all "Others" bucket.

Reported by: Coverity
CID: 1007571, 1007572
05:38:40 - r300469
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/rpc.statd/file.c
MFC r299988

Set ai2 to NULL in in find_host() before the loop and after calling
freeaddrinfo() on it to indicate that it doesn't point to a valid
addrinfo list. This fixes this Coverity issues:
  1006368 Uninitialized pointer read
  1018506 Double free
  1305590 Resource leak
that can be triggered in the hp->hostname[0] != '\0' case.

Don't treat a character as a boolean.

Fix these Coverity issues:
  1009293 Unchecked return value from library
  1194246 Wrong size argument
by tweaking the status file extend code.

Reported by: Coverity
CID: 1006368, 1018506, 1305590, 1009293, 1194246
Reviewed by: rmacklem
Feedback from: hrs
Differential Revision: https://reviews.freebsd.org/D6398
05:37:45 - r300468
(1 day 21 hours ago)
by markj
Affects:  /user/alc/PQ_LAUNDRY/sys/vm/vm_page.c
Fix laundry queue handling when multiple domains are configured.

Currently, there is only a single laundry thread and it operates on
queues in domain 0. Therefore, when placing a page in PQ_LAUNDRY, it
should be placed in the PQ_LAUNDRY queue for domain 0.

Reviewed by: alc
05:31:53 - r300467
(1 day 21 hours ago)
by dchagin
Affects: 
(2 files)
/stable/10/sys/amd64/linux/linux_locore.s
MFC r299249:

Add a forgotten in r283424 .eh_frame section with CFI & FDE records to allow
stack unwinding through signal handler.
05:30:24 - r300466
(1 day 21 hours ago)
by ngie
Affects: 
(4 files)
/stable/9/sys/boot/i386/zfsboot/zfsboot.c
MFstable/10 r300464:

MFC r299659:

Remove unused const variable
05:28:03 - r300465
(1 day 21 hours ago)
by markj
Affects:  /user/alc/PQ_LAUNDRY/sys/vm/vm_page.c
Address over-eager OOM kills.

Prior to this change, vm_page_free_wakeup() and thus vm_page_free() would
clear vm_pages_needed when the free page count is above v_free_min. If the
pagedaemon is starved for pages to reclaim because of a runaway process or
because all inactive pages are dirty, but other threads are occasionally
freeing pages, and v_free_min <= v_free_count <= vm_pageout_wakeup_thresh,
concurrent vm_page_free() and vm_page_alloc() calls will respectively clear
and set vm_pages_needed, waking up the pagedaemon in the process. This can
cause the domain's oom_seq value to increment very quickly, leading to a
spurious OOM kill when the pagedaemon cannot find clean pages to reclaim in
the time that it takes for some pages to be laundered.

This can be triggered during multiple consecutive sysbench runs when it
writes mmap'ed files that are larger than system memory.

Fix the problem by modifying vm_page_free_wakeup() to only clear
vm_pages_needed once v_free_count has risen above vm_pageout_wakeup_thresh.

Reviewed by: alc
05:28:02 - r300464
(1 day 21 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/sys/boot/i386/zfsboot/zfsboot.c
MFC r299659:

Remove unused const variable
05:27:31 - r300463
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/rpc.lockd/lock_proc.c
MFC r299986

Actually use the loop interation limit so carefully computed on the
previous line to prevent buffer overflow. This turns out to not be
important because the upstream xdr code already capped the object
size at the proper value. Using the correct limit here looks a lot
less scary and should please Coverity.

Reported by: Coverity
CID: 1199309, 1199310
05:25:34 - r300462
(1 day 21 hours ago)
by ngie
Affects: 
(4 files)
/stable/9/sys/boot/i386/common/cons.h
MFstable/10 r300460:

MFC r299655:

Add missing prototype for getchar(..)
05:25:29 - r300461
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/chat/chat.c
MFC r299971

Fix off by one error that overflowed the rep_len array when doing
the final NUL termination.

Reported by: Coverity
CID: 1007617
05:23:53 - r300460
(1 day 21 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/sys/boot/i386/common/cons.h
MFC r299655:

Add missing prototype for getchar(..)
05:21:55 - r300459
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/makefs/mtree.c
MFC r299953

Fix an off by one error to avoid overflowing rp[].

Reported by: Coverity
CID: 1007579
05:19:37 - r300458
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/ldd/ldd.c
MFC r299952

Increase size of argv[] array to avoid running off the end.

Reported by: Coverity
CID: 1193819
05:15:06 - r300457
(1 day 21 hours ago)
by markj
Affects: 
(303 files)
/user/alc/PQ_LAUNDRY/*
MFH r300451
05:14:26 - r300456
(1 day 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/lib/libpam/modules/pam_unix/pam_unix.c
MFC r299948

Set retval in the empty password case to avoid a path through the
code that fails to set retval before falling through to the final
return().

Reported by: emaste
Reported by: Coverity
CID: 1018711
05:11:38 - r300455
(1 day 22 hours ago)
by sephe
Affects:  /head/sys/dev/hyperv/vmbus/hv_hv.c
/head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
hyperv: Move guest id setup to early place

And
- Rework the guest id composition.
- Nuke useless saved guest_id.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6430
05:11:31 - r300454
(1 day 22 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/lib/libc/tests/nss/testutil.h
MFC r299654:

Read the contents of the snapshot files properly

- Use fgetln instead of fgets; localize complexity related to fgetln(3)
  inside the loop.
- Skip over blank lines.
- Skip over lines (properly) that start with a "#"
05:11:08 - r300453
(1 day 22 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/lib/libpam/modules/pam_unix/pam_unix.c
MFC r299926

Hoist the getpwnam() call outside the first if/else block in
pam_sm_chauthtok(). Set user = getlogin() inside the true
branch so that it is initialized for the following PAM_LOG()
call. This is how it is done in pam_sm_authenticate().

Reported by: Coverity
CID: 272498
05:07:13 - r300452
(1 day 22 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/lib/libc/net/name6.c
MFC r299922

Don't call free_addrselectpolicy(&policyhead) before policyhead has been
initialized.

Reported by: Coverity
CID: 1018727
04:52:27 - r300451
(1 day 22 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/rpc.lockd/lockd_lock.c
MFC r299897

NULL releasedfl after calling deallocate_file_lock() which frees it
to avoid a use-after-free error in the debuglog() call at the top
of the loop.

Reported by: Coverity
CID: 1006080
04:50:01 - r300450
(1 day 22 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/ctld/login.c
MFC r299894

pdu_delete(request) frees request, so move the call after
login_new_response(request) to avoid a use-after-free error

Reported by: Coverity
CID: 1331219, 1331220
04:47:24 - r300449
(1 day 22 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/config/lang.l
MFC r299893

Don't free fnamebuf before we calling cfgfile_add(). This changes a
use-after-free error into a minor memory leak.

Reported by: Coverity
CID: 1006084
04:17:27 - r300448
(1 day 22 hours ago)
by adrian
Affects:  /head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
[bwn] convert another PHY-N workaround to the freebsd bwn format.

These were hidden behind an #ifdef that we weren't setting.

I don't have the hardware in question to check.
04:07:41 - r300447
(1 day 23 hours ago)
by ian
Affects:  /head/UPDATING
Add a note on how to update a self-hosted armv6hf system to the entry
describing the armv6hf->armv6 change.
03:51:15 - r300446
(1 day 23 hours ago)
by adrian
Affects:  /head/sys/dev/nvram2env/nvram2env.c
[nvram2env] fix nvram2env to scan all of memory, not 1/4th

The variable "size" stores number of words (4bytes). But the loop over
memory uses size as number of bytes to scan memory. As result it fetches
only 1/4th of memory.

This patch solves this problem and nvram2env fetches all NVRAM variables.

Test plan:

Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory

* Add "device nvram2env" into kernel configuration
* Specify hints: base is mandatory (according to nvram2env(4))

hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with
flags = 0x4)

* Build & load kernel with bootverbose

Actual result: only part of nvram variables are found
Expected result: all variables are found

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6466
03:47:44 - r300445
(1 day 23 hours ago)
by adrian
Affects: 
(10 files)
/head/sys/conf/files
/head/sys/dev/bhnd/*
/head/sys/modules/bhnd/bhndb/Makefile
[bhnd] Add support for querying the attachment type of the bhnd bus.

This adds a BHND_BUS_GET_ATTACH_TYPE(); the primary use-case is to let
chipc make a coarse-grained determination as to whether UART, SPI, etc
drivers ought to be attached, and on fullmac devices, whether a real
CPU driver ought to be skipped for the ARM core, etc.

Tested:

* BCM4331 (BHND)
* BCM4312 (SIBA)

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6492
03:46:36 - r300444
(1 day 23 hours ago)
by adrian
Affects:  /head/sys/dev/ixl/if_ixl.c
[ixl] fix build for RSS.

Untested.
03:29:43 - r300443
(1 day 23 hours ago)
by adrian
Affects:  /head/sys/sys/kobj.h
[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.

This diff updates DEFINE_CLASS_2/_3 to support the specification of class
name separately from the class variable name, bringing them into sync
with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.

Nothing in the tree currently uses the _2/_3 variants, and I can't
find any references to the API outside of commits to the kobj.h
header itself; given the limitation that currently exists, I'd
be surprised if they've ever been used.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D6491
01:01:23 - r300442
(2 days 2 hours ago)
by truckman
Affects:  /head/bin/sh/parser.c
Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.

Replace the magic constant 127 in the loop interation count with
"PROMPTLEN - 1".

gethostname() is not guaranteed to NUL terminate the destination
string if it is too short. Decrease the length passed to gethostname()
by one, and add a NUL at the end of the buffer to make sure the
following loop to find the end of the name properly terminates.

The default: case is the likely cause of Coverity CID 1008328. If
i is 126 at the top of the loop interation where the default case
is triggered, i will be incremented to 127 by the default case,
then incremented to 128 at the top of the loop before being compared
to 127 (PROMPTLENT - 1) and terminating the loop. Then the NUL
termination code after the loop will write to ps[128]. Fix by
checking for overflow before incrementing the index and storing the
second character in the buffer.

These fixes are not guaranteed to satisfy Coverity. The code that
increments i in the 'h'/'H' and 'w'/'W' cases may be beyond its
capability to analyze, but the code appears to be safe.

Reported by: Coverity
CID: 1008328
Reviewed by: jilles, cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6482
00:58:52 - r300441
(2 days 2 hours ago)
by kib
Affects: 
(3 files)
/stable/10/sys/amd64/amd64/sys_machdep.c
/stable/10/sys/i386/i386/sys_machdep.c
MFC r300305, r300332:
Check for overflow and return EINVAL if detected. Use unsigned index.
2016 - 05 - 22   (3 days ago)
23:28:23 - r300440
(2 days 3 hours ago)
by kib
Affects:  /head/sys/vm/swap_pager.c
Mark swap-related proc sysctls as not requiring Giant.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation
23:25:01 - r300439
(2 days 3 hours ago)
by kib
Affects:  /head/sys/vm/swap_pager.c
Replace hand-made exclusive lock, protecting against parallel
swapon/swapoff invocations, with sx.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation
21:31:20 - r300438
(2 days 5 hours ago)
by ian
Affects:  /head/share/mk/sys.mk
Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
It turns out we need to leave this in place for a while so that people
running self-hosting armv6hf systems can do the builds necessary to update
to armv6 (which is now hardfloat by default).
20:44:11 - r300437
(2 days 6 hours ago)
by rmacklem
Affects: 
(2 files)
/stable/10/etc/defaults/rc.conf
MFC: r299242
Make "-S" a default option for mountd.

After a discussion on freebsd-fs@ there seemed to be a consensus that
the "-S" option for mountd should become the default.
Since the only known issue w.r.t. using "-S" was fixed by r299201,
this commit adds "-S" to the default mountd_flags.
20:31:52 - r300436
(2 days 6 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
bsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT

In this configuration, a separate bootpool is not required.
This allows ZFS Boot Environments to be used with GELI encrypted ZFS pools.

Support for GPT+EFI+GELI is planned for the future.

Tested by: Joseph Mingrone, HardenedBSD
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5869
20:17:55 - r300435
(2 days 6 hours ago)
by pfg
Affects:  /head/gnu/usr.bin/grep/config.h
gnugrep: Update the configuration.

The only effect is that it will use our native iconv(3).

Relnotes: yes
20:12:07 - r300434
(2 days 7 hours ago)
by avos
Affects:  /head/sys/dev/urtwn/if_urtwn.c
urtwn: cleanup some unused code in urtwn_tx_data().

- Drop unused 'subtype' variable.
- Remove obsolete comment (hardware crypto support was added in r292175).
19:43:40 - r300433
(2 days 7 hours ago)
by avos
Affects:  /head/sys/dev/urtwn/if_urtwn.c
/head/sys/dev/urtwn/if_urtwnreg.h
urtwn: setup per-frame retry limit.

Override global retry limit (which is set in R92C_RL) via per-frame
TX descriptor field. Obsoletes D3840 (should work better with 2+ vaps).

Tested with RTL8188EU and RTL8192CUS in STA mode (maxretry = [3-9]).
19:25:53 - r300432
(2 days 7 hours ago)
by kib
Affects:  /head/sys/vm/vm_glue.c
Remove false claim. Giant is dropped by mi_startup() before passing
the control to swapper.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
19:08:29 - r300431
(2 days 8 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_socket.c
Convert proto family in both directions. The linux and native values for
local and inet are identical, but for inet6 values differ.

PR: 155040
Reported by: Simon Walton
MFC after: 2 week
19:06:38 - r300430
(2 days 8 hours ago)
by ngie
Affects:  /head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on
each line

As a positive side-effect, this eliminates the double semicolons reported by
Coverity:
the macro contained a trailing semicolon, in addition to the semicolon placed on
each line where EXPAND(..) was called.

MFC after: 1 week
Reported by: Coverity
CID: 1194269
Sponsored by: EMC / Isilon Storage Division
19:04:34 - r300429
(2 days 8 hours ago)
by dchagin
Affects:  /head/sys/sys/sysent.h
Remove a now unused global declaration of some sysentvec struct.

MFC after: 2 week
18:20:45 - r300428
(2 days 8 hours ago)
by ngie
Affects:  /head/usr.bin/kdump/kdump.c
Fix humanized decoding of struct stat with respect to .st_mtim

st_mtim was being incorrectly described as "stime=", not "mtime=". This was
introduced with the original feature commit (r176471).

MFC after: 1 week
PR: 209699
Submitted by: naddy
Sponsored by: EMC / Isilon Storage Division
18:16:25 - r300427
(2 days 8 hours ago)
by kib
Affects:  /head/sys/fs/cd9660/cd9660_vfsops.c
/head/sys/fs/udf/udf_vfsops.c
Remove drop/reacquire of Giant around geom calls for cd9660 and udf.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
18:16:04 - r300426
(2 days 8 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/usr.bin/kdump/kdump.c
Fix humanized decoding of struct stat with respect to .st_mtim

st_mtim was being incorrectly described as "stime=", not "mtime=". This was
introduced with the original feature commit (r176471).

MFC after: 1 week
PR: 209699
Submitted by: naddy
Sponsored by: EMC / Isilon Storage Division
16:24:21 - r300425
(2 days 10 hours ago)
by allanjude
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Fix default ZFS layout to work better by default with sysutils/beadm

The root file system is mounted early via vfs.root.mountfrom.
The canmount=noauto property only affects the zfs rc.d script.
This ensures that the 'default' BE is not mounted overtop of another BE when
one is selected from the beastie menu

Sponsored by: ScaleEngine Inc.
15:22:45 - r300424
(2 days 11 hours ago)
by ache
Affects:  /head/sys/dev/cpuctl/cpuctl.c
Improve panic message by specifying on which cpu it really is.
14:31:20 - r300423
(2 days 12 hours ago)
by kevlo
Affects: 
(4 files)
/head/sys/fs/ext2fs/*
/head/sys/ufs/ffs/*
arc4random() returns 0 to (2**32)−1, use an alternative to initialize
i_gen if it's zero rather than a divide by 2.

With inputs from delphij, mckusick, rmacklem

Reviewed by: mckusick
14:13:20 - r300422
(2 days 13 hours ago)
by pfg
Affects:  /head/sys/compat/ndis/subr_ntoskrnl.c
ndis(4): Undo unneeded workarounds in ndis' rand().

- Revert the change for seed(0) in r300384. I misunderstood the standard
and while our random() implementation in libkern may be improved, it
handles the seed(0) case fine.

Pointed out by: bde, ache
13:58:32 - r300421
(2 days 13 hours ago)
by loos
Affects: 
(15 files)
/head/sys/arm/*
/head/sys/dev/*
/head/sys/powerpc/powermac/*
Fix the deciKelvin to Celsius conversion in kernel.

After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C
reference and as result, the temperature read in sysctl(8) now exibits a
+0.1C difference.

This commit fix the kernel references to match the reference value used in
sysctl(8) after r285994.

Sponsored by: Rubicon Communications (Netgate)
13:32:45 - r300420
(2 days 13 hours ago)
by jilles
Affects:  /head/lib/libc/sys/vfork.2
vfork(2): Mention some risks of calling vfork() from application code.

MFC after: 1 week
13:10:48 - r300419
(2 days 14 hours ago)
by bapt
Affects:  /head/sys/kern/uipc_socket.c
Fix typo introduced by me (not the submitter) when fixing typos
13:04:45 - r300418
(2 days 14 hours ago)
by bapt
Affects:  /head/sys/kern/uipc_socket.c
Fix typos in the comments

Submitted by: cipherwraith666@gmail.com (via github)
12:59:07 - r300417
(2 days 14 hours ago)
by bapt
Affects:  /head/usr.sbin/bsdinstall/scripts/zfsboot
Fix typo in comments for the zfsboot script

Submitted by: Colby Swandale <colby@taplaboratories.com.au> (via github)
12:49:08 - r300416
(2 days 14 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_socket.c
Add a missing errno translation for SO_ERROR optname.

PR: 135458
Reported by: Stefan Schmidt @ stadtbuch.de
MFC after: 1 week
12:46:34 - r300415
(2 days 14 hours ago)
by dchagin
Affects: 
(5 files)
/head/sys/*
Add macro to convert errno and use it when appropriate.

MFC after: 1 week
12:37:40 - r300414
(2 days 14 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_futex.c
For future use move futex timeout code to the separate function and
switch to the high resolution sbintime_t.

MFC after: 1 week
12:35:50 - r300413
(2 days 14 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_futex.c
Due to lack the priority propagation feature replace sx by mutex. WIth this
commit NPTL tests are ends in 1 minute faster.

MFC after: 1 week
12:28:55 - r300412
(2 days 14 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_futex.c
Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup
while here.

MFC after: 1 week
12:26:03 - r300411
(2 days 14 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_file.c
Minor style(9) cleanup, no functional changes.

MFC after: 1 week
11:42:34 - r300410
(2 days 15 hours ago)
by skra
Affects:  /head/sys/arm/mv/mpic.c
INTRNG - implement pic_post_filter method. This method is fundamental
one and must always be implemented for a PIC. There is no default for
it intentionally.
09:59:43 - r300409
(2 days 17 hours ago)
by skra
Affects:  /head/sys/arm/freescale/imx/imx_gpio.c
Fix some format strings to make them either correct or uniform.
No functional change.
08:43:36 - r300408
(2 days 18 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/conf/files.amd64
/projects/vmware_pvscsi/sys/conf/files.i386
Add sys/conf entries for vmw_pvscsi
08:42:45 - r300407
(2 days 18 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/compat_freebsd.h
/projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
Fix compiling with i386 and INVARIANTS

Fix broken KASSERT and remove broken device_printf (was bogus)
08:20:30 - r300406
(2 days 18 hours ago)
by andrew
Affects:  /head/lib/csu/aarch64/crt1.c
Stop dereferencing _end in crt1.c. This was only needed for brk/sbrk so is
no longer needed.

Sponsored by: ABT Systems Ltd
07:50:10 - r300405
(2 days 19 hours ago)
by ngie
Affects: 
(3 files)
/projects/vmware_pvscsi/sys/modules/vmware/Makefile
/projects/vmware_pvscsi/sys/modules/vmware/pvscsi/Makefile
Rename sys/modules/vmware/vmw_pvscsi to sys/modules/vmware/pvscsi to
reduce redundancy in the name
07:39:25 - r300404
(2 days 19 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
Fix i386 compilation by casting longs to *intmax_t type and using appropriate
%j* format specifiers
07:33:19 - r300403
(2 days 19 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
Use the right version in the driver description
07:25:56 - r300402
(2 days 19 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/fbsd_list.h
Check in short-term shims for dealing with lists

This will be converted to queue(3) soon instead of handrolling queue(3)
07:24:59 - r300401
(2 days 19 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/compat_freebsd.h
virt_to_phys is duplicating vtophys; reduce complexity a tad
07:14:59 - r300400
(2 days 19 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
Apply some of the review feedback from https://reviews.freebsd.org/D4112
07:05:35 - r300399
(2 days 20 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
/projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.h
Remove Isilon specific features and make the kld compile with CURRENT

Some of the previous code was originally written for older versions of FreeBSD
07:04:33 - r300398
(2 days 20 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/compat_freebsd.h
Check in compat_freebsd.h

These compat shims are used to ease porting of the Linux driver to FreeBSD
06:18:59 - r300397
(2 days 20 hours ago)
by ache
Affects:  /head/lib/libc/stdlib/random.c
1) POSIX prohibits printing errors to stderr here and require
returning NULL:

"Upon successful completion, initstate() and setstate() shall return a
pointer to the previous state array; otherwise, a null pointer shall
be returned.

Although some implementations of random() have written messages to
standard error, such implementations do not conform to POSIX.1-2008."

2) Move error detections earlier to prevent state modifying.

MFC after: 1 week
04:28:55 - r300396
(2 days 22 hours ago)
by ngie
Affects: 
(3 files)
/projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.c
/projects/vmware_pvscsi/sys/dev/vmware/vmw_pvscsi/vmw_pvscsi.h
Commit the 1.0.1.0-k driver obtained from VMware under a BSD 2-clause license

Obtained from: Isilon OneFS
Sponsored by: EMC / Isilon Storage Division
04:17:00 - r300395
(2 days 22 hours ago)
by ngie
Affects: 
(13 files)
/head/contrib/top/*
Silence top(1) compiler warnings

The contrib/top code is no longer maintained upstream (last pulled 16 years
ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type
warnings, amongst others. This silences 131 warnings with as little modification
as possible by adding necessary return types, definitions, headers, and header
guards, and missing header includes.

The 5 warnings that remain are due to undeclared ncurses references. I didn't
include curses.h and term.h because there are several local functions and macros
that conflict with those definitions.

MFC after: 3 weeks
Reviewed by: cem, ngie
Submitted by: Randy Westlund <rwestlun@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6468
04:09:05 - r300394
(2 days 23 hours ago)
by loos
Affects:  /head/sys/dev/iicbus/iicbb_if.m
/head/sys/dev/iicbus/iiconf.c
Remove a couple of extra blank lines.
04:02:34 - r300393
(2 days 23 hours ago)
by loos
Affects:  /head/sys/dev/gpio/gpioiic.c
Sort and remove a couple of unnecessary headers.
03:55:57 - r300392
(2 days 23 hours ago)
by loos
Affects:  /head/sys/dev/gpio/gpioiic.c
/head/sys/dev/gpio/gpioled.c
Get rid of two consumers of gpiobus acquire/release.

The GPIO hardware should not be owned by a single device, this defeats any
chance of use of the GPIO controller as an interrupt source.

ow(4) is now the only consumer of this 'feature' before we can remove it
for good.

Discussed with: ian, bsdimp
03:34:18 - r300391
(2 days 23 hours ago)
by loos
Affects:  /head/sys/dev/gpio/gpioiic.c
Use a better prefix for defines, return BUS_PROBE_DEFAULT for probe routine.

Refuse to attach if the number of given pins is not enough for our needs.
03:12:49 - r300390
(3 days ago)
by loos
Affects:  /head/sys/dev/gpio/gpioled.c
Fix probe routine to return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.

While here fix a few style(9) issues.
03:05:27 - r300389
(3 days ago)
by ngie
Affects:  /head/lib/libc/rpc/getrpcent.c
nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..)

If the buffer couldn't be adequately resized to accomodate an additional "\n",
it would leak resultbuf by breaking from the loop early

MFC after: 2 weeks
Reported by: Coverity
CID: 1016702
Sponsored by: EMC / Isilon Storage Division
02:53:11 - r300388
(3 days ago)
by ngie
Affects:  /head/lib/libc/rpc/rpcb_clnt.c
Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf
was NULL

This would theoretically happen if the netconfig protocol family and protocol
semantics were never matched.

MFC after: 2 weeks
Reported by: Coverity
CID: 978179
Sponsored by: EMC / Isilon Storage Division
02:24:38 - r300387
(3 days ago)
by ngie
Affects:  /head/lib/libc/rpc/netnamer.c
getnetid(..): consistently fclose fd at the end of the function

This mutes a false positive with cppcheck, but also helps eliminate future
potential issues with this variable

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
02:02:18 - r300386
(3 days 1 hour ago)
by ngie
Affects:  /head/lib/libc/rpc/svc_generic.c
Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new
struct xlist object fails

MFC after: 1 week
Reported by: Coverity
CID: 978277
Sponsored by: EMC / Isilon Storage Division
01:45:15 - r300385
(3 days 1 hour ago)
by ngie
Affects:  /head/lib/libc/rpc/getnetconfig.c
Don't leak `tmp` if `p->nc_lookups` can't be malloced

MFC after: 1 week
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division
00:29:25 - r300384
(3 days 2 hours ago)
by pfg
Affects:  /head/sys/compat/ndis/subr_ntoskrnl.c
ndis(4): adjustments for our random() specific implementation.

- Revert r300377: The implementation claims to return a value
  within the range. [1]
- Adjust the value for the case of a zero seed, whihc according
  to standards should be equivalent to a seed of value 1.

Pointed out by: cem
2016 - 05 - 21   (4 days ago)
23:21:42 - r300383
(3 days 3 hours ago)
by avos
Affects:  /head/sys/net80211/ieee80211_scan_sw.c
net80211: send RTM_IEEE80211_SCAN event when scan was cancelled.

wpa_supplicant(8) expects to see 'scan complete' event after every
scan command; in case, when event is not sent it will hang for
indefinite time.

PR: 209198
23:18:23 - r300382
(3 days 3 hours ago)
by alc
Affects:  /head/sys/vm/vm_fault.c
When descending a shadow chain of objects, it makes no sense to update
the current offset (spelled: "fs.pindex") until it is known whether a
backing object exists. In fact, if not for the fact that the backing
object offset is zero when there is no backing object, this update would
produce a broken offset.

Reviewed by: kib
23:14:27 - r300381
(3 days 3 hours ago)
by ngie
Affects:  /projects/vmware_pvscsi
Copy ^/head to ^/projects/vmware_pvscsi

This is for the initial driver drop being done for the pvscsi driver from
EMC Isilon provided by VMware

This is being done to establish history for work initially posted on
Phabricator, and also to ease diffing for VMware for future versions, as
initial version is lagging the current released version a bit

See https://reviews.freebsd.org/D4112 for more details.

Discussed with: benno (EMC), Sean Evans (EMC), mp (VMware)
21:53:01 - r300380
(3 days 5 hours ago)
by ngie
Affects: 
(976 files)
/user/ngie/detangle-rc/*
MFhead @ r300379
20:50:25 - r300379
(3 days 6 hours ago)
by rmacklem
Affects: 
(2 files)
/stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c
MFC: r299226
Don't increment srvrpccnt[] for the NFSv4.1 operations.

When support for NFSv4.1 was added to the NFS server, it broke
the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't
have entries for the new NFSv4.1 operations.
Without this patch, the code was incrementing bogus entries in
newnfsstats for the new NFSv4.1 operations.
This patch is an interim fix. The nfsstats structure needs to be
updated and that will come in a future commit.
19:54:10 - r300378
(3 days 7 hours ago)
by pfg
Affects:  /head/lib/libc/regex/engine.c
libc/regex: fix two buffer underruns.

Fix some rather complex regex issues found on OpenBSD as part of some
ongoing work to fix a sed(1) bug.

Curiously the OpenBSD tests don't trigger segfaults on FreeBSD but the
bugs were confirmed by running a port of FreeBSD's regex under OpenBSD's
malloc. Huge thanks to Ingo for confirming the behavior.

Taken from: Ingo Schwarze (through openbsd-tech 2016-05-15)
MFC after: 1 week
17:52:44 - r300377
(3 days 9 hours ago)
by pfg
Affects:  /head/sys/compat/ndis/subr_ntoskrnl.c
ndis(4): Avoid overflow.

This is a long standing problem: our random() function returns an
unsigned integer but the rand provided by ndis(4) returns an int.
Scale it down.

MFC after: 2 weeks
17:38:43 - r300376
(3 days 9 hours ago)
by pfg
Affects:  /head/sys/compat/ndis/subr_ntoskrnl.c
ndis(4): Better mimic the behavior of rand() on Windows.

In ndis(4) we expose a rand() function that was constantly reseeding
with a time depending function every time it was called. This
essentially broke the reasoning behind seeding, and rendered srand()
a no-op.

Keep it simple, just use random() and srandom() as it's meant to work.
It would have been tempting to just go for arc4random() but we
want to mimic Microsoft, and we don't need crypto-grade randomness
here.

PR: 209616
MFC after: 2 weeks
16:52:38 - r300375
(3 days 10 hours ago)
by ian
Affects:  /head/sys/arm/include/_align.h
Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modern
compilers can emit arm instructions that require 8-byte alignment. The
alignment-sensitive instructions were added in armv5, which has to be
supported by our combined v4/v5 kernels, so the value is set uncoditionally
for all arm architecture versions.

Also adjust the comment to explain in more detail why the macros have the
form and values they do.

Per advice from bde@, maintain the unsignedness of the value of _ALIGNBYTES
(but do so using his second choice of allowing sizeof() to supply the
unsignedness, rather than just hardcoding '8U', which in my mind would
require an even more verbose comment to explain why it's right). Also
explain in the comment that the resulting type of _ALIGN() is equivelent
to uinptr_t on arm (32-bit unsigned int), but it's purposely spelled as
"unsigned" to avoid problems with including other header files. Even
including machine/_types.h to allow use of __uintptr_t causes compilation
failures because of this header being included (indirectly) in asm code.

The discussion that led to this change (albeit at a glacial pace) is at
https://lists.freebsd.org/pipermail/svn-src-head/2014-November/064593.html
15:38:40 - r300374
(3 days 11 hours ago)
by emaste
Affects:  /head/contrib/elftoolchain/brandelf/brandelf.c
/head/contrib/elftoolchain/elfcopy/main.c
/head/contrib/elftoolchain/readelf/readelf.c
elftoolchain: backwards compatability for ELFOSABI_CLOUDABI definition

It is not provided by sys/elf_common.h on older releases or -current
before March 2015.

Reported by: Jenkins
15:15:11 - r300373
(3 days 11 hours ago)
by mav
Affects: 
(6 files)
/stable/10/sys/conf/files.i386
/stable/10/sys/dev/ntb/if_ntb/if_ntb.c
/stable/10/sys/dev/ntb/ntb_hw/*
MFC 103 ntb(4) patches by cem@ up to r295487.
14:51:49 - r300372
(3 days 12 hours ago)
by avg
Affects:  /head/sys/kern/subr_taskqueue.c
/head/sys/sys/_task.h
/head/sys/sys/taskqueue.h
fix loss of taskqueue wakeups (introduced in r300113)

Submitted by: kmacy
Tested by: dchagin
11:40:41 - r300371
(3 days 15 hours ago)
by kib
Affects:  /head/sys/fs/msdosfs/msdosfs_vfsops.c
Same as for UFS, remove drop/reacquire of Giant, and use si_mountpt as
the mount semaphore.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
11:26:03 - r300370
(3 days 15 hours ago)
by trasz
Affects:  /head/sys/dev/iscsi/iscsi.c
Properly reset session state when using proxy and fail_on_disconnection=1.
Without it the reconnection would fail due to mismatched sequence numbers.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
11:10:48 - r300369
(3 days 16 hours ago)
by trasz
Affects: 
(4 files)
/head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
/head/sys/dev/iscsi/*
Provide a way for ICL modules to declare they support PIM_UNMAPPED.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
10:59:36 - r300368
(3 days 16 hours ago)
by trasz
Affects:  /head/sys/dev/iscsi/icl.h
/head/sys/dev/iscsi/iscsi.c
Pass maxtags value to the ICL module. iSER needs it.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
10:53:45 - r300367
(3 days 16 hours ago)
by hselasky
Affects: 
(1654 files)
/projects/hps_head/*
Merge ^/head r299262 through r300112.
10:13:25 - r300366
(3 days 17 hours ago)
by kib
Affects:  /head/sys/ufs/ffs/ffs_vfsops.c
Stop dropping and reacquiring Giant around geom calls in UFS.

Sponsored by: The FreeBSD Foundation
09:55:32 - r300365
(3 days 17 hours ago)
by kib
Affects:  /head/sys/fs/devfs/devfs_devs.c
Remove zero assignments in the cdev allocator. cdp memory is
requested with M_ZERO.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
09:49:35 - r300364
(3 days 17 hours ago)
by kib
Affects:  /head/sys/ufs/ffs/ffs_vfsops.c
Improve handling of rdev->si_mountpt on mount and unmount of FFS
volumes. Treat the field as a semaphore protecting availability of
the device for mounting. Do no access devvp->v_rdev without the vnode
lock owned.

Protect change of the devvp->v_bufobj bo_ops vector with the vnode
lock.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
09:27:30 - r300363
(3 days 17 hours ago)
by mm
Affects: 
(6 files)
/stable/9/contrib/libarchive/cpio/*
/stable/9/contrib/libarchive/libarchive/*
Backport security fix for absolute path traversal vulnerability in bsdcpio.

This is a direct commit to stable/9.

Vendor git commits:
59357157706d47c365b2227739e17daba3607526
199d5c79b547cebe3d7d33e5acd10ae03008c4a2

Security: CVE-2015-2304
09:24:02 - r300362
(3 days 17 hours ago)
by mm
Affects:  /stable/9/contrib/libarchive/libarchive/archive_write_disk.c
Backport security fix for integer signedness error in libarchive.
This is a direct commit to stable/9.

Upstream git commit: 22531545514043e04633e1c015c7540b9de9dbe4

Security: CVE-2013-0211
09:03:45 - r300361
(3 days 18 hours ago)
by mm
Affects: 
(6 files)
/stable/10/contrib/libarchive/cpio/*
/stable/10/contrib/libarchive/libarchive/*
Backport security fix for absolute path traversal vulnerability in bsdcpio.

This is a direct commit to stable/10.

Security: CVE-2015-2304
08:03:13 - r300360
(3 days 19 hours ago)
by dchagin
Affects: 
(15 files)
/head/sys/amd64/linux/*
/head/sys/amd64/linux32/*
/head/sys/i386/linux/*
Regen after r300359 (struct l_sched_param removal).

MFC after: 1 week
08:01:14 - r300359
(3 days 19 hours ago)
by dchagin
Affects:  /head/sys/amd64/linux/syscalls.master
/head/sys/amd64/linux32/syscalls.master
/head/sys/i386/linux/syscalls.master
Correct an argument param of linux_sched_* system calls as a struct
l_sched_param
does not defined due to it's nature.

MFC after: 1 week
02:31:38 - r300358
(4 days ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh
/projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_001_pos.ksh
/projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_002_pos.ksh
Improve the reliability of some zfsd functional tests

tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh
  Allow up to 20 seconds for the spare disk to detach after
  resilvering completes.

tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_001_pos.ksh
tests/sys/cddl/zfs/tests/zfsd/zfsd_degrade_002_pos.ksh
  Shrink the size of the test pool so checksum errors are more likely
  to be generated with a small amount of I/O.

Sponsored by: Spectra Logic Corp
02:29:35 - r300357
(4 days ago)
by asomers
Affects:  /projects/zfsd/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Fix the resource.fs.zfs.statechange message

It had a number of problems:

* It was only being emitted on a transition to the HEALTHY state. That
  made it impossible for zfsd to take actions based on drives getting
  sicker.
* It compared the new state to vdev_prevstate, which is the state that
  the vdev had the last time it was opened. That doesn't make sense,
  because a vdev can change state multiple times without being reopened.
* vdev_set_state contains logic that will change the device's new state
  based on various conditions. However, the statechange event was being
  posted _before_ that logic took effect. Now it's being posted after.

Sponsored by: Spectra Logic Corp
02:14:11 - r300356
(4 days ago)
by asomers
Affects:  /head/etc/defaults/periodic.conf
/head/usr.sbin/periodic/periodic.8
/head/usr.sbin/periodic/periodic.sh
Better document security_show_{success,info,badconfig} in /etc/periodic.conf

periodic(8) already handles the security_show_{success,info,badconfig}
variables correctly. However, those variables aren't explicitly set in
/etc/defaults/periodic.conf or anywhere else, which suggests to the user
that they shouldn't be used.

etc/defaults/periodic.conf
  Explicitly set defaults for security_show_{success,info,badconfig}

usr.sbin/periodic/periodic.sh
  Update usage string

usr.sbin/periodic/periodic.8
  Minor man page updates

One thing I'm _not_ doing is recommending setting security_output to
/var/log/security.log or adding that file to /etc/newsyslog.conf, because
periodic(8) would create it with default permissions, usually 644, and
that's probably a bad idea.

Reviewed by: brd
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6477
01:35:48 - r300355
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/man/man5/src.conf.5
Regenerate
01:32:23 - r300354
(4 days 1 hour ago)
by bdrewery
Affects: 
(4 files)
/head/Makefile.inc1
/head/share/mk/src.opts.mk
/head/tools/build/options/*
Opportunistically skip building a cross-compiler with SYSTEM_COMPILER set.

This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase. Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.

This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.

This is planned to be on-by-default eventually.

This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version. If they match then the
cross-compiler is skipped. If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped. As an extra
safety check the version number is also compared from the compiler to
the tree version.

Clang:
  The macro FREEBSD_CC_VERSION is defined in:
  lib/clang/include/clang/Basic/Version.inc
  For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This
  is from the current external toolchain logic. There is currently an
  assumption that the host compiler can build the TARGET_ARCH. This
  will usually be the case since we don't conditionalize target arch
  support in clang, but it will break when introducing new
  architectures. This problem is mitigated by incrementing the version
  when adding new architectures.

GCC:
  The macro FBSD_CC_VER is defined in:
  gnu/usr.bin/cc/cc_tools/freebsd-native.h
  For GCC there is no simple -target support when TARGET_ARCH !=
  MACHINE_ARCH. In this case the opportunistic skip is not done. If we
  add proper support for this case in external toolchain logic then it
  will be fine to enable.

This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files. It also should never
repeat earlier values.

Reviewed by: brooks, bapt, imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6357
01:32:20 - r300353
(4 days 1 hour ago)
by bdrewery
Affects:  /head/lib/clang/include/clang/Basic/Version.inc
Add FREEBSD_CC_VERSION which will be used to define __FreeBSD_cc_version.

The WITH_SYSTEM_COMPILER build option will rely on this value to determine what
__FreeBSD_cc_version the source tree will produce. This value will be compared
against the /usr/bin/cc value to determine if a new compiler is needed.

Start with 1100002 which is 1 more than than the value we've had since
3.8.0 to ensure that all changes since then are present.

Reviewed by: dim
Sponsored by: EMC / Isilon Storage Division
01:32:16 - r300352
(4 days 1 hour ago)
by bdrewery
Affects:  /head/Makefile.inc1
Enable external compiler logic if both bootstrap compilers are disabled.

Reviewed by: brooks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6358
01:32:13 - r300351
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/mk/bsd.compiler.mk
Fetch the __FreeBSD_cc_version as COMPILER_FREEBSD_VERSION.

Reviewed by: brooks, bapt, dim
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6356
01:32:10 - r300350
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/mk/bsd.compiler.mk
Auto determine X_COMPILER_TYPE/X_COMPILER_VERSION if XCC is set.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6355
01:32:07 - r300349
(4 days 1 hour ago)
by bdrewery
Affects:  /head/Makefile.inc1
Enable and utilize WITHOUT_CROSS_COMPILER logic for external CC.

This is a NOP.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6354
01:32:04 - r300348
(4 days 1 hour ago)
by bdrewery
Affects:  /head/Makefile.inc1
Move external toolchain support earlier.

This is to consolidate external toolchain and WITHOUT_CROSS_COMPILER support.

Reviewed by: brooks, bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6353
01:32:01 - r300347
(4 days 1 hour ago)
by bdrewery
Affects:  /head/gnu/usr.bin/cc/cc_tools/Makefile
WITH_META_MODE: Avoid rebuilds of cc_tools during target build.

This is the same as r299289 and r297997.

Sponsored by: EMC / Isilon Storage Division
01:31:57 - r300346
(4 days 1 hour ago)
by bdrewery
Affects:  /head/include/Makefile
WITH_META_MODE: Disable cookie handling for include installation.

Using a cookie with meta mode causes it to *not rerun* (as normal make
does) unless the command changes or filemon-detected files change.

After all of the work done here it turns out that skipping installation
is dangerous since the install commands use <dir>/*.h. The actual build
command is not changing but the files installed are changing by the mere
act of adding a new header into the source tree. Thus we cannot safely
use meta mode logic here. It must always rerun and install the headers.
The install -C flag at least prevents churning timestamps when
installing a header that was already present.

Sponsored by: EMC / Isilon Storage Division
01:31:54 - r300345
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/mk/src.sys.env.mk
WITH_META_MODE: Disable for 'make install' from top-level.

See r298220 for more explanation. We don't want to prevent installing
if a cookie exists for the install target.

Sponsored by: EMC / Isilon Storage Division
01:31:51 - r300344
(4 days 1 hour ago)
by bdrewery
Affects:  /head/Makefile.inc1
WITH_META_MODE: Use META_MODE rather than .MAKE.MODE for buildkernel.

This is mostly a style change so that other code does not duplicate
it. The problem is when META_MODE needs to be disabled but it has
been overridden by .MAKE.MODE.

Sponsored by: EMC / Isilon Storage Division
01:31:48 - r300343
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/mk/bsd.dep.mk
/head/sys/conf/kern.post.mk
WITH_META_MODE: Fix suffix transformation rules with guessed dependencies.

This is the same problem as r290629. With META_MODE we do not generate
.depend files, so there is no proper dependency to lookup. Guessed
dependencies must be used. If this proves to be a problem then we will
have to generate and use .depend files even with META_MODE.

Sponsored by: EMC / Isilon Storage Division
01:31:44 - r300342
(4 days 1 hour ago)
by bdrewery
Affects:  /head/share/mk/local.meta.sys.mk
WITH_DIRDEPS_BUILD: Fix forcing user to run bootstrap-tools.

This is a follow-up to r299289. If the user did not run bootstrap-tools
for this directory then just build the tool as normal. It assumes that
TARGET == MACHINE, but that was already the case before r299289.

Sponsored by: EMC / Isilon Storage Division
01:31:41 - r300341
(4 days 1 hour ago)
by bdrewery
Affects:  /head/lib/libc/gen/fts-compat.c
/head/lib/libc/gen/fts.c
FTS: Remove stale reference to nfs4 fs which was removed in r192578.

MFC after: 2 weeks
00:45:42 - r300340
(4 days 2 hours ago)
by pfg
Affects:  /head/bin/ed/cbc.c
ed(1): simplify by using arc4random_buf().

Suggested by: ed
00:43:10 - r300339
(4 days 2 hours ago)
by asomers
Affects:  /projects/zfsd/head/cddl/usr.sbin/zfsd/case_file.cc
Fix a crash bug in zfsd when destroying a pool with I/O errors

cddl/usr.sbin/zfsd/case_file.cc
  CaseFile::ReEvaluateByGuid was calling std::for_each on a std::list
  of CaseFiles. However, the functor would sometimes remove a
  CaseFile from the list, which caused a segfault in std::for_each.
  The solution is to remove the use of for_each. Instead, manually
  iterate through the list, taking care not to access potentially
  invalid iterators.

Sponsored by: Spectra Logic Corp
00:34:54 - r300338
(4 days 2 hours ago)
by asomers
Affects:  /projects/zfsd/head/lib/libdevdctl/event.cc
Fix zfsd where the timezone is not UTC

lib/libdevdctl/event.cc
  Fix a logic error in Event::TimestampEventString that was
  timestamping events in the local timezone instead of UTC. Also,
  simplify the code a bit.

Sponsored by: Spectra Logic Corp
2016 - 05 - 20   (5 days ago)
23:28:43 - r300337
(4 days 3 hours ago)
by jhb
Affects: 
(4 files)
/head/share/man/man9/*
/head/sys/kern/subr_sglist.c
/head/sys/sys/sglist.h
Add sglist functions for working with arrays of VM pages.

sglist_count_vmpages() determines the number of segments required for
a buffer described by an array of VM pages. sglist_append_vmpages()
adds the segments described by such a buffer to an sglist. The latter
function is largely pulled from sglist_append_bio(), and
sglist_append_bio() now uses sglist_append_vmpages().

Reviewed by: kib
Sponsored by: Chelsio Communications
23:08:22 - r300336
(4 days 4 hours ago)
by jhb
Affects:  /head/sys/dev/cxgbe/tom/t4_ddp.c
Move the KTR for the update of ddp_active_id on each completion under
VERBOSE_TRACES.

Sponsored by: Chelsio Communications
22:03:51 - r300335
(4 days 5 hours ago)
by asomers
Affects: 
(7 files)
/projects/zfsd/head/cddl/*
/projects/zfsd/head/etc/*
/projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt
Move zfsd from /sbin to /usr/sbin. It isn't needed at boot.

Sponsored by: Spectra Logic Corp
20:27:30 - r300334
(4 days 6 hours ago)
by emaste
Affects:  /head/contrib/elftoolchain/elfdump/elfdump.c
/head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c
/head/contrib/elftoolchain/readelf/readelf.c
elftoolchain: backwards compatability for EM_RISCV definition

It is not provided by sys/elf_common.h on older releases

Reported by: Jenkins
20:01:10 - r300333
(4 days 7 hours ago)
by pfg
Affects:  /head/contrib/binutils/gas/config/tc-arm.c
gas: Implement the .inst assembler directive for arm.

We normally use the binutils from ports but on other systems this
is required for building gcc 4.9.

Obtained from: OpenBSD (CVS rev. 1.5)
MFC after: 3 weeks
19:50:32 - r300332
(4 days 7 hours ago)
by kib
Affects:  /head/sys/amd64/amd64/sys_machdep.c
/head/sys/i386/i386/sys_machdep.c
Check for overflow and return EINVAL if detected. Backport this and
r300305 to i386.

PR: 209661
Reported and reviewed by: cturt
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
19:46:25 - r300331
(4 days 7 hours ago)
by jhb
Affects:  /head/sys/kern/sys_socket.c
/head/sys/kern/vfs_aio.c
Consistently set status to -1 when completing an AIO request with an error.

Sponsored by: Chelsio Communications
19:38:01 - r300330
(4 days 7 hours ago)
by imp
Affects:  /head/sys/boot/efi/loader/main.c
Large improvements to efi-show (though some weird problems
linger). We now print only printable characters for the
values and we print ascii strings as strings.
19:37:54 - r300329
(4 days 7 hours ago)
by imp
Affects:  /head/sys/boot/efi/loader/main.c
Implement efi-set and efi-unset
19:37:46 - r300328
(4 days 7 hours ago)
by imp
Affects:  /head/sys/boot/efi/loader/main.c
Cleanup to use %S.
19:30:53 - r300327
(4 days 7 hours ago)
by ken
Affects:  /head/lib/libmt/mtlib.c
/head/usr.bin/mt/mt.1
Add the density code for LTO-7 to libmt and the mt(1) man page.

The density code and bits per mm values were obtained from an
actual drive density report.

The number of tracks were obtained from an LTO-7 hardware
announcement on IBM's web site.

Sponsored by: Spectra Logic
MFC after: 3 days
19:25:57 - r300326
(4 days 7 hours ago)
by bdrewery
Affects:  /head/share/man/man5/src.conf.5
Regenerate
19:23:07 - r300325
(4 days 7 hours ago)
by bdrewery
Affects:  /head/tools/build/options/WITH_LIBSOFT
Add a WITH_LIBSOFT
19:18:32 - r300324
(4 days 7 hours ago)
by imp
Affects:  /head/sys/arm/include/param.h
Remove hf appending code from param.h for machine arch name.

Submitted by: ian@ andyt@
19:14:15 - r300323
(4 days 7 hours ago)
by emaste
Affects: 
(8 files)
/stable/10/lib/csu/*
MFC r292000: Remove historical GNUC test

The requirement is for a GCC-compatible compiler and not necessarily
GCC itself. However, we currently expect any compiler used for building
the whole of FreeBSD to be GCC-compatible and many things will break if
not; there's no longer a need to have an explicit test for this in csu.
19:10:29 - r300322
(4 days 8 hours ago)
by pfg
Affects:  /head/bin/ed/cbc.c
ed(1): Cleanups for the DES mode.

- Use arc4random_uniform(3).
- Prevent a segmentation fault when ed receives a signal
  while being in getpass(). [1]

Obtained from: OpenBSD [1] (CVS Rev. 1.15)
MFC after: 2 weeks
19:05:33 - r300321
(4 days 8 hours ago)
by emaste
Affects: 
(2 files)
/stable/10/gnu/lib/libgcc/Makefile
MFC r294935 (kan): Make .debug file for libgcc_s.so.1 more useful.

The files compiled into libgcc_s.so.1 did not have -g on
compiler command line, making generated .debug quite
pointless.

PR: 206381
18:54:42 - r300320
(4 days 8 hours ago)
by emaste
Affects: 
(4 files)
/head/contrib/elftoolchain/*
elftoolchain: backwards compatability for EM_IAMCU definition

It is not provided by sys/elf_common.h on older stable/10.
18:01:53 - r300319
(4 days 9 hours ago)
by pfg
Affects:  /head/contrib/gcc/c-typeck.c
GCC: Add support for named initializers for anonymous structs/unions.

Missing hunk from r300301.

Reported by: Ed Schouten
Obtained from: OpenBSD (CVS rev. 1.2)
18:00:10 - r300318
(4 days 9 hours ago)
by jhb
Affects:  /head/sys/x86/x86/nexus.c
Implement support for RF_UNMAPPED and bus_map/unmap_resource on x86.

Add implementations of bus_map/unmap_resource to the x86 nexus driver.
Change bus_activate/deactivate_resource to honor RF_UNMAPPED and to
use bus_map/unmap_resource to create/destroy the implicit mapping when
RF_UNMAPPED is not set.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D5237
17:57:47 - r300317
(4 days 9 hours ago)
by jhb
Affects: 
(12 files)
/head/share/man/man9/*
/head/sys/*
Add new bus methods for mapping resources.

Add a pair of bus methods that can be used to "map" resources for direct
CPU access using bus_space(9). bus_map_resource() creates a mapping and
bus_unmap_resource() releases a previously created mapping. Mappings are
described by 'struct resource_map' object. Pointers to these objects can
be passed as the first argument to the bus_space wrapper API used for bus
resources.

Drivers that wish to map all of a resource using default settings
(for example, using uncacheable memory attributes) do not need to change.
However, drivers that wish to use non-default settings can now do so
without jumping through hoops.

First, an RF_UNMAPPED flag is added to request that a resource is not
implicitly mapped with the default settings when it is activated. This
permits other activation steps (such as enabling I/O or memory decoding
in a device's PCI command register) to be taken without creating a
mapping. Right now the AGP drivers don't set RF_ACTIVE to avoid using
up a large amount of KVA to map the AGP aperture on 32-bit platforms.
Once RF_UNMAPPED is supported on all platforms that support AGP this
can be changed to using RF_UNMAPPED with RF_ACTIVE instead.

Second, bus_map_resource accepts an optional structure that defines
additional settings for a given mapping.

For example, a driver can now request to map only a subset of a resource
instead of the entire range. The AGP driver could also use this to only
map the first page of the aperture (IIRC, it calls pmap_mapdev() directly
to map the first page currently). I will also eventually change the
PCI-PCI bridge driver to request mappings of the subset of the I/O window
resource on its parent side to create mappings for child devices rather
than passing child resources directly up to nexus to be mapped. This
also permits bridges that do address translation to request suitable
mappings from a resource on the "upper" side of the bus when mapping
resources on the "lower" side of the bus.

Another attribute that can be specified is an alternate memory attribute
for memory-mapped resources. This can be used to request a
Write-Combining mapping of a PCI BAR in an MI fashion. (Currently the
drivers that do this call pmap_change_attr() directly for x86 only.)

Note that this commit only adds the MI framework. Each platform needs
to add support for handling RF_UNMAPPED and thew new
bus_map/unmap_resource methods. Generally speaking, any drivers that
are calling rman_set_bustag() and rman_set_bushandle() need to be
updated.

Discussed on: arch
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D5237
17:41:12 - r300316
(4 days 9 hours ago)
by jhb
Affects:  /head/ObsoleteFiles.inc
Drop trailing asterisks.
17:38:51 - r300315
(4 days 9 hours ago)
by trasz
Affects:  /head/sys/dev/iscsi/icl_soft.c
/head/sys/dev/iscsi/iscsi.c
Call the ICL module's handoff method even when using ICL proxy.
The upcoming iSER code uses this.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
17:38:45 - r300314
(4 days 9 hours ago)
by dim
Affects:  /head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
Pull in r270240 from upstream clang trunk (by me):

  Make __FreeBSD_cc_version predefined macro configurable at build time

  The `FreeBSDTargetInfo` class has always set the `__FreeBSD_cc_version`
  predefined macro to a rather static value, calculated from the major OS
  version.

  In the FreeBSD base system, we will start incrementing the value of this
  macro whenever we make any signifant change to clang, so we need a way
  to configure the macro's value at build time.

  Use `FREEBSD_CC_VERSION` for this, which we can define in the FreeBSD
  build system using either the `-D` command line option, or an include
  file. Stock builds will keep the earlier value.

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

Follow-up commits will start using the __FreeBSD_cc_version to determine
whether a bootstrap compiler has to be built during buildworld.
17:35:39 - r300313
(4 days 9 hours ago)
by sjg
Affects: 
(46 files)
/head/contrib/bmake/*
/head/usr.bin/bmake/Makefile
Merge bmake-20160512
17:25:36 - r300312
(4 days 9 hours ago)
by mav
Affects: 
(5 files)
/stable/10/sys/dev/ahci/ahci_pci.c
/stable/10/sys/dev/sound/pci/hda/*
/stable/10/sys/dev/usb/controller/xhci_pci.c
MFC r298983: Add some device IDs from Intel Sunrise Point chipsets.
17:24:34 - r300311
(4 days 9 hours ago)
by emaste
Affects: 
(39 files)
/head/contrib/elftoolchain/*
/head/lib/libelftc/*
Update to ELF Tool Chain r3475

Improvements include:

 * Add support for reporting and handling a number of new constants in
  various tools, including:
  * CloudABI OSABI
  * DT_TLSDESC_*
  * i386, MIPS, SPARC and amd64 relocations

 * C++ demangler bug fixes

 * Man page updates

 * Improved input validation in several tools

This update also reduces diffs against upstream as a number of fixes
included in upstream were previously cherry-picked into FreeBSD.

Sponsored by: The FreeBSD Foundation
16:20:08 - r300310
(4 days 10 hours ago)
by sjg
Affects:  /vendor/NetBSD/bmake/20160512
tag bmake-20160512
16:19:56 - r300309
(4 days 10 hours ago)
by sjg
Affects: 
(44 files)
/vendor/NetBSD/bmake/dist/*
Import bmake-20160512

Interesting changes (from ChangeLog):
o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS
  this is useful for gcov builds.
o propagate errors from filemon(4).
o meta.c: apply realpath() before matching against metaIgnorePaths
o allow makefile to set .MAKE.JOBS
15:43:51 - r300308
(4 days 11 hours ago)
by andrew
Affects:  /head/sys/arm64/arm64/gic_v3_reg.h
Extract the correct bits from the GICD_TYPER register. The interrupt count
is encoded in the bottom 5 bits.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
15:41:05 - r300307
(4 days 11 hours ago)
by kp
Affects:  /head/sys/netpfil/pf/pf_norm.c
pf: Fix fragment timeout

We were inconsistent about the use of time_second vs. time_uptime.
Always use time_uptime so the value can be meaningfully compared.

Submitted by: "Max" <maximos@als.nnov.ru>
MFC after: 4 days
15:34:03 - r300306
(4 days 11 hours ago)
by rwatson
Affects:  /head/sys/mips/include/clock.h
Garbage collect unused prototype for clockintr().

MFC after: 3 days
15:32:48 - r300305
(4 days 11 hours ago)
by kib
Affects:  /head/sys/amd64/amd64/sys_machdep.c
Use unsigned type for the loop index to make overflow checks effective.

PR: 209661
Reported by: cturt
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
15:14:38 - r300304
(4 days 11 hours ago)
by pfg
Affects:  /head/contrib/binutils/gas/config/tc-arm.c
gas/config/tc-arm.c: Minor re-sorting to match upstream history.

No functional change.

MFC after: 2 weeks
15:04:48 - r300303
(4 days 12 hours ago)
by andrew
Affects: 
(8 files)
/head/*
Remove brk and sbrk from arm64. They were defined in The Single UNIX
Specification, Version 2, but marked as legacy, and have been removed from
later specifications. After 12 years it is time to remove them from new
architectures when the main use for sbrk is an invalid method to attempt
to find how much memory has been allocated from malloc.

There are a few places in the tree that still call sbrk, however they are
not used on arm64. They will need to be fixed to cross build from arm64,
but these will be fixed in a follow up commit.

Old copies of binutils from ports called into sbrk, however this has been
fixed around 6 weeks ago. It is advised to update binutils on arm64 before
installing a world that includes this change.

Reviewed by: brooks, emaste
Obtained from: brooks
Relnotes: yes
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D6464
15:00:12 - r300302
(4 days 12 hours ago)
by ae
Affects:  /head/sys/netpfil/ipfw/ip_fw_dynamic.c
Fix the regression introduced in r300143.
When we are creating new dynamic state use MATCH_FORWARD direction to
correctly initialize protocol's state.
14:36:49 - r300301
(4 days 12 hours ago)
by pfg
Affects:  /head/contrib/gcc/c-typeck.c
GCC: Add support for named initializers for anonymous structs/unions.

This is a C11 feature that is starting to get used in places such as Mesa.
This implementation takes a different approach to upstream and is
therefore not covered by GPLv3.

Obtained from: OpenBSD (CVS rev. 1.2)
MFC after: 3 weeks
13:11:07 - r300300
(4 days 14 hours ago)
by andrew
Affects:  /head/sys/arm64/arm64/gic_v3_reg.h
Add more useful GICv3 register definitions. While here fix
GITS_CBASER_CACHE_MASK to use the correct shift macro.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
12:38:48 - r300299
(4 days 14 hours ago)
by andrew
Affects:  /head/sys/arm64/arm64/busdma_bounce.c
Filter out BUS_DMASYNC_POSTWRITE sync operations, there is nothing for us
to do on these.

Reported by: wma
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
12:17:40 - r300298
(4 days 14 hours ago)
by ae
Affects:  /head/sys/netinet6/ip6_output.c
Remove ip6 adjusting from the place where pointer couldn't be changed.
And add comment after calling PFIL hooks, where it could be changed.
12:09:10 - r300297
(4 days 15 hours ago)
by ae
Affects:  /head/sys/netinet6/ip6_output.c
Remove ip6 pointer initialization and strange check from the beginning
of ip6_output(). It isn't used until the first time adjusted.
Remove the comment about adjusting where it is actually initialized.
11:56:16 - r300296
(4 days 15 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
Pass proper for 23xx arguments to isp_endcmd().
11:02:04 - r300295
(4 days 16 hours ago)
by wma
Affects:  /head/sys/dev/vnic/nic_main.c
/head/sys/dev/vnic/thunder_bgx.c
Fix VNIC module unloading

Fix panics which were present when BGX and PF module were unloaded.

Reviewed by: zbb
Obtained from: Semihalf
Sponsored by: Cavium
Differential Revision: https://reviews.freebsd.org/D6346
11:00:06 - r300294
(4 days 16 hours ago)
by wma
Affects: 
(18 files)
/head/sys/conf/files.arm64
/head/sys/dev/vnic/*
/head/sys/modules/vnic/*
Allow building VNIC as a module

Add directory structure and fix dependencies to be able to
build and use Cavium VNIC driver as a module.

Reviewed by: zbb
Obtained from: Semihalf
Sponsored by: Cavium
Differential Revision: https://reviews.freebsd.org/D6345
10:26:12 - r300293
(4 days 16 hours ago)
by mav
Affects:  /head/sys/cam/cam_ccb.h
/head/sys/cam/ctl/scsi_ctl.c
/head/sys/dev/isp/isp_freebsd.c
Pass task management response information from CTL through CAM to isp(4),
utilizing previously unused arg field of struct ccb_notify_acknowledge.

This makes new QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT requests
really functional for CAM target mode drivers.
08:58:06 - r300292
(4 days 18 hours ago)
by avos
Affects:  /head/sys/dev/bwn/if_bwn.c
/head/sys/dev/wi/if_wi.c
wi: fix a typo.

The max size of bitmask is IEEE80211_MODE_BYTES, not IEEE80211_MODE_MAX.

Reuse it in bwn(4) while I'm here.

Noticed by: kevlo
08:43:18 - r300291
(4 days 18 hours ago)
by andrew
Affects:  /head/sys/arm64/conf/DEFAULTS
Enable NEW_PCIB on arm64.

Obtained from: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation
08:29:00 - r300290
(4 days 18 hours ago)
by andrew
Affects:  /head/sys/arm64/cavium/thunder_pcie_pem.c
/head/sys/dev/pci/pci_host_generic.c
Handle PCI_RES_BUS on the generic and ThunderX PCIe drivers. This has been
tested on the Pass 1.1 and 2.0 ThunderX machines in the Netperf cluster.

Reviewed by: jhb
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6453
08:28:11 - r300289
(4 days 18 hours ago)
by kib
Affects:  /head/sys/geom/geom_kern.c
Remove unneeded Giant locking around kthreads creation.

Sponsored by: The FreeBSD Foundation
08:25:37 - r300288
(4 days 18 hours ago)
by kib
Affects: 
(9 files)
/head/sys/geom/*
Removal of Giant droping wrappers for GEOM classes.

Sponsored by: The FreeBSD Foundation
08:22:20 - r300287
(4 days 18 hours ago)
by kib
Affects:  /head/sys/geom/geom.h
/head/sys/geom/geom_event.c
/head/sys/geom/geom_kern.c
Remove asserts that Giant is not held on entrance into geom KPI, which
outlived their usefulness. This allows to remove drop/pickup Giant
wrappers around GEOM calls.

Discussed with: alfred, imp, phk
Sponsored by: The FreeBSD Foundation
07:18:33 - r300286
(4 days 19 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/lib/libc/resolv/res_query.c
MFC r299879, r299880

r299879 | truckman | 2016-05-15 18:30:32 -0700 (Sun, 15 May 2016) | 7 lines

Likely a false positive ... but make sure that -1 can't be used as an
array index by splitting up a test.

r299880 | truckman | 2016-05-15 18:38:24 -0700 (Sun, 15 May 2016) | 8 lines

Since rdata is only used as an argument to the immediately following
call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving
  rdata = &buf[n];
inside the if block.

Reported by: Coverity
CID: 603941
07:14:03 - r300285
(4 days 19 hours ago)
by truckman
Affects: 
(11 files)
/stable/10/sbin/ifconfig/*
MFC r299873

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Use sizeof(destination) in a few places instead of IFNAMSIZ.

Cast afp->af_ridreq and afp->af_addreq to make the intent of
the code more obvious.

Reported by: Coverity
CID: 1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638
CID: 1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645
CID: 1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053
CID: 1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298
CID: 1011299, 1305821, 1351720, 1351721
07:11:04 - r300284
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/route6d/route6d.c
MFC r299869

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Reported by: Coverity
CID: 1009974
07:08:19 - r300283
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/rtsold/if.c
MFC r299868

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Reported by: Coverity
CID: 991863, 991864, 991865
07:07:27 - r300282
(4 days 20 hours ago)
by hselasky
Affects:  /head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
Verify one sysctl parameter at a time. When a mlx5en sysctl parameter
is updated only verify the changed one instead of all.

No functional change.

Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week
07:00:11 - r300281
(4 days 20 hours ago)
by truckman
Affects: 
(3 files)
/stable/10/usr.sbin/rtadvd/config.c
/stable/10/usr.sbin/rtadvd/if.c
MFC r299867

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Reported by: Coverity
CID: 974860, 1009972, 1009973
06:59:38 - r300280
(4 days 20 hours ago)
by hselasky
Affects:  /head/sys/dev/mlx5/mlx5_en/en.h
/head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
/head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
Optimise use of doorbell and remove redundant NOPs

Store the last doorbell write in the mlx5e_sq structure and write the
doorbell to the hardware when the transmit routine finishes
transmitting all queued mbufs.

Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week
06:56:43 - r300279
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/lmcconfig/lmcconfig.c
MFC 299866

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Reported by: Coverity
CID: 974852
06:54:59 - r300278
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/sys/net/if.c
MFC r299865

When handling SIOCSIFNAME ensure that the new interface name is NUL
terminated. Reject the rename attempt if the name is too long.
06:54:58 - r300277
(4 days 20 hours ago)
by hselasky
Affects: 
(4 files)
/head/sys/dev/mlx5/mlx5_en/*
Implement TX completion event interleaving.

This patch implements a sysctl which allows setting a factor, N, for
how many work queue elements can be generated before requiring a
completion event. When a completion event happens the code simulates N
completion events instead of only one. When draining a transmit queue,
N-1 NOPs are transmitted at most, to force generation of the final
completion event. Further a timer is running every HZ ticks to flush
any remaining data off the transmit queue when the tx_completion_fact
> 1.

The goal of this feature is to reduce the PCI bandwidth needed when
transmitting data.

Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week
06:47:42 - r300276
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
MFC r299593

Properly compute the size argument to pass to malloc().

Reported by: Coverity
CID: 1198856
06:43:55 - r300275
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/mptutil/mpt_cam.c
MFC r299592

Move a call to cam_freeccb() to avoid a use after free error and
a later double free.

Reported by: Coverity
CID: 1018507
06:41:26 - r300274
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/mail/fio.c
MFC r299591

Always return either a dynamically allocated string or NULL from
expand(). Never return the name parameter, which could be a the buf[]
buffer which is allocated on the stack by getdeadletter() and which
would then be used after getdeadletter() has returned.

Reported by: Coverity
CID: 1199383
06:38:46 - r300273
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/libexec/ftpd/ftpd.c
MFC r299585

Declare line[] in the outermost scope of retrieve() instead of
declaring it in an inner scope and then using it via a pointer
in the outer scope.

Reported by: Coverity
CID: 605895
06:35:14 - r300272
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/lib/libutil/quotafile.c
MFC r299581

Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL
terminated. Don't bother checking for truncation since the subsequent
stat() call should detect that and fail.

Reported by: Coverity
CID: 1018189
06:33:02 - r300271
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/timed/timed/master.c
MFC r299580

Use strlcpy() instead of strncpy() to ensure that ret->name is
NUL terminated. The source and destination buffers are the same
size and the source *should* be NUL terminated, but be paranoid.

Reported by: Coverity
CID: 1011274
06:27:58 - r300270
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/edquota/edquota.c
MFC r299579

Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL
terminated. Don't bother checking for truncation since the subsequent
quota_read() should detect that and fail.

Reported by: Coverity
CID: 1009980
06:24:16 - r300269
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/catman/catman.c
MFC r299577, r299578, r299589

r299577 | truckman | 2016-05-12 16:14:31 -0700 (Thu, 12 May 2016) | 15 lines

Avoid Coverity NUL termination warning about strncpy() by using
memcpy() instead. It's probably a bit more optimal in this case
anyway. [1]

The program logic leading up to the creation of the strncpy/memcpy
destination buffer is a bit hairy. Add a call to assert() to make
it clear what is happening here and detect any potential buffer
overruns in the future.

Check a couple syscall error returns. Ignore the EEXIST error from
link() to preserve existing behavior. [2] [3]

r299578 | truckman | 2016-05-12 16:37:58 -0700 (Thu, 12 May 2016) | 2 lines

If fchdir() fails, call err() instead of warn().

r299589 | truckman | 2016-05-12 22:49:02 -0700 (Thu, 12 May 2016) | 4 lines

Instead of ignoring the EEXIST from link(), unconditionally unlink
the terget before calling link(). This should prevent links to an
old copy of the file from being retained.

Reported by: Coverity
CID: 1009659 [1], 1009349 [2], 1009350 [3]
06:19:00 - r300268
(4 days 20 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.sbin/ypbind/ypbind.c
MFC r290903, r299573

r290903 is needed to prevent a conflict whem merging r299573

r290903 | araujo | 2015-11-15 19:18:40 -0800 (Sun, 15 Nov 2015) | 5 lines

Don't need cast malloc.

r299573 | truckman | 2016-05-12 14:35:40 -0700 (Thu, 12 May 2016) | 10 lines

Use strlcpy() instead of strncpy() when copying to dom_domain to
ensure that the latter is NUL terminated since it is passed
as an argument to *printf().

Warn about NIS domains that are too long.

Reported by: Coverity
CID: 1009620, 1009621
06:06:21 - r300267
(4 days 21 hours ago)
by adrian
Affects:  /head/sys/dev/ath/ath_hal/ah_regdomain.c
[ath] convert recent changes over to HAL format.

This is needed to compile the ath tools, that includes this code
to run in userland.

Tested:

* Carambola 2, AR9331, STA mode
06:05:20 - r300266
(4 days 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/msgs/msgs.c
MFC r299525

  Use strlcpy() instead of strncpy() when copying date and subj
  to ensure that these are properly NUL terminated since they
  are passed to printf().

Reported by: Coverity
CID: 974770
06:02:44 - r300265
(4 days 21 hours ago)
by truckman
Affects: 
(2 files)
/stable/10/usr.bin/mklocale/yacc.y
MFC r299524

  Use strlcpy() instead of strncpy() when copying the encoding value
  to ensure that the destination is NUL terminated. Length truncation
  of one more character should not be an issue since encoding values
  that long are not supported by libc. The destination string is
  treated as a NUL terminated string, but it is only passed to strcmp()
  for comparison to a set of shorter, fixed length strings, so this
  is not a serious problem.

Reported by: Coverity
CID: 974769
05:33:26 - r300264
(4 days 21 hours ago)
by imp
Affects:  /head/lib/libstand/uuid_from_string.c
Fix a bug in the parsing code: always use the len and not 8.
05:00:05 - r300263
(4 days 22 hours ago)
by markj
Affects: 
(808 files)
/user/alc/PQ_LAUNDRY/*
MFH r300262
04:45:08 - r300262
(4 days 22 hours ago)
by markj
Affects: 
(5 files)
/head/sys/kern/kern_malloc.c
/head/sys/netinet6/*
/head/sys/sys/malloc.h
Move IPv6 malloc tag definitions into the IPv6 code.
04:43:56 - r300261
(4 days 22 hours ago)
by markj
Affects:  /head/sys/sys/vmmeter.h
Fix the style of the paging target predicates.

Discussed with: alc, kib
MFC after: 1 week
03:22:41 - r300260
(4 days 23 hours ago)
by cy
Affects:  /head/sys/contrib/ipfilter/netinet/ip_frag.c
Remove extraneous blank line.

MFC after: 1 month
X-MFC with: r300259
03:04:22 - r300259
(5 days ago)
by cy
Affects:  /head/sys/contrib/ipfilter/netinet/ip_frag.c
/head/sys/contrib/ipfilter/netinet/ip_frag.h
Enable the two ip_frag tuneables. The code is there but the two
ip_frag tuneables aren't registered in the ipf_tuners linked list.
This commmit enables the two existing ip_frag tuneables by registering
them.

MFC after: 1 month
03:03:04 - r300258
(5 days ago)
by jah
Affects:  /head/sys/dev/iicbus/iic.c
/head/sys/dev/iicbus/iic.h
iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages to
prevent memory exhaustion and short allocations on 32-bit systems. Since
iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same
limit of 42 that Linux uses.

Also check the return value of copyin(9) to prevent unnecessary allocation in
the failure case.

Submitted by: ngie
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5155
01:41:47 - r300257
(5 days 1 hour ago)
by allanjude
Affects:  /head/sys/boot/i386/libi386/biosdisk.c
/head/sys/boot/i386/zfsboot/zfsboot.c
Fixup the geliboot sector rounding code

Replace all rounding with the round{up,down}2 macros
a missing set of braces caused the previous code to be incorrect

replace alloca() with malloc() because alloca() can return an allocation
that is actually invalid, causing boot to fail

Reviewed by: emaste, ed
Thanks To: peter
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6213
01:38:31 - r300256
(5 days 1 hour ago)
by gnn
Affects:  /head/ObsoleteFiles.inc
/head/etc/mtree/BSD.usr.dist
Remove DTrace tooklkit from the mtree and add the files to remove
to the ObsoleteFiles list.

Sponsored by: DARPA, AFRL
01:25:14 - r300255
(5 days 1 hour ago)
by rmacklem
Affects: 
(3 files)
/stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
MFC: r299201
Give mountd -S priority over outstanding RPC requests when suspending the nfsd.

It was reported via email that under certain heavy RPC loads
long delays before the exports would be updated was observed
when using "mountd -S". This patch reverses the priority between
the exclusive lock request to suspend the nfsd threads and the
shared lock request for performing RPCs.
As such, when mountd attempts to suspend the nfsd threads, it
gets priority over outstanding RPC requests to do this.
I suspect that the case reported was an artificial test load,
but this patch did fix the problem for the reporter.
01:19:30 - r300254
(5 days 1 hour ago)
by rmacklem
Affects: 
(2 files)
/stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c
MFC: r299201
Give mountd -S priority over outstanding RPC requests when suspending the nfsd.

It was reported via email that under certain heavy RPC loads
long delays before the exports would be updated was observed
when using "mountd -S". This patch reverses the priority between
the exclusive lock request to suspend the nfsd threads and the
shared lock request for performing RPCs.
As such, when mountd attempts to suspend the nfsd threads, it
gets priority over outstanding RPC requests to do this.
I suspect that the case reported was an artificial test load,
but this patch did fix the problem for the reporter.
01:17:38 - r300253
(5 days 1 hour ago)
by jhb
Affects: 
(4 files)
/head/ObsoleteFiles.inc
/head/share/man/man9/*
/head/sys/sys/rman.h
Remove dangling references to rman_await_resource().

This function was removed when RF_TIMESHARE was removed a couple of years
ago.

MFC after: 3 days
01:02:58 - r300252
(5 days 2 hours ago)
by adrian
Affects: 
(4 files)
/head/sys/dev/bhnd/bcma/bcma_nexus.c
/head/sys/dev/bhnd/soc/bhnd_soc.c
/head/sys/dev/bhnd/soc/bhnd_soc.h
[bhnd] Add BHND SoC support (only BCMA case)

This patch introduces support of BHND on SoC: nexus-to-bhnd drivers.

bhnd_soc is attached under nexus and responsible for all BHND-style calls
from bhnd(4) bus to parents.

bcma_nexus is bhnd(4) bus, attached to bhnd_soc and implement all
nexus-style behaviour of BHND.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Reviewed by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6248
00:49:10 - r300251
(5 days 2 hours ago)
by adrian
Affects:  /head/sys/dev/bhnd/bhndb/bhndb.c
/head/sys/dev/bhnd/bhndb/bhndb_private.h
/head/sys/dev/bhnd/bhndb/bhndb_subr.c
[bhnd] Add bhnd bridge support for bus_adjust_resource().

Adds support for adjusting active bus resource allocations, limiting the
range to the constraints of the register window within which the resource
is mapped.

This is the final set of bhnd changes required to support delegating
ChipCommon's register space to child devices.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6470
00:45:16 - r300250
(5 days 2 hours ago)
by adrian
Affects: 
(6 files)
/head/sys/dev/bhnd/*
[bhnd] Add remaining bus_(read|write|set)_(1|2|4) APIs

This adds bhnd-compatible implementations of bus_(read|write|set)_(1|2|4) APIs,
and upgrades the SPROM parsing code to use bhnd_bus_read_region_stream_2().

This a precursor to bridge support for resource adjustment and the new
ChipCommon bus support.

Tested:

* Tested against BCM4331
* Kernel build verified via tinderbox.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6469
00:03:22 - r300249
(5 days 3 hours ago)
by jhb
Affects: 
(4 files)
/head/sys/dev/acpica/acpi_pcib_pci.c
/head/sys/dev/pccbb/pccbb_pci.c
/head/sys/dev/pci/*
Implement a proper detach method for the PCI-PCI bridge driver.

- Add a pcib_detach() function for the PCI-PCI bridge driver. It
  tears down the NEW_PCIB and hotplug state including destroying
  resource managers, deleting child devices, and disabling hotplug
  events.
- Add a detach method to the ACPI PCI-PCI bridge driver which calls
  pcib_detach() and then frees the copy of the _PRT interrupt routing
  table.
- Add a detach method to the PCI-Cardbus bridge driver which frees
  the PCI bus resources in addition to calling cbb_detach().
- Explicitly clear any pending hotplug events during attach to ensure
  future events will generate an interrupt.
- If a the Command Completed bit is set in the slot status register
  when the command completion timeout fires, treat it as if the
  command completed and the completion interrupt was just lost rather
  than forcing a detach.
- Don't wait for a Command Completed notification if Command Completion
  interrupts are disabled. The spec explicitly says no interrupt is
  enabled when clearing CCIE, and on my T400 no interrupt is generated
  when CCIE is changed from cleared to set, either. In addition, the
  T400 doesn't appear to set the Command Completed bit in the cases
  where it doesn't generate an interrupt, so don't schedule the timer
  either. (If the CC bit were always set, one could always set the timer
  and rely on the logic of treating CC set as a missed interrupt.)

Reviewed by: imp (older version)
Differential Revision: https://reviews.freebsd.org/D6424
2016 - 05 - 19   (6 days ago)
23:31:00 - r300248
(5 days 3 hours ago)
by avos
Affects: 
(10 files)
/head/sys/dev/iwm/*
iwm: add 'opt_wlan.h' include into source files.

Include net80211 options file, so IEEE80211_DEBUG_REFCNT option will be
handled correctly.
23:03:07 - r300247
(5 days 4 hours ago)
by truckman
Affects:  /head/share/man/man4/tcp.4
Document new net.inet.tcp.ecn.enable sysctl settings.

MFC after: 1 month (with r300240)
23:00:30 - r300246
(5 days 4 hours ago)
by avos
Affects:  /head/sys/dev/ath/ath_hal/ah_regdomain.c
/head/sys/dev/ath/ath_hal/ah_regdomain.h
ath: refactor/split getchannels() method.

Split getchannels() method in ath_hal/ah_regdomain.c into a subset
of functions for better readability.

Note: due to different internal structure, it cannot use
ieee80211_add_channel*() (however, some parts are done in a
similar manner).

Differential Revision: https://reviews.freebsd.org/D6139
22:56:00 - r300245
(5 days 4 hours ago)
by asomers
Affects: 
(4792 files)
/projects/zfsd/head/*
IFC @300240
22:54:24 - r300244
(5 days 4 hours ago)
by bdrewery
Affects: 
(2 files)
/stable/9/share/mk/bsd.own.mk
MFS r300243:

  Follow-up r300233: Don't override MK_* from env as head does.

PR: D6271
22:53:44 - r300243
(5 days 4 hours ago)
by bdrewery
Affects:  /stable/10/share/mk/bsd.own.mk
Follow-up r300233: Don't override MK_* from env as head does.

PR: D6271
Sponsored by: EMC / Isilon Storage Division
22:43:21 - r300242
(5 days 4 hours ago)
by avos
Affects:  /head/sys/dev/iwm/if_iwm.c
iwm: restart device after watchdog timeouts.
22:28:46 - r300241
(5 days 4 hours ago)
by avos
Affects:  /head/sys/dev/mwl/if_mwl.c
mwl: switch to ieee80211_add_channel*().
22:20:35 - r300240
(5 days 4 hours ago)
by truckman
Affects:  /head/sys/netinet/tcp_input.c
/head/sys/netinet/tcp_output.c
Change net.inet.tcp.ecn.enable sysctl mib from a binary off/on
control to a three way setting.
  0 - Totally disable ECN. (no change)
  1 - Enable ECN if incoming connections request it. Outgoing
  connections will request ECN. (no change from present != 0 setting)
  2 - Enable ECN if incoming connections request it. Outgoing
  conections will not request ECN.

Change the default value of net.inet.tcp.ecn.enable from 0 to 2.

Linux version 2.4.20 and newer, Solaris, and Mac OS X 10.5 and newer have
similar capabilities. The actual values above match Linux, and the default
matches the current Linux default.

Reviewed by: eadler
MFC after: 1 month
MFH: yes
Sponsored by: https://reviews.freebsd.org/D6386
22:19:35 - r300239
(5 days 4 hours ago)
by avos
Affects:  /head/sys/dev/ipw/if_ipw.c
/head/sys/dev/ipw/if_ipwvar.h
ipw: switch to ieee80211_add_channel()

- Convert to ieee80211_add_channel().
- Add ic_getradiocaps() method.

Differential Revision: https://reviews.freebsd.org/D6236
22:14:35 - r300238
(5 days 4 hours ago)
by avos
Affects:  /head/sys/dev/wi/if_wi.c
/head/sys/dev/wi/if_wivar.h
wi: switch to ieee80211_add_channel()

- Convert to ieee80211_add_channel().
- Add ic_getradiocaps() method.

Differential Revision: https://reviews.freebsd.org/D6235
22:02:03 - r300237
(5 days 5 hours ago)
by avos
Affects:  /head/sys/net80211/ieee80211_ioctl.c
net80211: restore interface state check for IEEE80211_IOC_SCAN_REQ ioctl.

Do not try to start a scan when interface is not running.

How-to-reproduce:
1) ifconfig wlan0 create wlandev urtwn0
2) wlandebug -i wlan0 state
3) ifconfig wlan0 scan
21:47:57 - r300236
(5 days 5 hours ago)
by bdrewery
Affects:  /stable/9/sys/sys/param.h
Bump version for r300234
21:47:32 - r300235
(5 days 5 hours ago)
by bdrewery
Affects:  /stable/10/sys/sys/param.h
Bump version for r300233
21:44:33 - r300234
(5 days 5 hours ago)
by bdrewery
Affects: 
(2 files)
/stable/9/share/mk/bsd.own.mk
MFS r300233:

  Allow MK_ overrides

PR: D6271
21:41:35 - r300233
(5 days 5 hours ago)
by bdrewery
Affects:  /stable/10/share/mk/bsd.own.mk
Allow MK_ overrides.

This is a direct commit to stable.

This was done in head in r264661 and is needed to force certain options off
for ports.

PR: D6271
Sponsored by: EMC / Isilon Storage Division
21:08:33 - r300232
(5 days 6 hours ago)
by avos
Affects: 
(12 files)
/head/sys/net80211/*
net80211: fix more compiler warnings.

ieee80211.c:
  add_chanlist(): 'error' variable will be uninitialized if
  no channels were passed; return '0' instead.
ieee80211_action.c:
  ieee80211_send_action_register(): drop 'break' after 'return'.
ieee80211_crypto_none.c:
  none_encap(): 'keyid' is not used in non-debug builds; hide it
  behind IEEE80211_DEBUG ifdef.
ieee80211_freebsd.c:
  Staticize global 'ieee80211_debug' variable (used only in this
  file).
ieee80211_hostap.c:
  Fix a comment (associatio -> association).
ieee80211_ht.c:
  ieee80211_setup_htrates(): initialize 'maxunequalmcs' to 0 to mute
  compiler warning.
ieee80211_hwmp.c:
  hwmp_recv_preq(): copy 'prep' between conditional blocks to fix
  -Wshadow warning.
ieee80211_mesh.c:
  mesh_newstate(): remove duplicate 'ni' definition.
  mesh_recv_group_data(): fix -Wempty-body warning in non-debug
  builds.
ieee80211_phy.c:
  ieee80211_compute_duration(): remove 'break' after panic() call.
ieee80211_scan_sta.c:
  Hide some TDMA-specific macros under IEEE80211_SUPPORT_TDMA ifdef
  adhoc_pick_bss(): remove 'ic' pointer redefinition.
ieee80211_sta.c:
  sta_beacon_miss(): remove 'ic' pointer redefinition.
ieee80211_superg.c:
  superg_ioctl_set80211(): drop unreachable return.

Tested with clang 3.8.0, gcc 4.6.4 and gcc 5.3.0.
21:04:59 - r300231
(5 days 6 hours ago)
by emaste
Affects:  /head/sys/sys/elf_common.h
elf_common.h: add section header flag and dynamic types

SHF_COMPRESSED section contains compressed data
DT_TLSDESC_PLT Location of PLT entry for TLS descriptor resolver calls
DT_TLSDESC_GOT Location of GOT entry used by resolver PLT entry

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
20:51:47 - r300230
(5 days 6 hours ago)
by gonzo
Affects:  /head/sys/boot/fdt/fdt_loader_cmd.c
Fixed memory leak in FDT overlay handling code

Free both overlay and new fdt before returning after fdt_open_into error
PR: 209634
Submitted by: David Binderman
20:08:16 - r300229
(5 days 7 hours ago)
by emaste
Affects:  /vendor/elftoolchain/elftoolchain-r3475
Tag ELF Tool Chain r3475
20:06:56 - r300228
(5 days 7 hours ago)
by emaste
Affects: 
(72 files)
/vendor/elftoolchain/dist/*
Import ELF Tool Chain snapshot at revision 3475

From http://svn.code.sf.net/p/elftoolchain/code/
20:03:01 - r300227
(5 days 7 hours ago)
by ed
Affects:  /head/usr.bin/ar/ar.c
Make code compile when basename() is POSIX compliant.

If basename() uses "char *", we shouldn't do the intermediate
assignment, as that field is of type "const char *". Simply call
basename() on the command line argument directly.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D6463
19:51:39 - r300226
(5 days 7 hours ago)
by gnn
Affects: 
(6 files)
/head/cddl/contrib/dtracetoolkit
/head/cddl/usr.sbin/*
/head/share/dtrace/*
Remove the old version of the DTraceToolkit from the source tree.
The DTraceToolkit is part of the Open DTrace effort and is supported
on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
to properly track toolkit development upstream.

Sponsored by: DARPA, AFRL
19:27:33 - r300225
(5 days 7 hours ago)
by alc
Affects:  /head/sys/vm/vm_fault.c
Clean up the handling of errors from vm_pager_get_pages(). Mostly, this
cleanup consists of fixes to comments. However, there is one change to
code: Remove special-case handling of errors involving the kernel map.
We do not perform I/O on the kernel map, so there is no need for this
special case.

Reviewed by: kib (an earlier version)
19:13:43 - r300224
(5 days 8 hours ago)
by ken
Affects:  /head/usr.sbin/camdd/camdd.c
Adjust a couple of error cases in camdd(8).

usr.sbin/camdd/camdd.c:
  In camdd_probe_file(), fix an error case after fstat where
  we were bailing out and leaving two lines of cleanup code
  unexecuted. Instead, just goto bailout_error.

  In camdd_probe_pass(), fail if the sector size is 0.

Sponsored by: Spectra Logic
MFC after: 3 days
17:54:14 - r300223
(5 days 9 hours ago)
by cem
Affects:  /head/sys/vm/vm_page.c
/head/sys/vm/vm_page.h
vm/vm_page.h: Fix trivial '-Wpointer-sign' warning

pq_vcnt, as a count of real things, has no business being negative. It is only
ever initialized by a u_int counter.

The warning came from the atomic_add_int() in vm_pagequeue_cnt_add().

Rectify the warning by changing the variable to u_int. No functional change.

Suggested by: Clang 3.3
Sponsored by: EMC / Isilon Storage Division
17:48:56 - r300222
(5 days 9 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp.c
/head/sys/dev/isp/isp_freebsd.c
Fix delaying requests to unknown virtual ports 2s after init.

This code was originally implemented 7 years ago, but never really worked
due to trivial error. I think this functionality may be not required.
Initiators supporting optional periodic command status checks detected
those terminated commands and retried them 3 seconds later. But thinking
about less featured initiators and the fact that it is our race makes
virtual ports "unknown" it may be good to have this feature.
17:40:00 - r300221
(5 days 9 hours ago)
by kib
Affects:  /head/lib/libc/sys/_umtx_op.2
/head/lib/libthr/libthr.3
Document _umtx_op(2) interface for the implementation of robust mutexes.
In libthr(3), list added knobs.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D6427
17:21:24 - r300220
(5 days 9 hours ago)
by cem
Affects:  /head/sys/sys/vmmeter.h
sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header

Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative
value (it is only ever set to a fraction of v_free_min, which is unsigned and
also obviously non-negative). But I'm not going to try and convert every
non-negative scalar in the VM to unsigned today, so just cast it for the
comparison.

Submitted by: Clang 3.3
Sponsored by: EMC / Isilon Storage Division
17:14:24 - r300219
(5 days 9 hours ago)
by scottl
Affects:  /head/sys/kern/subr_taskqueue.c
/head/sys/sys/taskqueue.h
Adjust the creation of tq_name so it can be freed correctly

Reviewed by: jhb, allanjude
Differential Revision: D6454
17:02:33 - r300218
(5 days 10 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
/head/sys/dev/isp/ispvar.h
Add proper reporting for early task management errors.

This covers unknown requests and requests to unknown virtual ports.
Previously it "worked" only because of timeout handling on initiator.
16:53:53 - r300217
(5 days 10 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp.c
Add IOCB debugging for ISPCTL_RESET_DEV and ISPCTL_ABORT_CMD.
16:36:06 - r300216
(5 days 10 hours ago)
by imp
Affects:  /head/sys/boot/efi/loader/main.c
Fix logic error so UEFI variables are reported correctly
without error at the end.
16:28:05 - r300215
(5 days 10 hours ago)
by pfg
Affects:  /head/sys/net/mp_ring.c
sys/net: more spelling.
16:04:20 - r300214
(5 days 11 hours ago)
by asomers
Affects: 
(3 files)
/stable/10/sbin/devd/devd.conf.5
/stable/10/sys/geom/geom_disk.c
MFC r298420, r298439, r298644

r298420 | asomers | 2016-04-21 10:43:15 -0600 (Thu, 21 Apr 2016) | 10 lines

Notify userspace listeners when geom disk attributes have changed

sys/geom/geom_disk.c:
  disk_attr_changed(): Generate a devctl event of type GEOM:<attr> for
  every call.

r298439 | asomers | 2016-04-21 15:13:41 -0600 (Thu, 21 Apr 2016) | 10 lines

DRY on buffer sizes. Update to r298420.

sys/geom/geom_disk.c:
  In disk_attr_changed, don't repeat a buffer size.

r298644 | asomers | 2016-04-26 08:48:58 -0600 (Tue, 26 Apr 2016) | 8 lines

Add GEOM::physpath documentation to devd.conf(5)
16:02:02 - r300213
(5 days 11 hours ago)
by pfg
Affects:  /head/sys/sys/vmmeter.h
sys/vmmeter.h: "desperate" spelling fix.
14:59:21 - r300212
(5 days 12 hours ago)
by trasz
Affects:  /head/usr.sbin/iscsid/discovery.c
When iscsid(8) is running in ICL proxy mode, don't try to send Logout PDUs.
The kernel already does this for us when we ask it to terminate the session.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
14:57:37 - r300211
(5 days 12 hours ago)
by trasz
Affects:  /head/sys/dev/iscsi/iscsi.c
Make ICL proxy use kernel code for handling iSCSI sequence numbers
for PDUs to/from iscsid(8). This fixes StatSN for Logout PDUs sent
by iscsi_session_logout().

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
14:45:34 - r300210
(5 days 12 hours ago)
by trasz
Affects:  /head/usr.sbin/ctld/discovery.c
Fix error message.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
14:37:24 - r300209
(5 days 12 hours ago)
by trasz
Affects:  /head/sys/dev/iscsi/iscsi.c
Make it possible to interrupt proxy-mode iscsid receive.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
14:19:01 - r300208
(5 days 12 hours ago)
by bz
Affects:  /head/sys/mips/conf/BCM
Exclude BCM from universe build until it compiles again.
14:08:36 - r300207
(5 days 13 hours ago)
by ken
Affects: 
(34 files)
/head/sbin/camcontrol/*
/head/sys/*
/head/usr.sbin/*
Add support for managing Shingled Magnetic Recording (SMR) drives.

This change includes support for SCSI SMR drives (which conform to the
Zoned Block Commands or ZBC spec) and ATA SMR drives (which conform to
the Zoned ATA Command Set or ZAC spec) behind SAS expanders.

This includes full management support through the GEOM BIO interface, and
through a new userland utility, zonectl(8), and through camcontrol(8).

This is now ready for filesystems to use to detect and manage zoned drives.
(There is no work in progress that I know of to use this for ZFS or UFS, if
anyone is interested, let me know and I may have some suggestions.)

Also, improve ATA command passthrough and dispatch support, both via ATA
and ATA passthrough over SCSI.

Also, add support to camcontrol(8) for the ATA Extended Power Conditions
feature set. You can now manage ATA device power states, and set various
idle time thresholds for a drive to enter lower power states.

Note that this change cannot be MFCed in full, because it depends on
changes to the struct bio API that break compatilibity. In order to
avoid breaking the stable API, only changes that don't touch or depend on
the struct bio changes can be merged. For example, the camcontrol(8)
changes don't depend on the new bio API, but zonectl(8) and the probe
changes to the da(4) and ada(4) drivers do depend on it.

Also note that the SMR changes have not yet been tested with an actual
SCSI ZBC device, or a SCSI to ATA translation layer (SAT) that supports
ZBC to ZAC translation. I have not yet gotten a suitable drive or SAT
layer, so any testing help would be appreciated. These changes have been
tested with Seagate Host Aware SATA drives attached to both SAS and SATA
controllers. Also, I do not have any SATA Host Managed devices, and I
suspect that it may take additional (hopefully minor) changes to support
them.

Thanks to Seagate for supplying the test hardware and answering questions.

sbin/camcontrol/Makefile:
  Add epc.c and zone.c.

sbin/camcontrol/camcontrol.8:
  Document the zone and epc subcommands.

sbin/camcontrol/camcontrol.c:
  Add the zone and epc subcommands.

  Add auxiliary register support to build_ata_cmd(). Make sure to
  set the CAM_ATAIO_NEEDRESULT, CAM_ATAIO_DMA, and CAM_ATAIO_FPDMA
  flags as appropriate for ATA commands.

  Add a new get_ata_status() function to parse ATA result from SCSI
  sense descriptors (for ATA passthrough over SCSI) and ATA I/O
  requests.

sbin/camcontrol/camcontrol.h:
  Update the build_ata_cmd() prototype

  Add get_ata_status(), zone(), and epc().

sbin/camcontrol/epc.c:
  Support for ATA Extended Power Conditions features. This includes
  support for all features documented in the ACS-4 Revision 12
  specification from t13.org (dated February 18, 2016).

  The EPC feature set allows putting a drive into a power power mode
  immediately, or setting timeouts so that the drive will
  automatically enter progressively lower power states after various
  idle times.

sbin/camcontrol/fwdownload.c:
  Update the firmware download code for the new build_ata_cmd()
  arguments.

sbin/camcontrol/zone.c:
  Implement support for Shingled Magnetic Recording (SMR) drives
  via SCSI Zoned Block Commands (ZBC) and ATA Zoned Device ATA
  Command Set (ZAC).

  These specs were developed in concert, and are functionally
  identical. The primary differences are due to SCSI and ATA
  differences. (SCSI is big endian, ATA is little endian, for
  example.)

  This includes support for all commands defined in the ZBC and
  ZAC specs.

sys/cam/ata/ata_all.c:
  Decode a number of additional ATA command names in ata_op_string().

  Add a new CCB building function, ata_read_log().

  Add ata_zac_mgmt_in() and ata_zac_mgmt_out() CCB building
  functions. These support both DMA and NCQ encapsulation.

sys/cam/ata/ata_all.h:
  Add prototypes for ata_read_log(), ata_zac_mgmt_out(), and
  ata_zac_mgmt_in().

sys/cam/ata/ata_da.c:
  Revamp the ada(4) driver to support zoned devices.

  Add four new probe states to gather information needed for zone
  support.

  Add a new adasetflags() function to avoid duplication of large
  blocks of flag setting between the async handler and register
  functions.

  Add new sysctl variables that describe zone support and paramters.

  Add support for the new BIO_ZONE bio, and all of its subcommands:
  DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP,
  DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS.

sys/cam/scsi/scsi_all.c:
  Add command descriptions for the ZBC IN/OUT commands.

  Add descriptions for ZBC Host Managed devices.

  Add a new function, scsi_ata_pass() to do ATA passthrough over
  SCSI. This will eventually replace scsi_ata_pass_16() -- it
  can create the 12, 16, and 32-byte variants of the ATA
  PASS-THROUGH command, and supports setting all of the
  registers defined as of SAT-4, Revision 5 (March 11, 2016).

  Change scsi_ata_identify() to use scsi_ata_pass() instead of
  scsi_ata_pass_16().

  Add a new scsi_ata_read_log() function to facilitate reading
  ATA logs via SCSI.

sys/cam/scsi/scsi_all.h:
  Add the new ATA PASS-THROUGH(32) command CDB. Add extended and
  variable CDB opcodes.

  Add Zoned Block Device Characteristics VPD page.

  Add ATA Return SCSI sense descriptor.

  Add prototypes for scsi_ata_read_log() and scsi_ata_pass().

sys/cam/scsi/scsi_da.c:
  Revamp the da(4) driver to support zoned devices.

  Add five new probe states, four of which are needed for ATA
  devices.

  Add five new sysctl variables that describe zone support and
  parameters.

  The da(4) driver supports SCSI ZBC devices, as well as ATA ZAC
  devices when they are attached via a SCSI to ATA Translation (SAT)
  layer. Since ZBC -> ZAC translation is a new feature in the T10
  SAT-4 spec, most SATA drives will be supported via ATA commands
  sent via the SCSI ATA PASS-THROUGH command. The da(4) driver will
  prefer the ZBC interface, if it is available, for performance
  reasons, but will use the ATA PASS-THROUGH interface to the ZAC
  command set if the SAT layer doesn't support translation yet.
  As I mentioned above, ZBC command support is untested.

  Add support for the new BIO_ZONE bio, and all of its subcommands:
  DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP,
  DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS.

  Add scsi_zbc_in() and scsi_zbc_out() CCB building functions.

  Add scsi_ata_zac_mgmt_out() and scsi_ata_zac_mgmt_in() CCB/CDB
  building functions. Note that these have return values, unlike
  almost all other CCB building functions in CAM. The reason is
  that they can fail, depending upon the particular combination
  of input parameters. The primary failure case is if the user
  wants NCQ, but fails to specify additional CDB storage. NCQ
  requires using the 32-byte version of the SCSI ATA PASS-THROUGH
  command, and the current CAM CDB size is 16 bytes.

sys/cam/scsi/scsi_da.h:
  Add ZBC IN and ZBC OUT CDBs and opcodes.

  Add SCSI Report Zones data structures.

  Add scsi_zbc_in(), scsi_zbc_out(), scsi_ata_zac_mgmt_out(), and
  scsi_ata_zac_mgmt_in() prototypes.

sys/dev/ahci/ahci.c:
  Fix SEND / RECEIVE FPDMA QUEUED in the ahci(4) driver.

  ahci_setup_fis() previously set the top bits of the sector count
  register in the FIS to 0 for FPDMA commands. This is okay for
  read and write, because the PRIO field is in the only thing in
  those bits, and we don't implement that further up the stack.

  But, for SEND and RECEIVE FPDMA QUEUED, the subcommand is in that
  byte, so it needs to be transmitted to the drive.

  In ahci_setup_fis(), always set the the top 8 bits of the
  sector count register. We need it in both the standard
  and NCQ / FPDMA cases.

sys/geom/eli/g_eli.c:
  Pass BIO_ZONE commands through the GELI class.

sys/geom/geom.h:
  Add g_io_zonecmd() prototype.

sys/geom/geom_dev.c:
  Add new DIOCZONECMD ioctl, which allows sending zone commands to
  disks.

sys/geom/geom_disk.c:
  Add support for BIO_ZONE commands.

sys/geom/geom_disk.h:
  Add a new flag, DISKFLAG_CANZONE, that indicates that a given
  GEOM disk client can handle BIO_ZONE commands.

sys/geom/geom_io.c:
  Add a new function, g_io_zonecmd(), that handles execution of
  BIO_ZONE commands.

  Add permissions check for BIO_ZONE commands.

  Add command decoding for BIO_ZONE commands.

sys/geom/geom_subr.c:
  Add DDB command decoding for BIO_ZONE commands.

sys/kern/subr_devstat.c:
  Record statistics for REPORT ZONES commands. Note that the
  number of bytes transferred for REPORT ZONES won't quite match
  what is received from the harware. This is because we're
  necessarily counting bytes coming from the da(4) / ada(4) drivers,
  which are using the disk_zone.h interface to communicate up
  the stack. The structure sizes it uses are slightly different
  than the SCSI and ATA structure sizes.

sys/sys/ata.h:
  Add many bit and structure definitions for ZAC, NCQ, and EPC
  command support.

sys/sys/bio.h:
  Convert the bio_cmd field to a straight enumeration. This will
  yield more space for additional commands in the future. After
  change r297955 and other related changes, this is now possible.
  Converting to an enumeration will also prevent use as a bitmask
  in the future.

sys/sys/disk.h:
  Define the DIOCZONECMD ioctl.

sys/sys/disk_zone.h:
  Add a new API for managing zoned disks. This is very close to
  the SCSI ZBC and ATA ZAC standards, but uses integers in native
  byte order instead of big endian (SCSI) or little endian (ATA)
  byte arrays.

  This is intended to offer to the complete feature set of the ZBC
  and ZAC disk management without requiring the application developer
  to include SCSI or ATA headers. We also use one set of headers
  for ioctl consumers and kernel bio-level consumers.

sys/sys/param.h:
  Bump __FreeBSD_version for sys/bio.h command changes, and inclusion
  of SMR support.

usr.sbin/Makefile:
  Add the zonectl utility.

usr.sbin/diskinfo/diskinfo.c
  Add disk zoning capability to the 'diskinfo -v' output.

usr.sbin/zonectl/Makefile:
  Add zonectl makefile.

usr.sbin/zonectl/zonectl.8
  zonectl(8) man page.

usr.sbin/zonectl/zonectl.c
  The zonectl(8) utility. This allows managing SCSI or ATA zoned
  disks via the disk_zone.h API. You can report zones, reset write
  pointers, get parameters, etc.

Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D6147
Reviewed by: wblock (documentation)
14:00:18 - r300206
(5 days 13 hours ago)
by andrew
Affects:  /head/sys/arm64/include/resource.h
Define PCI_RES_BUS for NEW_PCIB

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
13:52:12 - r300205
(5 days 13 hours ago)
by tuexen
Affects:  /head/sys/net/if_tun.c
Allow writing IP packets of length TUNMRU no matter if TUNSIFHEAD is set
or not.
13:32:44 - r300204
(5 days 13 hours ago)
by bz
Affects:  /projects/vnet/sys/sys/kernel.h
Remove unused SI_SUB_PSEUDO_DONE.

Sponsored by: The FreeBSD Foundation
13:24:13 - r300203
(5 days 13 hours ago)
by bz
Affects: 
(182 files)
/projects/vnet/*
MfH @r300201.

Sponsored by: The FreeBSD Foundation
12:45:20 - r300202
(5 days 14 hours ago)
by ae
Affects:  /head/sys/netinet6/ip6_output.c
Since PFIL can change destination address, use its always actual value
from mbuf when calculating path mtu. Remove now unused finaldst variable.
Also constify dst argument in ip6_getpmtu() and ip6_getpmtu_ctl().

Reviewed by: melifaro
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
11:19:37 - r300201
(5 days 15 hours ago)
by mav
Affects:  /head/sys/sys/taskqueue.h
Add ta_flags initialization in old macros missed in 300113.

Depending on uninitialized memory content it could cause loss of wakeup()
call in taskqueue_run_locked().
11:02:39 - r300200
(5 days 16 hours ago)
by hselasky
Affects:  /head/sys/dev/usb/controller/generic_ohci.c
Fix bad sizeof().

Submitted by: David Binderman <dcb314@hotmail.com>
PR: 209636
10:56:55 - r300199
(5 days 16 hours ago)
by maxim
Affects:  /head/share/man/man8/nanobsd.8
o -f, -i, -K, -q, -v, -X flags documented.
10:39:04 - r300198
(5 days 16 hours ago)
by maxim
Affects:  /head/tools/tools/nanobsd/defaults.sh
/head/tools/tools/nanobsd/nanobsd.sh
o Remove EoL whitespaces.
10:37:44 - r300197
(5 days 16 hours ago)
by maxim
Affects:  /head/tools/tools/nanobsd/defaults.sh
o usage() updated for -h and -X flags.
06:29:43 - r300196
(5 days 20 hours ago)
by sgalabov
Affects:  /head/sys/mips/mediatek/mtk_soc.c
Ralink: Add more SoC compatible strings

Add more 'compatible' strings found in various LEDE DTS files.

Reviewed by: adrian
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6432
05:09:20 - r300195
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
[bwn] quieten the "invalid firmware state".

That pops up in the rev 5xx / 6xx microcode on the later cores
(4312, 4322.) I'm not sure why this is happening yet and I'll
dig into it, but Linux b43 does the same thing.
05:06:48 - r300194
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
/head/sys/dev/bwn/if_bwnreg.h
[bwn] program in the MAC capabilities somewhere where later microcode
expects it.

Obtained from: Linux b43
05:06:12 - r300193
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/gnu/dev/bwn/phy_n/if_bwn_radio_2057.c
[bwn] typo.
04:48:13 - r300192
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
[bwn] disable rfon checks so the 2056/2057 radios are programmed.

This was the big missing piece for getting the BCM94322MC NIC
to work at all.

Tested:

* BCM4322, STA mode (2g, 5g)
04:46:21 - r300191
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
[bwn] improve N-PHY debuggability a little bit.
04:45:50 - r300190
(5 days 22 hours ago)
by adrian
Affects: 
(6 files)
/head/sys/gnu/dev/bwn/phy_n/*
[bwn] add opt_wlan.h and opt_bwn.h to each of the phy_n source files.
04:29:25 - r300189
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
[bwn] add extra debugging.
04:28:49 - r300188
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
[bwn] toggle the PHY clock during chip reset.

Tested:

* BCM4311, STA mode
* BCM4312, STA mode
* BCM4321, STA mode
* BCM4322, STA mde
04:23:54 - r300187
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn.c
[bwn] enable dual-phy on BCM4322MC.

Tested (with later commits):

* BCM4322MC, STA mode, 2G + 5G
04:22:58 - r300186
(5 days 22 hours ago)
by adrian
Affects:  /head/sys/dev/bwn/if_bwn_phy_common.c
/head/sys/dev/bwn/if_bwnreg.h
[bwn] rename TGS low registers to be consistent with naming scheme.
04:11:49 - r300185
(5 days 23 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_core.c
/head/sys/dev/siba/sibareg.h
[siba] use consistent naming.
04:11:00 - r300184
(5 days 23 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_core.c
[siba] implement PMU behaviour for chips with a separate PMU module.

* PMU controls the clock setup
* Correctly set idle low power handling
* Use a hard-coded powerup delay for some of the newer hardware
  (including the BCM4322, which I've tested with.)

Tested:

* BCM4322, 2G + 5G STA mode

Obtained from: Linux b43 (PMU behaviour)
04:03:41 - r300183
(5 days 23 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_core.c
[siba] handle the PMU resource setup/init for 0x4322 series chips.

Tested (with other changes):

* BCM4322 11abgn device, chip id 0x4322.
04:02:13 - r300182
(5 days 23 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_core.c
[siba] fix up some comments and debug output.
04:01:33 - r300181
(5 days 23 hours ago)
by adrian
Affects:  /head/sys/dev/siba/siba_core.c
[siba] add DMA debugging section, for changes later on to DMA addressing.
03:56:07 - r300180
(5 days 23 hours ago)
by cy
Affects:  /head/etc/ntp/leap-seconds
Update leap-seconds to leap-seconds.3661459200.
NO leap second will be introduced at the end of June 2016.

This commit reapplies the r298887 minor spelling fix.

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/.
See also: http://www.iers.org/SharedDocs/News/EN/BulletinC.html
MFC after: 2 weeks
03:18:54 - r300179
(5 days 23 hours ago)
by cy
Affects:  /head/contrib/ipfilter/man/ipf.5
Fix another typo.

Reported by: cem
MFC after: 6 days
02:58:30 - r300178
(6 days ago)
by imp
Affects:  /head/Makefile.inc1
Turns out, mipsn32el worked at one point, so add it back in.

Pointed out by: jmallet@
02:06:48 - r300177
(6 days 1 hour ago)
by cy
Affects:  /head/contrib/ipfilter/man/ipf.5
Fix typo.

Reported by: Ruben Kerkhof <ruben@rubenkerkhof.com>
MFC after: 6 days
00:04:58 - r300176
(6 days 3 hours ago)
by jhibbits
Affects:  /head/sys/dev/tsec/if_tsec_fdt.c
Add an alternate compatible string for eTSEC devices.

Newer device trees now use fsl,etsec2 to denote eTSEC nodes. Same device, new
name.

 


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 56 ms, 468 revisions printed. Current time is 2016-05-25 03:13:44. All times are in UTC/GMT.