Build failed in Jenkins: FreeBSD_HEAD_amd64_gcc4.9 #3

From: <jenkins-admin_at_freebsd.org>
Date: Wed, 20 May 2015 22:04:47 +0000 (GMT)
See <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/3/changes>

Changes:

[bapt] Make kerberos use the same sqlite libraries as other sqlite consumer.

This reduces the number of copy of sqlite we have to just one and easier
tracking version of sqlite

Differential Revision:	https://reviews.freebsd.org/D2443
Reviewed by:	imp, stas, bjk

[ngie] Fix breakage I didn't fully solve in r283151 by depending on the .PHONY
target, not the directory when building libctf for libproc

Reported by: many, Jenkins
Submitted by: rodrigc

[oshogbo] Fix memory leak.

Approved by:	pjd (mentor)

[oshogbo] Style.

Approved by:	pjd (mentor)

[oshogbo] Always use the nv_free function.

Approved by:	pjd (mentor)

[oshogbo] Correct variable name in the interface.

Approved by:	pjd (mentor)

[kib] Remove the write-only variable phent.  We currently do not check the
size of the program header's entries.

Reported by:	adrian (by using gcc 4.9)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[ngie] Unbreak the arm64/sparc64 tinderbox by only compiling lib/libproc and
lib/librtld_db on architectures where they're supported

Reported by: bz, Jenkins
Pointyhat to: bapt

[ngie] cddl/lib/libctf isn't always a requirement for lib/libproc; its use is dependent
on MK_CTF != "no". Use the other divined value instead of reinventing the wheel

[ngie] Add _more_ missing dependencies for lib/libproc to further squash build races

Verified via `cd lib/libproc; make -VLIBADD`

Pointyhat to: ngie

[emaste] Avoid trying to build cxbge on 32-bit MIPS

It lacks required 64-bit atomics.

Reviewed by:	imp (earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2585

[ngie] Articulate all dependencies for lib/libproc to squash build races after r283139
on !arm64 and !sparc64

Pointyhat to: bapt
Sponsored by: EMC / Isilon Storage Division

[ngie] Build cddl/{sbin,usr.bin,usr.sbin} in parallel as all of the applications are
freestanding (they require libraries build via make libraries in buildworld)

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

[ae] In the reply to SADB_X_SPDGET message use the same sequence number that
was in the request. Some IKE deamons expect it will the same. Linux and
NetBSD also follow this behaviour.

PR:		137309
MFC after:	2 weeks

[ngie] Add dependencies for libzfs_core and libzpool I missed on my first pass on this
Makefile

MFC with: r283144
Sponsored by: EMC / Isilon Storage Division

[ngie] Articulate dependencies for cddl/lib/libdtrace and cddl/lib/libzfs

Parallelize the build in this subdirectory

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

[ngie] Remove usr/share/dtrace/{tcpconn,tcpstate,tcptrack,udptrack} if MK_CDDL == no

Sponsored by: EMC / Isilon Storage Division

[glebius] EVENTHANDLER_REGISTER() doesn't fail.

[trasz] Remove the warning about invalid PE checksum; apparently nothing
cares about those checksums anyway.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[ngie] Only build sys/boot/usb/tools if MK_USB != no

Sponsored by: EMC / Isilon Storage Division

[bapt] Fix buildworld by adding libproc and librtld_db to the _prebuild_libs
Those are needed to build libdtrace

[rpaulo] ti_pruss: pass the correct IRQ to userland.

Also, fix several problems with the kqueue notification.

Submitted by:	Manuel Stühn freebsdnewbie at freenet.de

[ganbold] D2432 (Patch for Amlogic single core PIC) moved the SMP option out
of AML8726 and into board specific config files since some boards
(e.g. YYHD18) use the aml8726-m3 which only have a single core.

r283057 applied most of D2432, however while it removed SMP from
AML8726, it missed adding the SMP option to the board specific
config files.

Differential Revision:	https://reviews.freebsd.org/D2589
Submitted by:	John Wehle

[hiren] Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire and purge all
entries in hostcache immediately.

In collaboration with:	bz, rwatson
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Limelight Networks

[bapt] Reduce overlinking.
Because of libdtrace there is still a bit a overlinking but nothing we can deal
with easily

[bapt] Correctly link libdtrace and convert to LIBADD
Make dtrace only link to libdtrace

[bapt] Fix underlinking

[bapt] Register libdtrace and its direct and indirect dependencies
Register librdlt_db
Register libproc dependencies
Register libctf dependencies

[bapt] Convert to LIBADD

[bapt] Convert to LIBADD
Remove dependency on pthread, it is not needed

[imp] Re-select the SD card before getting the SD status. On a couple Atmel
boards, this prevents some error messages during enumeration and also
gives us the correct erase block size. They appear to be harmless
elsewhere.

# Note: we treat too many commands as 'can't fail' if they don't work
# after a couple of retries. We need to fix that, but not today...

[imp] Add NFS server to mix (for easier, in-place updates). Move to
partition 2 for root (since partition 1 is reserved for FAT
files the Atmel ROMs can load).

[imp] Improve comment about unmapped I/O and fix typos.

Submitted by: Matteo Riondato
MFC After: 2 days

[emaste] All FreeBSD platforms are elf: move i386-elf to i386

This was a leftover from when we had both i386 a.out and ELF.

Reviewed by:	kib, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2591

[hiren] Correct the wording as we are increasing the window size.

Reviewed by:	jhb
Sponsored by:	Limelight Networks

[jhb] Fix two bugs that could result in PMC sampling effectively stopping.
In both cases, the the effect of the bug was that a very small positive
number was written to the counter. This means that a large number of
events needed to occur before the next sampling interrupt would trigger.
Even with very frequently occurring events like clock cycles wrapping all
the way around could take a long time. Both bugs occurred when updating
the saved reload count for an outgoing thread on a context switch.

First, the counter-independent code compares the current reload count
against the count set when the thread switched in and generates a delta
to apply to the saved count. If this delta causes the reload counter
to go negative, it would add a full reload interval to wrap it around to
a positive value. The fix is to add the full reload interval if the
resulting counter is zero.

Second, occasionally the raw counter value read during a context switch
has actually wrapped, but an interrupt has not yet triggered. In this
case the existing logic would return a very large reload count (e.g.
2^48 - 2 if the counter had overflowed by a count of 2). This was seen
both for fixed-function and programmable counters on an E5-2643.
Workaround this case by returning a reload count of zero.

PR:		198149
Differential Revision:	https://reviews.freebsd.org/D2557
Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	Norse Corp, Inc.

[jhb] Use the proper mask when reloading sampling PMCs for Core CPUs.

Differential Revision:	https://reviews.freebsd.org/D2492
Reviewed by:	emaste
MFC after:	1 month

[jhb] Use fixed enum values for PMC_CLASSES().

This removes one of the frequent causes of ABI breakage when new CPU
types are added to hwpmc(4).

Differential Revision:	https://reviews.freebsd.org/D2586
Reviewed by:	davide, emaste, gnn (earlier version)
MFC after:	2 weeks

[jhb] Remove executable property from several ixl(4) source files.

Differential Revision:	https://reviews.freebsd.org/D2583
Reviewed by:	erj

[melifaro] Bring back support for checking tables via "ipfw -n".

Currently we have different table key types which can easily interfere
with each other (numbers and IPv4 address, interface names and hostnames,
  flows and hostnames/addresses).
This conflicts are solved by [auto-]creating _typed_ tables, so after
table is created, only keys of given type can be inserted to that table.
ipfw(8) consults with kernel about key/value type for particular table so
it knows key/value interpretation.
However, we have 2 cases (adding entries to non-existing table and
  parsing configuration file via `ipfw -n`) when kernel is unable to
  provide us table info we need. Fix the latter case by partially importing
  old `table_fill_xentry()` parse function responsible for guessing key type.

Sponsored by:	Yandex LLC

[ae] Remove unneded mbuf length adjustment, M_PREPEND() already did that.

PR:		139387
MFC after:	1 week

[luigi] use proper types to represent function pointers

[asomers] Properly null-terminate strings in a kernel dump header.  A version string
longer than 192 bytes will cause the version field of a dump header to
overflow. strncpy doesn't null terminate it, so savecore will print a
corrupted info file. Using strlcpy fixes the bug.

Differential Revision:	https://reviews.freebsd.org/D2560
Reviewed by:		markj
MFC after:		3 weeks
Sponsored by:		Spectra Logic

[bjk] Fixup to the kern_psignal manpage

r283105 misspelled kern_psignal as kernel_psignal in one occurrence, and
added trailing whitespace.

While here, change 'call' to the more standard 'function', and say why
the name was changed (taken from the commit message for r225617).

[luigi] remove a redundant ; at the end of a function

MFC after:	1 week

[br] Add Performance Monitoring Counters support for AArch64.
Family-common and CPU-specific counters implemented.

Supported CPUs: ARM Cortex A53/57/72.

Reviewed by:	andrew, bz, emaste, gnn, jhb
Sponsored by:	ARM Limited
Differential Revision:	https://reviews.freebsd.org/D2555

[luigi] remove an extra ; after MODULE_DEPEND
(would otherwise generate a warning with more verbose compiler flags)

MFC after:	1 week

[emaste] Add GRP_COMDAT section group flag to ELF header

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2582

[kib] When sleeping in Sx state using MWAIT instruction, accept fast wakeup
requests from writes to the monitored line.

Submitted by:	avg

[emaste] Update crunch bootstrapping test for recent fixes

- r277259 crunchide: Correct 64-bit section header offset
- r281674 crunchide: always include both 32- and 64-bit ELF support

With built-in cross-size support we also no longer need a special case
for cross-build crunchide.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2576

[glebius] Use MTX_SYSINIT() instead of mtx_init() to separate mutex initialization
from associated structures initialization.  The mutexes are global, while
the structures are per-vnet.

Submitted by:	Nikos Vassiliadis <nvass gmx.com>

[glebius] During module unload unlock rules before destroying UMA zones, which
may sleep in uma_drain(). It is safe to unlock here, since we are already
dehooked from pfil(9) and all pf threads had quit.

Sponsored by:	Nginx, Inc.

[julian] Only several years late, catch the psignal man page up to the
fact that psignal has been renamed to kern_psignal since 9.0.

MFC after:	1 week

[ae] Read GEOM_UNCOMPRESS metadata using several requests that fit into
MAXPHYS. For large compressed images the metadata size can be bigger
than MAXPHYS and this triggers KASSERT in g_read_data().
Also use g_free() to free memory allocated by g_read_data().

PR:		199476
MFC after:	2 weeks

[hselasky] Fix for DWC OTG device side isochronous transfers. The even or odd
isochronous frame bit needs to be flipped.

MFC after:	3 days

[ae] Change SA's state before sending SADB_EXPIRE message. This state will
be reported to keying daemon.

MFC after:	2 weeks

[ae] Teach key_expire() send SADB_EXPIRE message with the SADB_EXT_LIFETIME_HARD
extension header type. The key_flush_sad() now will send SADB_EXPIRE
message when HARD lifetime expires. This is required by RFC 2367 and some
keying daemons rely on these messages. HARD lifetime messages have
precedence over SOFT lifetime messages, so now they will be checked first.
Also now SADB_EXPIRE messages will be send even the SA has not been used,
because keying daemons might want to rekey such SA.

PR:		200282, 200283
Submitted by:	Tobias Brunner <tobias at strongswan dot org>
MFC after:	2 weeks

[adrian] Convert routerstation to use geom_uncompress.

[adrian] Migrate RSPRO to use the uncompress module, not uzip.

(This is hand-in-hand with what I'm about to do with freebsd-wifi-build.)

[adrian] QCA955x / AP135 platform tidyups.

* Change mips24k -> mips74k for hwpmc, but leave it disabled for now.
* don't build pci by default.
* build pci and qca955x_pci for AP135, as theres a PCIe NIC.
* don't build a hwpmc module, it doesn't really work out well
  for the mips boards at the moment.
* add ipfw and DEFAULT_TO_ACCEPT.

[adrian] The AP135 PCIe NIC isn't an ath device, it's an 11ac part (linux ath10k.)
So, don't try to attach hints to it here.

[adrian] Add initial support for the QCA955x PCIe host controller.

The QCA955x looks a lot like the AR724x PCIe controller, except it
supports two root complexes.  Unfortunately I only have one, so
although this code has started down the path of supporting more than
one, it's definitely not yet ready.

Tested:

* AP135 board (QCA9558 SoC), with the 11ac NIC swapped for an AR9380
  PCIe NIC.

Notes:

* Yes, this driver isn't very pretty.  I decided to commit what I have
  versus holding onto something that isn't yet finished.  It is enough
  to bring up the above NIC and interrupt routing works, so it's a good
  start.

* However, yes, the DDR flush routine hooks need to be fixed up.
  I don't think I'm firing the right one at the moment.

[adrian] Add mv / expr ; these are used by the updated freebsd-wifi-build environment.

[pkelsey] Added description of POSIX-specified behavior when invoked on a key from within that key's destructor.

Reviewed by: jhb, -doc
Approved by: jmallett (mentor)
MFC after: 3 days
Sponsored by: Norse Corp, Inc.

[jkim] Merge ACPICA 20150515.

[bapt] Synchronize with OpenBSD

Obtained from:	OpenBSD

[pfg] ddb: stop boolean screaming.

TRUE --> true
FALSE--> false

Hinted by:	NetBSD

[bapt] Synchronize libedit with NetBSD

It incorporates and fixes our patches to get el_gets return the proper count of
characters in unicode mode.

[edwin] MFV of 283077,tzdata2015d

Update to tzdata2015d:

Release 2015d - 2015-04-24 08:09:46 -0700

  Changes affecting future time stamps

    Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

  Change affecting past and future time zone abbreviations

    The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.

[allanjude] Fix off-by-one in array index bounds check

bhyveload would allow you to create 33 entries on an array that only has 32 slots

Differential Revision:	https://reviews.freebsd.org/D2569
Reviewed by:	araujo
Approved by:	neel
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.

[allanjude] Fix error in gmountver(8) man page

Also fixes the usage statement for the binary to use the correct terms (provider and geom name, rather than dev and prov, which is incorrect in the latter case)
Sync the man page summary with the new usage statement

PR:		199540
Differential Revision:	https://reviews.freebsd.org/D2329
Submitted by:	Fabian Keil
Reviewed by:	trasz
Approved by:	eadler (mentor)
Obtained from:	ElectroBSD (original)
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.

[jmg] Don't do things we aren't allowed to do in a signal handler...  Defer
the work to the main thread...  This fixes a possible crash if SIGINFO
is delivered at the wrong time...

This still leaves getrusage broken for some reason, but I believe that
is a kernel issue and cannot be fixed here...

[loos] Remove unnecessary devices from allwinner kernels.

[loos] Properly align the header and the data columns for netstat -r with and
without the -W flag.

[bapt] Garbage collect GNU soelim Makefiles which are not in used anymore

[ian] Enable the NETIF_OPEN_CLOSE_ONCE option for ubldr.  This keeps the network
interface open continuously instead of closing it after each filesystem
access and reopening it before the next (causing it to re-obtain network
params each time).  This vastly speeds up netbooting.

[pfg] Drop some unnecessary casts.

Reported by:	Clang static analyzer
Obtained from:	NetBSD

[hselasky] Make the FIFO configuration a bit more flexible for the DWC OTG in
device side mode.

[ian] Add a routine to obtain netboot parameters from the U-Boot env vars.  Call
it from the uboot net_init() implementation.  The routine uses the standard
U-Boot env vars plus a freebsd-specific variable named "rootpath" (the
corresponding u-boot variable for that would be "bootfile" except that it
refers to ubldr, so a new name was needed to communicate the path to ubldr).

This allows ubldr to load a kernel from nfs without requiring a dhcp or
bootp server to provide the server ip and rootpath parameters.

[bapt] Only build libreadline if gdb is going to be built

gdb is the only consumer of libreadline which is an INTERNALLIB

[hselasky] Fix an off-by-one error by adding proper range checks when parsing the
HDA association descriptors. This fixes a crash during device probe
for some HDA PCI devices.

Reported by:	David Wolfskill <david_at_catwhisker.org>
Reviewed by:	mav _at_
MFC after:	1 week

[glebius] A miss from r283061: don't dereference NULL is pf_get_mtag() fails.

PR:		200222
Submitted by:	Franco Fichtner <franco opnsense.org>

[ian] Refactor net_getparams() to make it easier to get params from sources other
than bootp and rarp.

The code which splits a serverip:/rootpath string into rootip and a plain
pathname is now a separate net_parse_rootpath() function that can be
called by others.  The code that sets the kernel env vars needed for
nfs_diskless is moved into net_open() so that the variables get set no
matter where the params came from.

There was already code in net_open() that allowed for the possibility that
some other entity has set up the network-related global variables.  It uses
the rootip variable as the key, assuming that if it is set all the other
required variables are set too.  These changes don't alter the existing
behavior, they just make it easier to actually write some new code to get
the params from another source (such as the U-Boot environment).

[glebius] Don't dereference NULL is pf_get_mtag() fails.

PR:		200222
Submitted by:	Franco Fichtner <franco opnsense.org>

[emaste] Build libgcov only if we're building base system GCC

Clang uses compiler-rt for the code coverage runtime, and ports GCC
provides its own libgcov.

PR:		200203 (exp-run)
Sponsored by:	The FreeBSD Foundation

[mjg] fd: fix imbalanced fdp unlock in F_SETLK and F_GETLK

MFC after:	3 days

[mjg] Tidy up sys_umask a little bit

Consistently use saved fdp pointer as it cannot change. If it could change the
code would be already incorrect.

No functional changes.

[andrew] Clean up the Amlogic interrupt controller driver to handle the case where
we have both the Amlogic pic and a GIC. This may be the case in some
configurations.

Differential Revision:	https://reviews.freebsd.org/D2432
Submitted by:	John Wehle <john_at_feith.com>

[ngie] Move all test integration pieces for etc/ from etc/ to tests/

This is being done to fix breakage with make distribution with read-only
source trees as make distribution doesn't use make obj like building
tests/ does in all cases

Reported by: Wolfgang Zenker <wolfgang_at_lyxys.ka.sub.org>
Suggested by: jhb
X-MFC with: r282059
MFC after: 1 week

[whu] Add support for SCSI disk hot add and remove. Also add padding according to
the requirement of different hypervisor releases.

Submitted by:	whu
Reviewed by:	royger
Approved by:	royger
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D2512

[andrew] Clean up the style to be "include<space><tab>" and remove options already
in std.armv6.

[arybchik] sfxge: do not advertise LRO capability if LRO is compiled out

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2565

[arybchik] sfxge: automatically turn off TSO when Tx checksum offload is disabled

Also return error if TSO is requested without Tx checksum offload.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2564

[arybchik] sfxge: allow to disable checksum offloads over VLAN

It just affects capabilities of the created VLAN interface.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2563

[arybchik] sfxge: fix overflow queue freeze

If TxQ lock is obtained, deferred packet list shold be serviced even if
the packet addition fails because of overflow.

Without the patch freeze happens if:
 - queue is not blocked (i.e. completion does not trigger unblock and service)
 - put-list overflow (1024 entries)
 - sfxge_tx_packet_add() acquires TxQ lock just as it is released it in
   sfxge_tx_qdpl_service() on the second CPU but before pending check
 - sfxge_tx_packet_add() swizzles put-list to get-list, fails because of
   non-tcp get-list overflow and returns without packet list service
 - sfxge_tx_qdpl_service() on the second CPU checks that there are no
   pending packets in the put-list and returns

Other possible solution is to guaranee that maximum length of the put-list
is less than maximum length of any get-list.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2562

[edwin] MFV of 283040,tzdata{2015c}

Update to tzdata2015c:

    Release 2015c - 2015-04-11 08:55:55 -0700

    Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)

[markj] Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from
a test which now passes as a result of that change.

[markj] Respect the libdir option when linking drti.o, rather than hardcoding the
default path of /usr/lib(32)/dtrace.

MFC after:	3 weeks

[ian] An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.

Previously, ubldr would use the virtual addresses in the elf headers by
masking off the high bits and assuming the result was a physical address
where the kernel should be loaded.  That would sometimes discard
significant bits of the physical address, but the effects of that were
undone by archsw copy code that would find a large block of memory and
apply an offset to the source/dest copy addresses.  The result was that
things were loaded at a different physical address than requested by the
higher code layers, but that worked because other adjustments were applied
later (such as when jumping to the entry point).  Very confusing, and
somewhat fragile.

Now the archsw copy routines are just simple copies, and instead
archsw.arch_loadaddr is implemented to choose a load address.  The new
routine uses some of the code from the old offset-translation routine to
find the largest block of ram, but it excludes ubldr itself from that
range, and also excludes   If ubldr splits the largest block of ram in
two, the kernel is loaded into the bottom of whichever resulting block is
larger.

As part of eliminating ubldr itself from the ram ranges, export the heap
start/end addresses in a pair of new global variables.

This change means that the virtual addresses in the arm kernel elf headers
now have no meaning at all, except for the entry point address.  There is
an implicit assumption that the entry point is in the first text page, and
that the address in the the header can be turned into an offset by masking
it with PAGE_MASK.  In the future we can link all arm kernels at a virtual
address of 0xC0000000 with no need to use any low-order part of the
address to influence where in ram the kernel gets loaded.

[andrew] Clean up struct syscall_args:
 1. Align to a 64-bit address so 64-bit data will be correctly aligned.
 2. Add a comment explaining why.
 3. Remove an unneeded value from the struct.

This fixes an issue where the struct may not be correctly aligned on the
stack in the syscall function. This may lead to accesing a 64-bit value
at a non 64-bit. This will raise an exception and panic the kernel.

We have been lucky where on arm and armv6 both clang and gcc correctly
align the data, even without us asking to, however, on armeb with clang to
not be the case. This tells the compiler we really do need this to be
aligned.

Reported and tested by:	jmg (on armeb with clang)
MFC after:	1 Week [1, 2]

[ian] Do not set preload_addr_relocate for ARM.  Apparently there was a time
when loader(8) passed physical addresses in loader metadata for arm, but
that is no longer true; all metadata has already been adjusted to vitual
addresses by loader.

I can't track down the exact revision in loader where a change from physical
to virtual metadata addresses happened.  The code involved is very twisty
and complicated.  I suspect the change was an unintended consequence of the
r247301, r247413, r248118 series of changes I made a couple years ago.

[kargl] In r279493, the functions pzero[f](), qzero[f], pone[f](),
and qone[f]() were marked as __inline, but their forward
declarations were not updated.  Fix the forward declarations
to match the actual function declarations.

Requested by:	 bde

[sbruno] Update intree gdb/kgdb to handle 2 dwarf types:
DW_OP_GNU_uninit
DW_OP_piece

This squashes the warnings about type 0x93 not known in kgdb when opening a kernel crash dump.

Upstream refs:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=87808bd699575a850139a1f916512ab7a47fd496
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=42be36b328ae784ae6981da7c7cab95b67ed7737
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=23572ecadc89af384c1804ad7692f32c55fbfc80

Differential Revision:	https://reviews.freebsd.org/D2534
Reviewed by:	emaste, jhb, davide

[loos] Adjust the string format to match the actual number of arguments.

This fix a segmentation fault on ARM when netstat -r is used together with
-W.

This issue was introduced in r279122.

[markj] Actually remove siftr-related definitions from tcp.d, missed in r283026.

[markj] Move siftr-related definitions out of tcp.d and into a separate library
which declares a dependency on siftr(4). This is necessitated by a
reference to struct pkt_node, which is defined in siftr(4): otherwise,
dtrace(1) will return an error during startup if siftr.ko is not loaded.

[markj] As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
return an error if one of the depends_on directives in a library is not
satisfied. In this case, libdtrace is supposed to ignore the library and
carry on. However, the remainder of the library may still be buffered by
the lexer, causing libdtrace to erroneously continue processing it on the
next call to yyparse(). Fix this by explicitly flushing the input buffer
each time the compiler state is reset.

MFC after:	3 weeks

[markj] When in lazyload mode, write the DOF to a temporary file and rename it
rather than writing directly to the output file.

CID:	1147172

[allanjude] bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized

Differential Revision:	https://reviews.freebsd.org/D2571
Reviewed by:	dim
Approved by:	eadler (mentor)
Sponsored by:	ScaleEngine Inc.

[adrian] Increment the vm stats "v_intr" counter so the global system interrupt
statistics work again.

I'm not sure why/when this broke, only that it used to work fine.

This commit is brought to you by Maker Faire Bay Area 2015.

[ngie] Fix more warnings related to missing headers

MFC after: 1 week

[imp] Don't allow unmapped I/O. The pmap isn't quite up to the task. Add a
comment to this effect and switch the default. My old AT91SAM9G20
now boots, fsck's the SD card and runs w/o an issue for the first
time since a 9.1-ish stable build I did a few years ago.

Problems with unmapped I/O:
o un-page-aligned I/O requests to devices fail (notably fsck
  and newfs).
o write-back caching was totally broken. write-through caching
  needed to be enabled.
o Even page-aligned I/O requests sometimes failed for reasons
  not thoroughly investigated.

Suggested by: ian_at_
MFC after: 2 days

[ian] Re-link ubldr when any of its libraries change.

[rpaulo] acpi_ibm: whitespace.

[bz] More tr -d '\r' t make config happy and
some re-alignment whitespace changes.

[melifaro] * Update SFF-8024 Identifier constants.
* Fix SFF_8436_CC_EXT in SFF-8436 memory map.
* Add SFF-8436/8636 bits (revision compliance/nominal bitrate).
* Do some small style/type fixes.

[rmacklem] Add a warning message to mountd for exported file
systems that are automounted, since that configuration
isn't supported. This still allows the export, since
two emails I received felt that this should not be
disabled. It sends the message to syslog(LOG_ERR..), so that
it goes to the same places as the other messages related
to /etc/exports problems, even though it is a warning and not an error.

Reviewed by:	trasz
MFC after:	2 weeks

[arybchik] sfxge: avoid usage of ifm_data

The driver uses ifm_data to save capabilities mask calculated during
initialization when supported phy modes are discovered.
The patch simply calculates it when either media or options are changed.

Reviewed by:    glebius
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2540

[thomas] Minor comments fixes

[bz] tr -d '\r' makes config a lot more happy.

[delphij] path.h is not needed here.

[adrian] Make these all work with the new way of doing privatelib.

Without these CFLAGS settings a cross-compile won't find the headers
anywhere.

Tested:

* mips (32, big endian) cross-build w/ LOCAL_DIRS including these
  tools.

[eadler] ssh-copy-id: Add missing line continuation

PR:		194301
Reported by:	pkubaj_at_riseup.net
Patch by:	Ross Kilgariff <rosskilgariff_at_gmail.com>

[arybchik] sfxge: add local variable with changed capabilities mask

It is required for the next patch which adds dependency of TSO
capabilities from Tx checksum offloads.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2553

[adrian] Various iwn(4) fixes.

* simplify channel logic for determining RF gain setting in scan setup
* don't set TX timer on error
* free node references for unsent frames on device stop
* set maxfrags to IWN_MAX_SCATTER-1 (first segment is used by TX command)
* add missing IWN_UNLOCK() from interrupt path when the hardware
  disappears.
* pass control frames to host
* nitems() instead of local macro

Tested:

* Intel 5100, STA mode

PR:		kern/196264
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[arybchik] sfxge: move mbuf free to sfxge_if_transmit()

It is a preparation to the next patch which will service packet queue even
if packet addtion fails.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2552

[arybchik] sfxge: get rid of locked variable in sfxge_tx_packet_add()

Now each branch has one and only one possible TxQ lock state.
It simplifies understanding of the code.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2551

[arybchik] sfxge: support Rx checksum offloads disabling

We can't disable it in HW, but we can ignore result.
Discard Rx descriptor checksum flags if Rx checksum offload is off.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2544

[dim] Provide reallocarray() in -legacy, if needed, to allow building head on
previous releases.

Also add a stdlib.h wrapper, which declares the function, otherwise the
compiler may assume it returns int, which can cause segfaults on LP64
architectures.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D2558

[adrian] Update the comments to match what the code ended up becoming.

-1 is now "no locality information available".

Sponsored by:	Norse Corp, Inc.

[pfg] Break apart the gnu_inline attribute and use "artificial" if available.

Missing #endif (in wrong place)

Pointed hat:	me

[pfg] Break apart the gnu_inline attribute and use "artificial" if available.

Missing #endif

Reported by:	jhb, jenkins
Pointed hat:	me

[pfg] Make use of GCC alloc_align attribute

This lets the compiler know about the alignment of pointers returned
by aligned_alloc(3), posix_memalign(3). and contigmalloc(9)

Currently this is only supported in recent gcc but we are ready to
use it if clang implements it.

Relnotes:	yes

[pfg] Break apart the gnu_inline attribute and use "artificial" if available.

In general it is bad practice to use the gnu_inline attribute but we
will need it in special cases like FORTIFY_SOURCE. In this specific
case it is also useful to have the "artificial" attribute:

"This attribute is useful for small inline wrappers which if possible
should appear during debugging as a unit, depending on the debug info
format it will either mean marking the function as artificial or using the
caller location for all instructions within the inlined body."

This attribute appears to be currently implemented only in GCC. Use it
only in conjuntion with gnu_inline in the cases where it is available,
which is similar in spirit in how it's used in glibc.

[cy] Correct location for libntpevent.a.

[zbb] Introduce support for the Alpine PoC from Annapurna Labs

The Alpine Platform-On-Chip offers multicore processing
(quad ARM Cortex-A15), 1/10Gb Ethernet, SATA 3, PCI-E 3,
DMA engines, Virtualization, Advanced Power Management and other.

This code drop involves basic platform support including:
SMP, IRQs, SerDes, SATA. As of now it is missing the PCIe support.
Part of the functionality is provided by the low-level code (HAL)
delivered by the chip vendor (Annapurna Labs) and is a subject to
change in the future (is planned to be moved to sys/contrib directory).

The review log for this commit is available here:
https://reviews.freebsd.org/D2340

Reviewed by:    andrew, ian, imp
Obtained from:  Semihalf
Sponsored by:   Annapurna Labs

[ian] Add assertions that the addresses passed to tlb maintenance are page-aligned.

Perform cache writebacks and invalidations in the correct (inner to outer
or vice versa) order, and add comments that explain that.

Consistantly use 'va' as the variable name for virtual addresses.

Submitted by:	Michal Meloun <meloun_at_miracle.cz>

[ian] Retrieve the cache parms in the proper arch-specific way.

Submitted by:	Michal Meloun <meloun_at_miracle.cz>

[gnn] Summary: Remove spurious, extra, next header comments.
Correct the name of the pad length field.

[pfg] Replace a CONSTCOND for a void value as a replacement for __unreachable builtin

This only applies if we are not using clang or gcc but it lets us use the
__unreachable() buitin in expressions.

Suggested by:	tijl

[bapt] Allow MANWIDTH to work with mandoc(1)

Reported by:	bdrewery

[pkelsey] When a netmap process terminates without the full set of buffers it
was granted via rings and ni_bufs_list_head represented in those rings
and lists (e.g., via SIGKILL), those buffers are no longer available
for subsequent users for the lifetime of the system. To mitigate this
resource leak, reset the allocator state when the last ref to that
allocator is released.

Note that this only recovers leaked resources for an allocator when
there are no longer any users of that allocator, so there remain
circumstances in which leaked allocator resources may not ever be
recovered - consider a set of multiple netmap processes that are all
using the same allocator (say, the global allocator) where members of
that set may be killed and restarted over time but at any given point
there is one member of that set running.

Based on intial work by adrian_at_.

Reviewed by: Giuseppe Lettieri (g.lettieri_at_iet.unipi.it), luigi
Approved by: jmallett (mentor)
MFC after: 1 week
Sponsored by: Norse Corp, Inc.

[emaste] Build libgomp only if we're also building base system GCC

Clang's OpenMP support will emit Intel OpenMP API library calls,
and will therefore require libiomp (or whatever name is settled on).
An up-to-date version of libgomp is included in ports or pkg GCC.
Thus, there is no reason to build base libgomp without base system GCC.

PR:		199979 (exp-run)
Reviewed by:	pfg
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2459

[br] Provide the number of interrupt resources added to the list
by using extra argument, so caller will know that.

[jhb] Previously, cv_waiters was only updated by cv_signal or cv_wait. If a
thread awakened due to a time out, then cv_waiters was not decremented.
If INT_MAX threads timed out on a cv without an intervening cv_broadcast,
then cv_waiters could overflow. To fix this, have each sleeping thread
decrement cv_waiters when it resumes.

Note that previously cv_waiters was protected by the sleepq chain lock.
However, that lock is not held when threads resume from sleep. In
addition, the interlock is also not always reacquired after resuming
(cv_wait_unlock), nor is it always held by callers of cv_signal() or
cv_broadcast(). Instead, use atomic ops to update cv_waiters. Since
the sleepq chain lock is still held on every increment, it should
still be safe to compare cv_waiters against zero while holding the
lock in the wakeup routines as the only way the race should be lost
would result in extra calls to sleepq_signal() or sleepq_broadcast().

Differential Revision:	https://reviews.freebsd.org/D2427
Reviewed by:	benno
Reported by:	benno (wrap of cv_waiters in the field)
MFC after:	2 weeks

[mav] Close some potential races around socket start/close.

There are some reports about panics on ic->ic_socket NULL derefence.
This kind of races is the only way I can imagine it to happen.

MFC after:	2 weeks

[jah] Bump date for iic.4

[melifaro] Simplify i2c reader: we don't need per-NIC handler anymore.
Make code use read_i2c() function instead of callback.
Simplify&document struct i2c_info.
Consistently use uint8_t to read from i2c.

[jah] Update iic(4) man page to reflect recent changes

Differential Revision:	https://reviews.freebsd.org/D2461
Reviewed by:	wblock
Approved by:	kib (mentor)

[ae] Add an ability accept encapsulated packets from different sources by one
gif(4) interface. Add new option "ignore_source" for gif(4) interface.
When it is enabled, gif's encapcheck function requires match only for
packet's destination address.

Differential Revision:	https://reviews.freebsd.org/D2004
Obtained from:	Yandex LLC
MFC after:	2 weeks
Sponsored by:	Yandex LLC

[kib] Some third-party malloc(3) implementations use pthread_setspecific(3)
to handle per-thread information.  Since our pthread_setspecific()
implementation calls calloc(3) to allocate per-thread specific data
storage, things get complicated.

Switch the allocator to use bare mmap(2).  There is some loss of the
allocated page, since e.g. on amd64, PTHREAD_KEYS_MAX * sizeof(struct
pthread_specific_elem) is 3K (it actually spans whole page due to
padding), but I believe it is more acceptable than additional code for
specialized allocator().

The alternatives would either to make the specific data array be part of
the struct thread, or use internal bindings to call the libc malloc,
avoiding interposing.

Also do the style pass over the thr_spec.c, esp. simplify the
conditionals nesting by returning early when an error detected.
Remove trivial comments.

Found by:	yuri_at_rawbw.com
PR:	200138
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks

[kib] On amd64, make proc0 pmap initialization slightly more correct.  In
particular, switch to the proc0 pmap to have expected %cr3 and PCID
for the thread0 during initialization, and the up to date pm_active
mask.

pmap_pinit0() should be done after proc0->p_vmspace is assigned so
that the amd64 pmap_activate() find the correct curproc pmap.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[kib] Implement the support for PCID in UP kernels.

Requested by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[kib] Right now, the process' p_boundary_count counter is decremented by the
suspended thread itself, on the return path from
thread_suspend_check().  A consequence is that return from
thread_single_end(SINGLE_BOUNDARY) may leave p_boundary_count
non-zero, it might be even equal to the threads count.

Now, assume that we have two threads in the process, both calling
execve(2).  Suppose that the first thread won the race to be the
suspension thread, and that afterward its exec failed for any reason.
After the first thread did thread_single_end(SINGLE_BOUNDARY), second
thread becomes the process suspension thread and checks
p_boundary_count.  The non-zero value of the count allows the
suspension loop to finish without actually suspending some threads.
In other words, we enter exec code with some threads not suspended.

Fix this by decrementing p_boundary_count in the
thread_single_end()->thread_unsuspend_one() during marking the thread
as runnable.  This way, a return from thread_single_end() guarantees
that the counter is cleared.  We do not care whether the unsuspended
thread has a chance to run.

Add some asserts to ensure the state of the process when single
boundary suspension is lifted.  Also make thread_unuspend_one()
static.

In collaboration with:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[arybchik] sfxge: split sfxge_tx_qdpl_put() into *_locked() and *_unlocked()

It simplifies understanding of the sfxge_tx_packet_add() logic and
avoids passing of 'locked' to called function.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2547

[arybchik] sfxge: do not change CSUM_TSO when IFCAP_TSOx is changed

It is simply not required since the kernel checks corresponding
IFCAP_TSOx capability and CSUM_TSO in hw-assisted offloads.
Note that CSUM_TSO is two bits (CSUM_IP_TSO|CSUM_IP6_TSO) and both bits
are set in IPv4 and IPv6 mbufs.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2546

[arybchik] sfxge: LRO may be done only if checksums are OK

Also it is cheaper to check Rx descriptor flags than TCP protocol in IP
header.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2542

[araujo] Free vsi->queues after use.

Differential Revision:	D2344
Reviewed by:		erj

[ganbold] It appears to be armv7_sleep is a duplication of armv7_cpu_sleep.
For consistency with the naming conventions used by the other
implementations kill armv7_sleep and keep armv7_cpu_sleep.

Differential Revision:	https://reviews.freebsd.org/D2537
Submitted by:	John Wehle
Reviewed by:	ian_at_, andrew_at_

[delphij] MFV r282927,r282928,r282930 (kientzle):

Don't segfault when reading malformed cpio archives.

MFC after:	3 days

[grehan] Bump the size of the blockif scatter-gather list to 67.

The Windows virtio driver ignores the advertized seg_max
field and assumes the host can accept up to 67 segments
in indirect descriptors, triggering an assert in the bhyve
process.

No objection from:	mav
Reviewed by:	neel
Reported and tested by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[jimharris] Add nvme and nvd drivers to GENERIC for amd64 and i386.

MFC after:	3 days
Sponsored by:	Intel

[emaste] vtfontcvt: Allow 6 digits in verbose output

Some fonts (e.g. GNU Unifont) have more than 100,000 (half-)glyphs.

Sponsored by:	The FreeBSD Foundation

[emaste] Update to ELF Tool Chain r3197

Highlights:
 - Fix man page markup, whitespace, and typos
 - Fix sh_info of SHT_GROUP section to point to the correct string
 - Improve validation in readelf and elfcopy/strip
 - Handle DWARF 4's DW_AT_high_pc in addr2line

Sponsored by:	The FreeBSD Foundation

[emaste] Add ELF machine EM_IAMCU, 32-bit Intel MCU

It is e_machine 6, which was previously reserved for 486.

[emaste] kbdmap(1): Correct menu title: keyboards have a layout, not a language

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2545

[bapt] libyaml.so.1 are actually libraries and should only be removed during
make delete-old-libs

Reported by:	rpaulo

[rpaulo] ObsoleteFiles: add lib32 entries for libyaml missed in r262407.

Pointy hat:	bapt

[emaste] Add fabs() to arm64 libc

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2532

[royger] netfront: wait for backend to connect before sending ARP

Netfront has to wait for the backend to switch to state XenbusStateConnected
before sending the ARP request, or else the backend might not be connected
and thus the packet will be lost.

Sponsored by: Citrix Systems R&D
MFC after: 1 week

[pfg] Add new __unreachable() builtin

This is one of the few post gcc4.2 builtins that has been implemented by
clang:

__builtin_unreachable is used to indicate that a specific point in the
program cannot be reached, even if the compiler might otherwise think it
can. This is useful to improve optimization and eliminates certain
warnings.

Hinted by:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D2536

[jonathan] Allow sizeof(cpuset_t) to be queried in capability mode.

This allows functions that retrieve and inspect pthread_attr_t objects to
work correctly: querying the cpuset_t size is part of querying CPU
affinity information, which is part of creating a complete pthread_attr_t.

Approved by: rwatson (mentor)
Reviewed by: pjd
Sponsored by: NSERC

[emaste] Restore 'he' language code for Hebrew kbdmap(1) menu title

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

[emaste] kbdmap(1): increase description size to 256 bytes

After conversion to UTF-8 some INDEX.keymaps descriptions are longer
than the previous limit of 64 bytes.

PR:		193656
Sponsored by:	The FreeBSD Foundation

[arybchik] sfxge: advertise IPv6 Rx and Tx checksum offload support

Tx checksum offload may be enabled/disabled.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2543

[emaste] Correct language code -- "Danish" is English

The menu entry "Danish ISO-8859-1 (macbook)" was first added to the
syscons(4) INDEX.keymaps in r241851 with no language code, and then in
r256367 incorrectly tagged with "da".  It is a Danish keyboard map, but
the description is in English and therefore must be "en".

This error subsequently propagated into the vt(4) INDEX.keymaps.

PR:		146793, 193656
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

[trasz] Build GENERIC with RACCT/RCTL support by default.  Note that it still
needs to be enabled by adding "kern.racct.enable=1" to /boot/loader.conf.

Differential Revision:	https://reviews.freebsd.org/D2407
Reviewed by:	emaste_at_, wblock_at_
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation

[arybchik] sfxge: IPv4 Tx checksum offload may be disabled in fact

Split IFCAP_HWCSUM to IFCAP_RXCSUM and IFCAP_TXCSUM to highlight Tx and Rx.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2541

[arybchik] sfxge: add local variable with Rx descriptor flags

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

[emaste] Correct UTF-8 encoding in Británico

One á was ISO 8859-1 0xE1 instead of UTF-8 0xC3 0xA1.

[arybchik] sfxge: add missing const qualifier to sfxge_link_mode

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

[andrew] Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks building
for big-endian arm.

[fanf] whois: add an option to query the PeeringDB

[fanf] Update whois(1) synopsis.

[fanf] Bump whois(1) date.

(Thanks to bz_at_ for the reminder!)

[fanf] whois: alphabetize whois server list

[fanf] whois: do not clobber command-line flags when tweaking O_NONBLOCK

This can make whois fail to follow referrals when it should.
The bug was introduced in r281959.

[fanf] whois: try whois.nic.TLD if TLD.whois-servers.net does not exist

Based on an idea from OpenBSD.

[fanf] whois: check WHOIS_SERVER as well as RA_SERVER environment variables

WHOIS_SERVER is used by Debian's whois client.

[fanf] whois: code cleanup

Remove deprecated options.

Use pedantically correct types.

[fanf] whois: special case certain query suffixes

This extends the existing support for -NORID handles
to include -NICAT, -ARIN, and -RIPE handles.

The suffix machinery is also used to work around a problem with
lack of referrals from the Nominet server for .uk: names under
.ac.uk need to be queried directly at JANET's whois server.

[fanf] Clean up whois manual.

Document the RA_SERVER environment variable.

Remove the obsolete -R option, and discourage people from trying
to use the Network Solutions server.

Describe the default behaviour in the DESCRIPTION section,
not buried in the options.

[mav] Do not promote large async writes to sync.

Present implementation of large sync writes is too strict and so can be
quite slow.  Instead of doing that, execute large async write in chunks,
syncing each chunk separately.

It would be good to fix large sync writes too, but I leave it to somebody
with more skills in this area.

Reviewed by:	rmacklem
MFC after:	1 week

[smh] Add copyright info missing from r282205

Add the copyright info missing from ZoL origin version.

MFC after:	2 days
Sponsored by:	Multiplay

[bapt] Handle lib32 libraries which should have been removed in 20140807

Reported by:	Trond Endrestøl <Trond.Endrestol_at_fagskolen.gjovik.no>

[bapt] Fix typo

Reported by:	Trond Endrestøl <Trond.Endrestol_at_fagskolen.gjovik.no>

[zbb] Add support for ARM GICv3 interrupt controller used in some ARM64 chips

GICv3 allows to distribute interrupts to more than 8 cores served by
the previous GIC revisions. GICv3 introduces additional logic in form
of Re-Distributors associated with particular CPUs to determine
the highest priority interrupts and manage PPIs and LPIs
(Locality-specific Peripheral Interrupts). Interrupts routing is
based on CPUs' affinity numbers. CPU interface was changed to be
accessible via CPU System Registers and this is the preferred
(and supported) method in this driver.

Obtained from: Semihalf
Reviewed by:   andrew, emaste, ian, imp
Sponsored by:  The FreeBSD Foundation

[stas] Fix pmcstat symbol resolution for userland processes.

When examining existing processes pmcstat fails to
correctly determine the locations of executable sections
of the process due to a miscalculated virtual load address.
This does not affect the newly launched processes as the
same value passed as a "start address" to the pmcstat_image_link()
thus nullifying the effect of it.  The issue manifests itself
in processes not being reported in the pmcstat(8) output and
"dubious frames" being reported.

Fix it for now by ignoring all the sections except the executable
one.  This won't fix the issue for objects with multiple
executable sections but helps in majority of real world usecases.
The real solution would be to modify the MAP-IN event to include
the appropriate load address so pmcstat(8) won't have to manually
parse object files to try to determine it.

PR:		198147, 198148
Reviewed by:	jhb, rpaulo
MFC after:	2 weeks

[grehan] Set the subvendor field in config space to the vendor ID.
This is required by the Windows virtio drivers to correctly
match a device.

Submitted by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[andrew] Use the correct node wen reading the compatible property.

[pfg] Adjust visibility macros.

The GCC visibility attributes were introduced in GCC 4.0.
Apparently the "protected" attribute was introduced only
until GCC 4.2, but we are not currently using it.

MFC after:	1 week

[trasz] Document RCTL events in devd.conf(5).

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[luigi] bugfix (only affecting the "lookup" option in the userspace version of ipfw):

the conditional block should not include the 'else' otherwise
the code does a 'break;' without completing the check

[ganbold] Delete cpu_do_powersave which is set but never used/tested
serving no useful purpose.

Differential Revision:	https://reviews.freebsd.org/D2516
Submitted by:		John Wehle
Reviewed by:		ian_at_

[loos] Fix the vmstat -i output on ARM.

The consumers of hw.intrnames expect a NULL byte at end of the string
containing the interrupt names.

On ARM all the interrupt name slots are initialized and this leave no room
for the terminating NULL byte, which makes vmstat read beyond the end of
intrnames.

PR:		199891
Tested on:	RPi 2 and BeagleBone Black

[loos] Fix the SMP initialization on RPi 2 (BCM2836).

Invalidate the CPU cache before start the others CPUs.

Submitted by:	Michal Meloun <meloun_at_miracle.cz>

[loos] Add support for the power button on BeagleBone Black.

Shutdown and turn off the board when the power button is pressed.

Submitted by:	Michal Meloun <meloun_at_miracle.cz>
Relnotes:	yes

[melifaro] Remove ptei->value check from ipfw_link_table_values():
  even if there was non-zero number of restarts, we would unref/clear
  all value references and start ipfw_link_table_values() once again
  with (mostly) cleared "tei" buffer.
 Additionally, ptei->ptv stores only to-be-added values, not existing ones.
 This is a forgotten piece of previous value refconting implementation,
  and now it is simply incorrect.

[emaste] crunchide: remove EOL whitespace

[emaste] Remove redundant csu subdir logic

The appropriate subdirectories are handled by lib/csu/Makefile. There's
no need to duplicate this logic in Makefile.inc1 and lib/Makefile.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2523

[adrian] Do not check sequence number for QoS Null frames; set it for generated QoS Null
frames to 0

>From IEEE Std. 802.11-2012, 8.3.2.1 "Data frame format", p. 415 (513):
"The Sequence Control field for QoS (+)Null frames is ignored by the receiver
upon reception."

At this moment, any <mode>_input() function interprets them as regular QoS data
frames with TID = 0. As a result, stations, that use another TX sequence for
QoS Null frames (e.g. wpi(4), where (QoS) Null frames are generated by the
firmware), may experience significant packet loss with any other NIC in hostap
mode.

Tested:

* wpi(4) (author)
* iwn(4) - Intel 5100, STA mode (me)

PR:		kern/200128
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[hselasky] Apply proper locking when iterating the multicast addresses and add a
missing check for NULL from a non-blocking "kzalloc()" function call.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
Found by:	glebius _at_

[andrew] Teach bits of libc about Thumb. This adds the if-then instructions needed
to handle the ARM conditional execution.

While here fix a bug found by this in the hard-float code, cc is the
opposite of cs. The former is used for 'less than' in floating-point code
and is executed when the C (carry) bit is clear, the latter is used when
greater than, equal, or unordered, and is executed when the C bit is set.

[ganbold] Disable WPI in case of aml8726-m3.
The aml8726-m3 SoC is identified as a Cortex A9-r2 rev 4 CPU and
it hangs sometimes during the boot when WFI is used by the kernel.

Differential Revision:	  https://reviews.freebsd.org/D2473
Submitted by:		  John Wehle
Suggested by:		  ian_at_

[tuexen] Ensure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was
received over UDP.
Thanks to Felix Weinrank for makeing me aware of the problem and to
Irene Ruengeler for providing the fix.

MFC after: 1 week

[ae] Add new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
packets on tunnel interfaces. Add support of these ioctls to gre(4),
gif(4) and me(4) interfaces. For incoming packets M_SETFIB() should use
if_fib value from ifnet structure, use proper value in gre(4) and me(4).

Differential Revision:	https://reviews.freebsd.org/D2462
No objection from:	#network
MFC after:	2 weeks
Sponsored by:	Yandex LLC

[delphij] Revert r282775 for now.  The added dependency would cause problems for
e.g. ports-mgmt/pkg and we would like to do an exp-build.

Requested by:	bdrewery

[hrs] Fix a panic when VIMAGE is enabled.

Spotted by:	Nikos Vassiliadis

[hrs] - Remove ND6_IFF_IGNORELOOP.  This functionality was useless in practice
  because a link where looped back NS messages are permanently observed
  does not work with either NDP or ARP for IPv4.

- draft-ietf-6man-enhanced-dad is now RFC 7527.

Discussed with:	hiren
MFC after:	3 days

[gjb] Avoid polluting the filesystem when not necessary.

Sponsored by:	The FreeBSD Foundation

[gjb] After the last influx of commits, and a REALLY BIG WARNING
to the top of the file.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix more paths to the actual files.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix more path variables.

Sponsored by:	The FreeBSD Foundation

[gjb] Provide the correct path to the checksum file.

Sponsored by:	The FreeBSD Foundation

[gjb] Also symlink the CHECKSUM.{SHA256,MD5} files.

Sponsored by:	The FreeBSD Foundation

[gjb] Also copy CHECKSUM.{SHA256,MD5} files.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix a few incorrect variables and/or hard-coded paths.

Sponsored by:	The FreeBSD Foundation

[gjb] Sigh.  Fix more syntax errors introduced by the last commit.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix a make(1) syntax error.

Sponsored by:	The FreeBSD Foundation

[gjb] Temporarily 'rm -rf $FTPDIR' during additional testing.

Sponsored by:	The FreeBSD Foundation

[neel] Allow configuration of the sector size advertised to the guest.

The default behavior is to infer the logical and physical sector sizes from
the block device backend. However older versions of Windows only work with
specific logical/physical combinations:
- Vista and Windows 7:	512/512
- Windows 7 SP1:	512/512 or 512/4096

For this reason allow the sector size to be specified using the following
block device option: sectorsize=logical[/physical]

Reported by:	Leon Dang (ldang_at_nahannisys.com)
Reviewed by:	grehan
MFC after:	2 weeks

[gjb] Always use the 'make install' directory as the source for images.
For RE purposes, we use the default (/R within the chroot), so
this helps avoid copying files multiple times and xz(1)-compressing
additional times when not needed.

Again, this Makefile is not for general consumption.

Sponsored by:	The FreeBSD Foundation

[gjb] Add a new file, Makefile.mirrors, which is intended to replace
a 474-line kludge of a shell script to pre-create the directory
hierarchy on ftp-master.

This is not in any way connected to the build, and there is no
intention to do so.  This only intent here is to try to make
things a little bit easier for me.  But I've probably just made
things worse.

Sponsored by:	The FreeBSD Foundation

[grehan] Handling indirect descriptors is a capability of the host and
not one that needs to be negotiated. Use the host capabilities
field and not the negotiated field when verifying that indirect
descriptors are supported.

Found with the Redhat Windows viostor driver, which clears
the indirect capability in the negotiated caps and then starts
using them.

Reported and tested by: Leon Dang (ldang_at_nahannisys.com)
MFC after:   2 weeks

[jhibbits] Add a PCI bridge for the Freescale PCIe Root Complex

Summary:
The Freescale PCIe Root Complex shows up as a Processor class device, PowerPC
subclass, so the generic PCI code ignores it for a bridge.  This adds support
for it.

As part of this, update the Freescale PCI hostbridge driver, to allow probing
beyond the root complex, instead of only allowing "proper" PCI-PCI bridges.

Reviewers: #powerpc, marcel, nwhitehorn

Reviewed By: nwhitehorn

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D2442

Relnotes:	yes

[andrew] Use the GOT_* macros to help simplify the code, these work with both pic
and non-pic code, and to build for Thumb.

[alc] Retire pmap_lazyfix().  This function only existed in the new armv6 pmap
because the i386 pmap on which the new armv6 pmap is based had it, and in
r281707 pmap_lazyfix() was removed from the i386 pmap.

Discussed with:	kib
Submitted by:	Michal Meloun (via Svatopluk Kraus)

[andrew] Add the kernel support for Thumb-2. It is only supported on ARMv7 as the
main ARMv6 target, the Raspberry Pi, doesn't support Thumb-2.

This as been tested with a Thumb-2 userland, however building one is
currently unsupported as there are known toolchain issues breaking some
binaries. Further work will also be needed to decide on the method of
selecting which instruction set to build for, and to benchmark both to
find how building everything as Thumb-2 will affect performance.

Relnotes:	yes

[andrew] Mark thumb entry points as such when building for thumb, otherwise mark
them as arm.

[andrew] Use the Thumb compliant version of the add instruction. We can only use
"add Rd, Rn, Rm" from within an IT (if-then) block.

[andrew] List both registers to use in the 64-bit atomic instructions. We will need
these to build for Thumb-2.

[delphij] Revert r281372, it's no longer needed after r282726 (fix for PR 199119) as the
symbol conflict between libmd and libcrypto have been solved.

[thomas] Unbreak MIPS build following rev. 282726

Introduce further adjustments to the renaming of libmd
symbols: make sure that we do not generate dangling weak
aliases, as this causes build failures on MIPS.

Tested by:	sbruno

[andrew] Add the ofw_bus_subr.h change missed in r282770.

[gjb] Fix virtual machine disk format creating by passing VMFORMAT
to mkimg(1)

PR:		200068
Submitted by:	Jeremy Norris
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[andrew] Hide code only used on i386 and amd64.

[andrew] Add ofw_bus_find_compatible to find a compatible ofw node. This will be
used on ARM to help find the correct node to use to start secondary CPUs
as this happens before device enumeration.

[andrew] cpu-v6.h should only be used in the kernel, add an error to enforce this.

[avg] zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget

This allows to ensure that we do not write to a file that was opened
for reading only or vice versa.

Also, use the correct capability in in zfs_ioc_send_new().

Differential Revision:	https://reviews.freebsd.org/D2382
Reviewed by:	delphij
MFC after:	17 days
Sponsored by:	ClusterHQ

[andrew] Move to use __ARM_ARCH in more places in the kernel.

[andrew] Use the ACLE spelling of _ARM_ARCH_6: "__ARM_ARCH >= 6"

[ngie] Use MIN from sys/param.h instead of handrolling the macro

Replace sys/types.h with sys/param.h per-style(9)

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

[delphij] Revert r282672.

tr is in /usr and not available at the time hostid is run (must be run
before FILESYSTEMS).

Reported by:	def

[markj] Remove some commented-out upstream code for handling traps from usermode
DTrace probes. This handling is already done in trap() on i386 and amd64.

[markj] msecs_to_jiffies() is implemented using tvtohz(9), which always returns a
positive value since it adds the current tick to its result. This differs
from the behaviour in Linux, whose implementation does not add the extra
tick, so subtract the extra tick in the OFED compat layer implementation.
This addresses some incorrect handling of IB MAD timeouts, since some IB
code depends on msecs_to_jiffies(0) returning 0.

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

[adrian] Prepare for supporting driver-overridden curchan when submitting scan
results.

Right now the scan infrastructure assumes the channel is under net80211
control, and that when receiving beacon frames for scanning, the
current channel is indeed what ic_curchan is set to.

But firmware NICs with firmware scan support need more than this -
they can do background scans whilst hiding the off-channel behaviour
from net80211.  Ie, net80211 still thinks everything is associated
and on the main channel, but it's getting scan results from all the
background traffic.

However sta_add() pays attention to ic_curchan and discards scan
results that aren't on the right channel.  CCK beacon frames can be
decoded from adjacent channels so the receive path and sta_add
discard these as appropriate.  This is fine for software scanning
like for ath(4), but not for firmware NICs.  So with those, the
whole concept of background firmware scanning won't work without
major hacks (eg, overriding ic_curchan before calling the beacon
input / scan add.)

As part of my scan overhaul, modify sta_add() and the scan_add()
APIs to take an explicit current channel.  The normal RX path
will set it to ic_curchan so it's a no-op.  However, drivers may
decide to (eventually!) override the scan method to set the
"right" current channel based on what the firmware reports the
scan state is.

So for example, iwn, rsu and other NICs will eventually do this:

* driver issues scan start firmware command;
* firmware sends a "scan start on channel X" notify;
* firmware sends a bunch of beacon RX's as part of
  the scan results;
* .. and the driver will replace scan_add() curchan with channel X,
  so scan results are correct.
* firmware sends a "scan start on channel Y" notify;
* firmware sends more beacons...
* .. the driver replaces scan_add() curchan with channel Y.

Note:

* Eventually, net80211 should eventually grow the idea of a per-packet
  current channel.  It's possible in various modes (eg WAVE, P2P, etc)
  that individual frames can come in from different channels and that
  is under firmware control rather than driver/net80211 control, so
  we should support that.

[markj] find_next_bit() and find_next_zero_bit(): if the caller-specified offset
lies within the last block of the bit set and no bits are set beyond the
offset, terminate the search immediately instead of continuing as though
there are further blocks in the set and subsequently returning an incorrect
result.

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

[sjg] Merge bmake-20150505 improve detection of malformed conditionals.

[markj] ctf_add_type(): when looking up an integer or floating point type in the
list of pending dynamic type definitions, a match on the type name is not
sufficient - we need to compare the type encodings as well. For example,
bitfields have their own distinct type definitions which share the name of
the underlying integer type, and these types aren't generally
interchangeable.

This bug was causing the following libdtrace error when attempting to trace
the th_flags member of a struct tcphdr:
  cg: bad field: off 104 type <32877> bits 539620016

Reported by:	rwatson
MFC after:	3 weeks

[thomas] Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas

[adrian] Fix typo introduced in previous commit.

PR:		kern/199632
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[rpaulo] synaptics: more support for semi-MT trackpads.

Several improvements to the Synaptics driver to support
semi-multitouch trackpads and some other fixes:

- Two finger scrolling support for "semi-MT" touchpads. Those include
many of the older Synaptics touchpads before "true" multitouch support
(indicated by capMultiFinger). Semi-MT touchpads can report a second
finger position, but the X or Y coordinate may be swapped with some
coordinate of the first finger. This is a result of how the hardware
works internally. Therefore, all that can be reliably extracted is the
bounding box of the two finger positions. Semi-MT touchpads can be
recognized by the capAdvancedGestures capability bit. After setting the
mode byte, advanced gestures mode has to be enabled. Then, data packets
compatible with the capMultiFinger format are sent, so the same two
finger scrolling code can be leveraged. Enabling advanced gestures mode
on true multitouch touchpads should be harmless. Linux seems to always
enable advanced gestures mode.

- Put mode setting logic into own functions synaptics_preferred_mode()
and synaptics_set_mode() to have this in one place.
synaptics_passthrough_on() and synaptics_passthrough_off() currently
always use 0xc1 as the mode byte, which may be wrong for touchpads that
don't have capExtended.

- Expose X and Y resolution of touchpad to userland. Also expose minimum
and maximum X and Y coordinates. This is useful for programs in
userspace that read raw PSM packets (with PSM_LEVEL_NATIVE enabled) and
need to interpret the coordinates.

- Also send "extended w mode" packets (see section 3.2.9 of
511-000275-01_RevB.pdf) to userspace if PSM_LEVEL_NATIVE is enabled.
This is useful for userspace programs/drivers such as
xf86-input-synaptics that can handle these packets.

- Fix parsing of nExtendedQueries, and request extended/continued
capability bits depending on this value.

- capReportsMax, capClearPad, capAdvancedGestures and capCoveredPad must
be extracted from status[0] and not status[2], I think.

Submitted by:	Jan Kokemüller jan.kokemueller at gmail.com

[ian] Create a relocatable instance of ubldr for ARM.  The original ubldr,
static-linked to run at a fixed position, is still installed to maintain
compatibility with existing configurations.  The makefile now also creates
and installs ubldr.bin, a stripped binary (no elf headers) with an entry
point offset of 0 that can be loaded by u-boot at any address and launched
with "go ${loadaddr}".

To use ubldr.bin, U-Boot must still be built with the CONFIG_API option,
but no longer needs the CONFIG_ELF option.

[hselasky] Ensure the result from signed subtraction under modulus does not
become negative.

Submitted by:		Oliver Pinter <oliver.pinter_at_hardenedbsd.org>
MFC after:		3 days

[jilles] recv(),send(): Directly call interposing entry instead of going through PLT.

recv() and send()'s calls to recvfrom() and sendto() are much like
waitpid()'s call to wait4(), and likewise need not allow PLT interposing on
the called function.

[ian] Don't check the return value from self_reloc(), it can't fail and doesn't
return a value.

Despite what I said in my prior commit, it turns out this one platform
was checking the return value from the old self-reloc code (which returned
a hard-coded 0).

[ian] The self-relocation code is not efi-specific, move it to boot/common.

The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision:	https://reviews.freebsd.org/D2490

[thomas] Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR:		199119
Differential Revision:	D2216
Reviewed by:	roberto, delphij
MFC after:	2 weeks

[hselasky] Put recycle pointer in own memory area which is not mmap'able.

[andrew] Use the new gic option on all configs that need it.

[bapt] For half and reverse line feeds, recognize both SUSv2-style escape-digit
and BSD-style escape-control-char sequences in the input stream.

Submitted by:	schwarze at OpenBSD
Discussed with:	schwarze at OpenBSD
Obtained from:	OpenBSD

[bapt] Remove extendline definition
Remove now unused PWBUFSZ define

[bapt] Use calloc(3) instead of malloc(3) + memset(3)
While here check the return of calloc(3)

[bapt] The initial logic for allocating the new string was wrong, the conversion
to strndup(3) duplicated the same mistake, actually strdup(3) is good enough
to allocate the new string.

[bapt] Use strndup(3) instead of malloc(3) + memcpy(3)
Check the return of strndup

[andrew] Use the new gic option. While here remove extra whitespace from the ned of
a few lines.

[bapt] Remove useless call to extendarray

[andrew] Add the gic to files.arm under "device gic" and use it with the
CUBIEBOARD2 config. This is common across a few SoCs so should be a common
option.

[andrew] First pass clenup over the Marvell db-88f6xxx kernel configs.

[bapt] The pwdb function is only used once to check the database rename it
pwdb_check and simplify it accordingly

[bapt] if the check of the pw db fails return the failed value

[kib] Initialize pcids array for the proc0 pmap.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[kib] Tweak assert to also print the thread address.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[bapt] Some style(9) fixes

[kib] On exec, single-threading must be enforced before arguments space is
allocated from exec_map.  If many threads try to perform execve(2) in
parallel, the exec map is exhausted and some threads sleep
uninterruptible waiting for the map space.  Then, the thread which won
the race for the space allocation, cannot single-thread the process,
causing deadlock.

Reported and tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks

[andrew] Clean up the style to use "options<space><tab>".

[kib] Satisfy vm_object uma zone destructor requirements after r282660 when
vnode object creation raced.

Reported by:	pho
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation

[adrian] Turn ieee80211_start_scan_locked() into a swscan module private method.

It turns out that ieee80211_start_scan_locked() is only ever called by
the swscan code and it won't likely be required by firmware scanning
implementations.

So, don't bother keeping it in ieee80211_scan.c and it likely won't
become an API call.

Tested:

* Intel 5100, STA mode
* AR5416, STA mode

[adrian] Attempt to address Bug #176201 - don't advertise what the AP announced
to us. Instead, advertise what we can do based on what the AP says and what
we're capped at by the VAP settings.

For non-STA modes we still advertise what our VAP settings are.

It may be that I've over-complicated this and instead of capping things
we can just always announce what we're capable of.  But this should at least
stop the blatantly wrong handling of A-MPDU parameters.

(I'll happily simplify things if someone can dig up a replacement, better
compliant behaviour.)

PR:		kern/176201

[jhibbits] Fix a couple bugs in 64-bit powerpc fasttrap argument retrieval.

Found by code inspection.

[loos] Remove unnecessary code and make use of generic implementations for
bus_alloc_resource(), bus_release_resource() and bus_set_resource()
(bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and
bus_generic_rl_set_resource() respectively).

Do not print the resources for nomatch devices.

Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.

Submitted by:	jhb and Michal Meloun (D2033)

[bapt] Replace sprintf(3) with snprintf(3)

[bapt] Use snprintf(3) instead of sprintf(3)
Remove useless "else"

[bapt] Remove now unused LNBUFSZ buffer size

[bapt] Return from the function as early as possible

This reduces the depth of the if statements and improves clarity of the code

[kib] Correct the assertion.  We should compare the pmap' curcpu pcid value
against 0, not the pmap.

Noted by:	Oliver Pinter <oliver.pinter_at_hardenedbsd.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[andrew] Pass over the at91 kernels to reduce the diff between them.

[gjb] Merge ^/projects/release-arm-redux into ^/head.

Of note:

- This commit adds native FreeBSD/arm release build support without
  requiring out-of-tree utilities.

- Part of this merge removes the WANDBOARD-{SOLO,DUAL,QUAD} kernel
  configuration files, for which the IMX6 kernel configuration file
  should be used instead.

- The resulting images have a 'freebsd' user (password 'freebsd'),
  to allow ssh(1) access when console access is not available (VGA
  or serial).  The default 'root' user password is set to 'root'.

- The /etc/ttys file for arm images now enable both ttyv0 and ttyu0
  by default.

Help from:	many (boot testing, feedback, etc.)
Sponsored by:	The FreeBSD Foundation

[kib] The vmem callback to reclaim kmem arena address space on low or
fragmented conditions currently just wakes up the pagedaemon.  The
kmem arena is significantly smaller then the total available physical
memory, which means that there are loads where kmem arena space could
be exhausted, while there is a lot of pages available still.  The
woken up pagedaemon sees vm_pages_needed != 0, verifies the condition
vm_paging_needed() which is false, clears the pass and returns back to
sleep, not calling neither uma_reclaim() nor lowmem handler.

To handle low kmem arena conditions, create additional pagedaemon
thread which calls uma_reclaim() directly.  The thread sleeps on the
dedicated channel and kmem_reclaim() wakes the thread in addition to
the pagedaemon.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks

[bapt] Remove some uneeded headers

[bapt] Remove unneeded headers

[bapt] Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3)

[kib] Rewrite amd64 PCID implementation to follow an algorithm described in
the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency
Algorithms".  The same algorithm is already utilized by the MIPS pmap
to handle ASIDs.

The PCID for the address space is now allocated per-cpu during context
switch to the thread using pmap, when no PCID on the cpu was ever
allocated, or the current PCID is invalidated.  If the PCID is reused,
bit 63 of %cr3 can be set to avoid TLB flush.

Each cpu has PCID' algorithm generation count, which is saved in the
pmap pcpu block when pcpu PCID is allocated.  On invalidation, the
pmap generation count is zeroed, which signals the context switch code
that already allocated PCID is no longer valid.  The implication is
the TLB shootdown for the given cpu/address space, due to the
allocation of new PCID.

The pm_save mask is no longer has to be tracked, which (significantly)
reduces the targets of the TLB shootdown IPIs.  Previously, pm_save
was reset only on pmap_invalidate_all(), which made it accumulate the
cpuids of all processors on which the thread was scheduled between
full TLB shootdowns.

Besides reducing the amount of TLB shootdowns and removing atomics to
update pm_saves in the context switch code, the algorithm is much
simpler than the maintanence of pm_save and selection of the right
address space in the shootdown IPI handler.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks

[bapt] Use snprintf(3) instead of strcpy(3) + strncat(3)

[bapt] Use sbuf(9) instead of homebrewed buffered string

[kib] Remove unused define.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days

[kib] Do not return from thread_single(SINGLE_BOUNDARY) until all stopped
thread are guarenteed to be removed from the processors.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[kib] If x86 CPU implementation of the MWAIT instruction reasonably
interacts with interrupts, query ACPI and use MWAIT for entrance into
Cx sleep states.  Support C1 "I/O then halt" mode.  See Intel'
document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface
Specification" for description.

Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use
it instead of inlining "sti; hlt" sequence in several places.

In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods
sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported}
sysctls.

Both jkim and avg have some other patches implementing the mwait
functionality; this work is unrelated.  Linux does not rely on the
ACPI to provide correct tables describing Cx modes.  Instead, the
driver has pre-defined knowledge of the CPU models, it was supplied by
Intel.

Tested by:    pho (previous versions)
Sponsored by:	The FreeBSD Foundation

[bz] Convert remaining hwpmc(4) debug printfs over to KTR to unbreak the build
for at least powerpc kernels.   Missed in r282658.

MFC after:	10 days

[loos] Pass the resources requests to the upper bus.

Submitted by:	Michal Meloun <meloun_at_miracle.cz>

[loos] Handle IRQ resources on iicbus and ofw_iicbus.

Based on a patch submitted by Michal Meloun <meloun_at_miracle.cz>.

[stas] Fix the double space in comment.

While here, change the comment style to match the rest of the file.

[delphij] Always convert uuid to lower case.

MFC after:	2 weeks

[bapt] Fix about ten integer overflows and underflows and a handful of logic
errors in line number handling.

Submitted by:	ingo at OpenBSD
Discussed with:	ingo at OpenBSD
Obtained from:	OpenBSD

[loos] Replace spaces with tabs, removes an extra blank line.

No functional changes.

[ian] Move the text section to the start of the output file, so that when you
create a stripped .bin file from it the entry point is the first byte of
the file.  (Will allow "load $addr $file ; go $addr" in u-boot.)

[jhb] Place VM objects on the object list when created and never remove them.
This is ok since objects come from a NOFREE zone and allows objects to
be locked while traversing the object list without triggering a LOR.

Ensure that objects on the list are marked DEAD while free or stillborn,
and that they have a refcount of zero.  This required updating most of
the pagers to explicitly mark an object as dead when deallocating it.
(Only the vnode pager did this previously.)

Differential Revision:	https://reviews.freebsd.org/D2423
Reviewed by:	alc, kib (earlier version)
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.

[jhb] Convert hwpmc(4) debug printfs over to KTR.

Differential Revision:	https://reviews.freebsd.org/D2487
Reviewed by:	davide, emaste
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.

[zbb] Port x86 busdma to ARM64

The x86 busdma subsystem allows using multiple implementations.
By default the classic bounce buffer approach is used, however
on systems with IOMMU it could be in runtime switched to more
efficient hardware accelerated implementation.

This commit adds ARM64 port of the x86 busdma framework and bounce
buffer backend. It is ready to use on IO coherent systems. If the
IO coherency cannot be guaranteed, the cache management operations have
to be added to this code in places marked by /* XXX ARM64TODO (...) */
comments. Also IOMMU support might be added by registering another
busdma implementation like it is already done on the x86.

Reviewed by:   andrew, emaste
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation

[hselasky] Ensure the USB audio driver doesn't attach twice on the same USB
device by grabbing all the USB audio device interfaces.

MFC after:	1 week

[hselasky] Add support for more than 8 audio channels per PCM stream for USB
audio class compliant devices under FreeBSD. Tested using 16 recording
and 16 playback audio channels simultaneously.

MFC after:	2 weeks

[hselasky] Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These
definitions are only used inside the kernel and can be changed later
if more than one sub-channel is desired. This has been done to allow
so-called USB audio rack modules to work with FreeBSD.

Bump the FreeBSD version to force recompiling all external modules.

MFC after:	2 weeks
Reviewed by:	mav

[bdrewery] Fix spelling of INTERNALLIBS

[hselasky] The "SYSCTL_INT()" default value is only used for read only SYSCTLs
and is not applicable unless the integer pointer is NULL. Set it to
zero to avoid confusion. While at it remove extra semicolon at the end
of the "VT_SYSCTL_INT()" macro.

MFC after:		1 week

[hselasky] Prevent switching to NULL or own window in the "vt_proc_window_switch"
function. This fixes an issue where X11 keyboard input can appear
stuck. The cause of the problem is a duplicate TTY device window
switch IOCTL during boot, which leaves the "vt_switch_timer" running,
because the current window is already selected. While at it factor out
some NULL checks.

PR:			200032
Differential Revision:	https://reviews.freebsd.org/D2480
Reported by:		several people
MFC after:		1 week
Reviewed by:		emaste

[jhb] Use the kern.bootfile sysctl to set the default kernel path rather than
hardcoding /boot/kernel. This allows pmcstat(8) to work without -k when
using nextboot -k or 'boot foo' at the loader to boot alternate kernels.

Differential Revision:	https://reviews.freebsd.org/D2425
Reviewed by:	adrian, emaste, gnn
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.

[jhb] Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
the broader DEBUG option.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.

[royger] xen: introduce a newbus function to allocate unused memory

In order to map memory from other domains when running on Xen FreeBSD uses
unused physical memory regions. Until now this memory has been allocated
using bus_alloc_resource, but this is not completely safe as we can end up
using unreclaimed MMIO or ACPI regions.

Fix this by introducing a new newbus method that can be used by Xen drivers
to request for unused memory regions. On amd64 we make sure this memory
comes from regions above 4GB in order to prevent clashes with MMIO/ACPI
regions. On i386 there's nothing we can do, so just fall back to the
previous mechanism.

Sponsored by: Citrix Systems R&D
Tested by: Gustau Pérez <gperez_at_entel.upc.edu>

[avg] MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic

MFC after:	5 days

[kevlo] - Fix a wrong R92C_USTIME_TSF register definition
- Fix intitial transmit rate to an 11g rate for the RTL8188EU
- Add a comment about response rate settings

[adrian] oops - how'd i miss this. Sorry!

[ganbold] This follows the gic and ti/aintc code by adding additional barriers to the
Amlogic pic driver.

Differential Revision:	https://reviews.freebsd.org/D2472
Submitted by:		John Wehle

[ganbold] The interrupt-parent is set globally so it's unnecessary to also set it at each node.

Differential Revision:	https://reviews.freebsd.org/D2471
Submitted by:		John Wehle

[adrian] Add initial memory locality cost awareness to the VM, and include
a basic ACPI SLIT table parser.

For now this just exports the map via sysctl; it'll eventually be useful
to userland when there's more useful NUMA support in -HEAD.

* Add an optional mem_locality map;
* add a mapping function taking from/to domain and returning the
  relative cost, or -1 if it's not available;
* Add a very basic SLIT parser to x86 ACPI.

Differential Revision:	https://reviews.freebsd.org/D2460
Reviewed by:	rpaulo, stas, jhb
Sponsored by:	Norse Corp, Inc (hardware, coding); Dell (hardware)

[delphij] MFV r282611: netcat from OpenBSD 5.7.

MFC after:	2 weeks

[loos] Add the SMP support for Raspberry Pi 2 (BCM2836).

Tested with the build of some ports and a buildworld.

Submitted by:	Daisuke Aoyama <aoyama_at_peach.ne.jp>

[bapt] Reduce the size to 64 for the commands, 512 was way too large for the purpose

Noticed by:	julian

[delphij] date(1): Make -r behave like GNU's version when the option can not be
interpreted as a number, which checks the file's modification time and
use that as the date/time value.

This improves compatibility with GNU coreutils's version of time(1).

MFC after:	2 weeks

[neel] Allow byte reads of AHCI registers.

This is needed to support Windows guests that use byte reads to access certain
AHCI registers (e.g. PxTFD.Status and PxTFD.Error).

Reviewed by:	grehan, mav
Reported by:	Leon Dang (ldang_at_nahannisys.com)
Differential Revision:	https://reviews.freebsd.org/D2469
MFC after:	2 weeks

[ae] m_dup() is supposed to give a writable copy of an mbuf chain. It uses
m_dup_pkthdr(), that uses M_COPYFLAGS mask to copy m_flags field.
If original mbuf chain has M_RDONLY flag, its copy also will have it.
Reset this flag explicitly.

MFC after:	2 weeks

[emaste] Correct PL310_POWER_CTRL offset

Offet for the power control register was specified incorrectly (it had
the same value as the prefetch control register.) This change corrects
the offset value to 0xF80, per the ARM PL310 documentation.

Submitted by:	Steve Kiernan <stevek_at_juniper.net>
Obtained from:	Juniper Networks, Inc.

[ae] Mark data checksum as valid for multicast packets, that we send back
to myself via simloop.
Also remove duplicate check under #ifdef DIAGNOSTIC.

PR:		180065
MFC after:	1 week

[hselasky] Add support for DYMO LabelWriter PnP.

MFC after:		2 weeks

[andrew] Clean up the ARM kernel configs to use 'include<space><tab>"file"'.

[ae] Remove unneded #ifdef INET6 and IPSEC. This file compiled only when
both options are defined.
Include opt_sctp.h and sctp_crc32.h to enable #ifdef SCTP code block
and delayed checksum calculation for SCTP.

[bdrewery] Remove references to Giant in namei(9).  This was removed in r241896.

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

[neel] Check 'td_owepreempt' and yield the vcpu thread if it is set.

This is done explicitly because a vcpu thread can be in a critical section
for the entire time slice alloted to it. This in turn can delay the handling
of the 'td_owepreempt'.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D2430

[mjg] Fix up panics when fork fails due to hitting proc limit

The function clearning credentials on failure asserts the process is a
zombie, which is not true when fork fails.

Changing creds to NULL is unnecessary, but is still being done for
consistency with other code.

Pointy hat: mjg
Reported by: pho

[mav] Handle EDQUOT backend storage errors same as ENOSPC.

MFC after:	1 week

[mav] Add memory barrier to r281764.

While race at this point may cause only a single packet delay and so was
not really reproduced, it is better to not have it at all.

MFC after:	1 week

[jhb] Tweak the comment here some more.  In particular, the previous opening
sentence was a bit confusing.

Noted by:	kib

[glebius] Printing interface names:

o Restore historical behaviour of appending '*' if interface is down,
  and we have enough space to print it (usually we don't). [1]
o Do not truncate interface names when printing in encoded format.
o Report interface flags into encoded format.

PR:		199873 [1]
Sponsored by:	Nginx, Inc.

[neel] Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().

Prior to this change both functions returned 0 for success, -1 for failure
and +1 to indicate that an exception was injected into the guest.

The numerical value of ERESTART also happens to be -1 so when these functions
returned -1 it had to be translated to a positive errno value to prevent the
VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce
bugs when writing emulation code.

Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if
an exception was delivered to the guest. The return value is 0 or EFAULT so
no additional translation is needed.

Reviewed by:	tychon
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D2428

[jhb] Remove the note about seekdir() removing telldir() cookies.  That was
removed back in r269204.

MFC after:	3 days

[emaste] 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 rtld.

Reviewed by:	imp, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2422

[jhb] A few style fixes and expand the comment a bit on what _fixtelldir() is
doing.

[emaste] Fix make delete-old for gperf and GCC/CXX options

- Optional components go in OptionalObsoleteFiles
- Move gperf removal to be based on MK_GCC only, not MK_CXX and MK_GCC

Reviewed by:	imp, sbruno
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2421

[zbb] Add new CP15 operations and DB_SHOW_COMMAND to print CP15 registers

Submitted by:   Wojciech Macek <wma_at_semihalf.com>
Reviewed by:    imp, Michal Meloun <meloun_at_miracle.cz>
Obtained from:  Semihalf

[andrew] AcpiGbl_FACS will not be defined when building using the reduced hardware
model. This may be the case on ARM.

[andrew] If the power management timer is unsupported the PmTimerLength value will
be zero.

[ae] Pass mtag argument into m_tag_locate() to continue the search from
the last found mtag.

[melifaro] Correctly print valtype for empty bitmask.

[kadesai] Corrected indentation on conflicted source files.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] Configured the mrsas(4) driver to support UNMAPPED I/O and updated driver version.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] 1. All LSI namings are converted to AVAGO Tech.
2. Fix in AEN path(suggested by John Baldwin).
3. Fix IOCTL path w.r.t Sense key handling

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] Bug fixes found internally as detailed below:
1. While disabling interrupt the FW disables interrupts for only 16 vectors.
In case of Invader which supports 96 MSI-x vectors, some spurious interrupts
may come on other vectors even after interrupt disable. So, driver uses a flag
and ignores the spurious interrupts.
2. Reply queue depth is made double the number of commands supported by FW.
3. Misplaced interrupt enable code is now moved down in the OCR path.
4. Updated error handling code in OCR path.
5. Removed un-necessary print.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] Driver calls mrsas_complete_cmd() to call mrsas_wakeup() for each MFI frame that was
issued through the ioctl() interface prior to the kill adapter. This ensures
userspace ioctl() system calls issued just before a kill adapter don't get stuck in
wait state and IOCTLs are returned to application.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] In OCR(Online Controller Reset) path, driver sets adapter state to
MEGASAS_HBA_OPERATIONAL before getting new RAID map.
There will be a small window where IO will come from OS with old RAID map.
This patch will update adapter state to MEGASAS_HBA_OPERATIONAL,
only after driver has new RAID map to avoid any IOs getting build using old RAID map.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] Current driver does fast path read load balancing between arm and mirror disk
for two Drive Raid-1 configuration only.

Now, Driver support fast path read load balancing for all (any number of disk) Raid-1 configuration.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[kadesai] Now Driver expose Secure Jbod Support via driver_operations in MFI INIT Frame.
FW expose Secure Jbod support via Controller properity.

Firmware expect IOs to be received from different IO path than
conventional fast path queue, in case of SED drives.

To have Secure jbod support user need driver and firmware support.

Reviewed by:    ambrisko
MFC after:  2 weeks
Sponsored by:   AVAGO Technologies

[kadesai] This patch adds the feature to provide PCI information via IOCTL query.

Reviewed by:	ambrisko
MFC after:	2 weeks
Sponsored by:	AVAGO Technologies

[mav] Reimplement queue freeze on error, added in r282429:

It is not required to use CLO to recover from task file error, it should
be enough to do only stop/start, that does not clear the PxTFD.STS.ERR.

MFC after:	13 days

[glebius] Fix the KASSERT and improve wording in r282426.

Submitted by:	alc

[melifaro] Fix panic when prepare_batch_buffer() returns error.

[neel] Do a proper emulation of guest writes to MSR_EFER.
- Must-Be-Zero bits cannot be set.
- EFER_LME and EFER_LMA should respect the long mode consistency checks.
- EFER_NXE, EFER_FFXSR, EFER_TCE can be set if allowed by CPUID capabilities.
- Flag an error if guest tries to set EFER_LMSLE since bhyve doesn't enforce
  segment limits in 64-bit mode.

MFC after:	2 weeks

[neel] Add macros for AMD-specific bits in MSR_EFER: LMSLE, FFXSR and TCE.

AMDID_FFXSR is at bit 25 so correct its value to 0x02000000.

MFC after:	1 week

[osa] Fix DragonFly 4.0.5 release date.

Reported by:	vangyzen

[ganbold] This patch adds support for the extended baud rate register
available on the aml8726-m6 (and later) SoC which allows for
lower speeds.

Differential Revision:	https://reviews.freebsd.org/D2433
Submitted by:	John Wehle

[ian] Add the code necessary to run the imx6 chip at its lowest clock/power
operating point (396MHz/950mV).

[gjb] Fix building BEAGLEBONE images with Crochet using the
sysutils/u-boot-beaglebone port:

 - In arm/BEAGLEBONE.conf, set EMBEDDEDPORTS to the
   sysutils/u-boot-beaglebone port.
 - In arm/release.sh, remove BEAGLEBONE from setting WANT_UBOOT
 - In tools/arm/crochet-BEAGLEBONE.conf, override the
   beaglebone_check_uboot(), and set BEAGLEBONE_UBOOT to
   /tmp/external/u-boot-beaglebone, and create symlinks to the
   u-boot files in /usr/local/share/u-boot-beaglebone and the
   uEnv.txt file in crochet/board/Beaglebone/files.

Sponsored by:	The FreeBSD Foundation

[hselasky] Add new USB ID.

PR:		199843
MFC after:	1 week

[andrew] Start to reduce the diff between the Atmel kernel configs.

[andrew] The VIRT kernel config targets armv6.

[andrew] Move the first batch of common armv6 options to std.armv6.

[gjb] Remove buildenv_setup(), and set EMBEDDEDPORTS to the
sysutils/u-boot-rpi2 port, since these cases are already
handled by arm/release.sh.

Sponsored by:	The FreeBSD Foundation

[gjb] Add initial support for building RPI2 images.

In release.sh, allow overriding buildenv_setup() before
the handoff to arm/release.sh.

Copy arm/RPI-B.conf -> arm/RPI2.conf, set UBOOT_PORT and
the correct KERNEL, and add the buildenv_setup() override
to install the sysutils/u-boot-rpi2 port/package.

Copy tools/arm/crochet-RPI-B.conf -> tools/arm/crochet-RPI2.conf,
and set the correct entries for the RaspberryPi2 board.

Thanks to:	loos_at_
Sponsored by:	The FreeBSD Foundation

[ian] Create std.arm and std.armv6 config files and include the right one from
each of the existing kernel configs.  This gives a place to put config
that applies to the entire arch.

Add the ARM_NEW_PMAP option to std.armv6.  This is working well in early
testing and it's time for wide exposure, but it's still nice to be able
to fall back to the old implementation for testing when a problem comes
along.  Eventually the option and the old implementation will go away.

The opportunity now exists to move a whole lot of boilerplate from all the
arm kernel config files into std.arm*, but that's a commit for another day.

[gjb] Document r281617, wc(1) race when receiving SIGINFO fixed.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix a FDP style nit.  Wrap the lines as a result.

Found with:	textproc/igor
Sponsored by:	The FreeBSD Foundation

[gjb] Document r281802, support added for building FreeBSD/aarch64 virtual
machine and memory stick images.

Sponsored by:	The FreeBSD Foundation

[gjb] Update the svn revision marker.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282434, openresolv updated to version 3.7.0.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282274, xen(4) PV domU kernel support removed.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282213, kern.racct.enable tunable and RACCT_DISABLED
kernel configuration option.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282212, several improvements/updates to the HyperV drivers.

Add Microsoft OSTC to sponsors.ent.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282208, chmod(1), chflags(1), chgrp(1), and chown(8) now
affect symbolic links when '-R' is used.

Add Multiplay to sponsors.ent.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix a typo.

Sponsored by:	The FreeBSD Foundation

[julian] Tweak seekdir, telldir and readdir so that when htere are deletes going on,
as seek to teh last location saved will still work. This is needed for Samba
to be able to correctly handle delete requests from windows. This does not
completely fix seekdir when deletes are present but fixes the worst of the
problems. The real solution must involve some changes to the API for eh VFS
and getdirentries(2).

Obtained from:	Panzura inc
MFC after:	1 week

[andrew] Add DEV_ACPI to opt_acpi.h to be used to detect when ACPI is enabled in
the kernel.

[andrew] Update the comment on what CPUs this driver supports.

[jilles] cp: Remove fts sorting.

In an attempt to improve performance, cp reordered directories first
(although the comment says directories last). This is not effective with new
UFS layout policies.

The sorting reorders multiple arguments passed to cp, which may be
undesirable.

Additionally, the comparison function does not induce a total order. Per
POSIX, this causes undefined behaviour in qsort().

NetBSD removed the sorting in 2009.

On filesystems that return directory entries in hash/btree order, sorting by
d_fileno before statting improves performance on large directories. However,
this can only be implemented in fts(3).

PR:		53475
Reviewed by:	bde (in 2004)
MFC after:	1 week

[osa] Add "The Design and Implementation of the FreeBSD OS, 2nd Ed.".

[andrew] Move the point we attach the ofw driver on arm64 to nexus.c. This will
allow us to have a single place to decide to use ofw or acpi.

[avg] mergeinfo for commits r282125 and r282126

Those were MFVs:
MFV r282124: 5393 spurious failures from dsl_dataset_hold_obj()
MFV r282123: 5610 zfs clone from different source and target pools
             produces coredump

[osa] Document DragonFly releases 4.0.2 - 4.0.5 and OpenBSD 5.7.
Fix typo for NetBSD 6.1.5.

[andrew] Add FDT to the list of known GUIDs.

[avg] zfs: do not hold an extra reference on a root vnode while a filesystem is mounted

At present zfs_domount() acquires a reference on the filesystem's root vnode
and that reference is kept until zfs_umount.
The latter calls vflush(rootrefs = 1) to dispose of the extra reference.

There is no explanation of why that reference is kept - what problem it
solves or what behavior it improves.
Also, that logic is FreeBSD specific.

There is one real problem with that reference, though.
zfs recv -F may receive a full, non-incremental stream to a mounted filesystem.
In that case the received root object is likely to have a different z_gen
attribute value. Because of that, zfs_rezget will leave the previous root znode
and vnode disassociated from the actual object (z_sa_hdl == NULL).
Thus, future calls to VFS_ROOT() -> zfs_root() will produce a new vnode-znode
pair, while the old one will be kept alive by the outstanding reference.
So, the outstanding reference will not actually be for the new root vnode
(or, more precisely, vnodes - because a root vnode may be recycled and a newer
one can be created).
As a result, when vflush(rootrefs = 1) s called there will be two problems:

- a leaked reference on the old root vnode preventing a graceful unmount
- insufficient references on the actual root vnode leading to a crash upon
  access to the vnode after it is destroyed by vgone() + vdrop()

The second issue will actually override the first one.

Differential Revision:	https://reviews.freebsd.org/D2353
Reviewed by:		delphij, kib, smh
MFC after:	17 days

[andrew] Disable the use of floating-point and vector registers in the loader. They
need the vfp unit to be enabled which may not be the case.

[avg] dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails

The leak may happen if !drc_newfs && drc_force and there is an error
iterating through snapshots or any of snapshot checks fails.

See https://www.illumos.org/issues/5870
See https://reviews.csiden.org/r/206/

Reviewed by:	mahrens (as mahrens_at_delphix.com)
MFC after:	15 days
Sponsored by:	ClusterHQ

[pluknet] Fix major copy/paste and other style errors.

[andrew] Copy new attribute types when linking. bfd will copy attributes as needed,
however it will fail to output them if the type is not set correctly. This
can happen when it finds an attribute it hasn't seen before, for example
when building shared objects it will use the attributes from crti.o, hwever
this file has no attributes set.

Differential Revision:	https://reviews.freebsd.org/D2413
Reviewed by:	imp

[andrew] When cross-building ${LIBSTAND} may be set to the host copy. Point to the
version built with the toolchain.

Differential Revision:	https://reviews.freebsd.org/D2312
Submitted by:	jhb

[garga] Add support for Sierra MC7354 card

Author:		Jeremy Porter <jporter_at_netgate.com>
Differential Revision:	https://reviews.freebsd.org/D2444
Reviewed by:	gnn, hselasky
MFC after:	1 week
Sponsored by:	Netgate

[bapt] Enlarge the buffer for storing macros as some macros can be longer than 5

[bapt] Update the list of known roff commands (adding the mdoc package)

Obtained from:	NetBSD

[bapt] Properly assign open and close brackets and checks memory

Obtained from:	NetBSD

[ae] Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme.
Sort DOSPTYP_* entries in diskmbr.h by value.
Document these scheme-specific types in gpart(8).

MFC after:	1 week

[bapt] Ensure we read existing values of the stk table

Obtained from:	NetBSD

[bapt] Use stdup(3) and check its return instead from homebrew version using strcpy(3)
and malloc(3)

Obtained from:	NetBSD

[bapt] cosmetic fixes

Obtained from:	NetBSD

[bapt] Apply seom style(9) fixes from NetBSD

Obtained from:	NetBSD

[bapt] Prevent useless use of strdup(3)

Obtained from:	NetBSD

[bapt] Replace homebrewed NIL by NULL

[bapt] Use stdbool instead of homebrewed boolean

[bapt] Another function to ansify

[bapt] Remove unused variables

[bapt] Explicitly use O_RDONLY instead of 0

[bapt] Use strlcpy(3) instead of strcpy(3)

[bapt] upper the warning level to 3

[bapt] Another bit of ansification

[bapt] Ansify to allow to work on it later

[peter] Fix an error in r281551, part of the getfsstat() / kern_getfsstat()
rework.  The number of entries was supposed to be returned to the user,
not used as a scratch variable.

This broke RELENG_4 jails starting up on current systems.

[imp] Add some data found in TI's application note "SCPA035: PCI1510
Implementation Guide" about default values.

[imp] When dealing with the TI12XX family of parts, we sometimes need to
initialize the MFUNC registers. Our old test of assuming that if this
register is set at all is not quite right. Many scenarios (including
the power-on defaults for chips w/o EEPROMs) land us in trouble. The
MFUNC0 pin should be set to signal #INTA and the MFUNC1 pin should be
set to signal #INTB of multi-socketed devices. Since my memory recalls
issues with blindly clearing the upper bytes of this register, perform
the heuristic only when both MFUNC0 and 1 are clear. We won't work
well using these pins for GPIO, and the serial interrupts won't save
us because we go out of our way to generally disable them. They are
needed to support legacy drivers for 16-bit PC Cards that are
hard-wired to specific IRQ values. Since FreeBSD never had any of
these, we configure the more reliable direct signaling. This was just
one small piece of that which had been left out back in the day.

[allanjude] Add a sanity check to the swap size in zfsboot of bsdinstall
Loop until the user enters a valid size (>100mb or 0)

Differential Revision:	https://reviews.freebsd.org/D2299
Reported By:	Shawn Webb
Reviewed by:	roberto
Approved by:	brd
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.

[loos] Now that DMA works, enable the audio driver on RPi 2.

[loos] Enable DMA for sdhci on RPi 2 (BCM2836).

[loos] Fix DMA on RPi 2.

BCM2836 has a different base address for peripherals.

Obtained from:	netbsd

[bapt] Remove limitation on input lines by using getline(3)

[bapt] Extend the list of known nroff/troff commands

Obtained from:	heirloom doctools

[bapt] Take from heirloom's doctools version of checknr(1) some cosmetic fixes
This helps working on synchronising both tools

[brooks] Remove "capability mode sandbox enabled" messages.

These messages serve little purpose and break some consumers.

PR:		199855
Differential Revision:	https://reviews.freebsd.org/D2440
Reviewed by:	rwatson
Approved by:	pjd
MFC after:	1 week
Sponsored by:	DARPA, AFRL

[gjb] Remove a debugging line that snuck in with r282419.

Pointyhat:	gjb
MFC after:	3 days
X-MFC-With:	r282419
Sponsored by:	The FreeBSD Foundation

[gjb] MFV r225523, r282431:
 r225523 (hrs):
  Import openresolv-3.4.4.

 r282431:
  Import openresolv-3.7.0.

PR:		199854
Submitted by:	yuri_at_rawbw.com
MFC after:	1 week
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation

[loos] In preparation for the next cycle of official ARM images, add ARM_NEW_PMAP
to supported kernels.

This is a temporary solution and should be reverted when ARM_NEW_PMAP is
enabled by default.

[jhibbits] Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100)

Summary:
This has been tested on the RB800, but should work on the RB333, RB600, and
RB1100 as well.

It's currently missing ECC support, but read and write are complete.

Reviewers: imp

Reviewed By: imp

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D2223

[mav] Implement in-order execution of non-NCQ commands.

Using status updates in r282364, block queue on BSY, DRQ or ERR bits set.
This can be a performance penalization for non-NCQ commands, but it is
required for proper error recovery and standard compliance.

MFC after:	2 weeks

[glebius] Fix arithmetical bug in vnode_pager_haspage().  The check against object size
should be done not with the number of pages in the first block, but with the
overall number of pages.  While here, add KASSERT that makes sure that BMAP
doesn't return completely irrelevant blocks.

Reviewed by:	kib
Tested by:	pho
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.

[bapt] Parse filename until first space then print the rest of the line after file
inclusion

This is the same behaviour of heirloom's soelim

[ian] Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.

The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code.  This makes it difficult to
MFC new features added to the PPS facility.  ABI compatibility is
important; out-of-tree drivers in module form are known to exist.  (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along after.)

These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version.  The driver sets its version field before calling the new
pps_init_abi() function.  That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version.  The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.

To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme.  Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.

These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher.  It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().

Reviewed by:	hselasky_at_

[bapt] Do not remove libmap32.conf in make delete-old as it may remove user modified
version by mistake

[bapt] Style fix

Reported by:	bdrewery

[bapt] Remove now unneeded libmap32.conf

[bapt] Rework PRIVATELIB

Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead
of being installed in /usr/lib/private and playing with rpath.

Also allow to install headers for PRIVATELIBS in that case the headers will be
installed in /usr/include/private/$foo

Keep the headers under a private namespace to prevent third party build system
to easily find them to ensure they are only used on purpose.

This allows for non base applications to statically link against a library in
base which is linked to a privatelib

Treating PRIVATELIBS as regular libraries allows to push them into our current
compatX packages if needed.

While here finish promotion of libevent as PRIVATELIB
Install header for bsdstat and libucl

Differential Revision:	https://reviews.freebsd.org/D2365
Reviewed by:	brooks, des
Discussed with:	imp

[gjb] Add logic to detect if the net/bsdec2-image-upload port needs
to be installed. [1]

For the cw-ec2-portinstall and ec2ami targets, touch the
.TARGET file after completion to prevent duplicate invocations.

Add cw-ec2-portinstall and ec2ami to CLEANFILES.

Submitted by:	cperciva[1]
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[ian] On an icache sync by address/len, round the length up if the operation spans
a cacheline boundary.

PR:		199740
Submitted by:	Juergen Weiss <weiss_at_uni-mainz.de>

[jhb] Various updates to the ftruncate(2) documentation:
- Note that ftruncate(2) can operate on shared memory objects and cross
  reference shm_open(2).
- Note that ftruncate(2) does not change the file position pointer (aka
  seek pointer) of the file descriptor.
- ftruncate(2) will fail with EINVAL for all sorts of other fd types than
  just sockets, so instead note that it fails for all but regular files and
  shared memory objects.
- Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2).
  (Or at least the manpage for both appeared in 4.2, I did not check the
  kernel code itself to see if either predated 4.2.)

PR:		199472 (2)
Submitted by:	andrew_at_ugh.net.au (2)
MFC after:	1 week

[jhb] Partially revert r255486, the first argument to socketpair() is a socket
domain, not a file descriptor.  Use 'domain' instead of the original 'd'
for this argument to match socket(2).

PR:		199491
Reported by:	sp55aa_at_qq.com
MFC after:	1 week

[cy] Restore CPU dependent compile time conditionals.

MFC after:	1 month (with r281143 and r282408)

[cy] MFV ntp 4.2.8p2 (r281348)

Reviewed by:    delphij (suggested MFC)
Approved by:	roberto
Security:       CVE-2015-1798, CVE-2015-1799
Security:       VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2
MFC after:	1 month

[neel] Emulate the 'CMP r/m8, imm8' instruction encountered when booting a Windows
Vista guest.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	1 week

[adrian] Fix string concatenation - "wlan_##name" -> "wlan_" #name

PR:		kern/197623
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Use bssid validation for data frames only + add RUN -> RUN state transition

However, IBSS merge will be performed only if a driver calls
ieee80211_ibss_merge(); so, this applicable to the ath(4) only.
Also, this should fix bug 167870.

PR:		kern/199632
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Add node_clear_keyixmap() and use it in the ieee80211_free_node() / node_reclaim().

PR:		kern/199672
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[loos] Fix the voltage and clock levels for cpufreq on RPi 2.

Submitted by:	Daisuke Aoyama <aoyama_at_peach.ne.jp>

[adrian] [iwn] Do not filter control frames in monitor mode.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Handle properly IBSS merges (works with patch from bug 199632).

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix various powersave races + optimize tx/rx pointer update when powersave is off.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] [iwn?] Use correct sequence numbers with non-QoS STAs.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix warning about comparison of integers of different signs.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] [iwn?] Fix memory leak in wpi_reset_tx_ring().

PR:		kern/197143
Differential Revision:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Use nitems() for counting elements in arrays.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Do not include WPI_START_SCAN event processing into non-debug builds.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix sequence number generation for beacon frames.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Add debug output for WPI_BEACON_SENT event.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Try to fix passive scanning hang on beacon miss.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Add comment about AUTH -> AUTH state transition + fix some style issues.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Display more information for beacon miss debugging.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Limit minimum threshold of missed beacons.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Improve beacon miss detection.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Create another debug category for WPI_BEACON_MISSED notification.

Differential Revision:	kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Unbreak scanning after RUN -> SCAN state transition.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Check channels which are passed in IBSS mode.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Do not disable beacon notifications (unbreaks scanning on passive channels).

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix pause scan time calculation (the remainder must be less than beacon interval).

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix active/passive dwell calculation.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Turn off led when leaving RUN state.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[imp] For eabi 5 (what FreeBSD uses), be sure to tag all executables and
shared libraries as either SOFT or HARD float to comply with the EABI
standard.

Differential Revision: https://reviews.freebsd.org/D2401

[imp] When merging the floating point type attribute, and reporting an error
when things don't match, report which file has them and which one
doesn't correctly.

Differential Revision: https://reviews.freebsd.org/D2400

[adrian] Add TX status codes (obtained from iwlegacy)

PR:		kern/197143
Differential Revision:	Andriy Voskoboinyk <s3erios_at_gmail.com>
Obtained from:	Linux drivers/net/wireless/iwlegacy

[adrian] Move radiooff_task to the internal taskqueue.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Use another workaround for scanning.

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Add wpi_check_bss_filter()

PR:		kern/197143
Submitted by:	 Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Fix KASSERT statements in if_wpi_debug.h

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Remove workaround for bug 199676.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Remove old iv_bss entry from the node table

This may happen on RUN -> SCAN -> RUN -> SCAN state transition:

1. RUN -> SCAN: in ieee80211_sta_join1(): iv_bss will be moved to obss,
   refcnt will be reduced by 2 (default minimum).

Now, if old iv_bss have some extra references (for example, from
unacknowledged probe responses), it will not be freed and will stay
in the node table.

2. SCAN -> RUN.

3. If old iv_bss will not be deleted by the time when the next RUN -> SCAN
   state transition occurs, then sta_leave() will reduce it's reference
   counter once more. As a result, two last users will free it -> this will
   lead to kernel panic.

In this patch old iv_bss entry is explicitly removed from the node table in
ieee80211_sta_join1() (as a result, it will not be processed by sta_leave()).

PR:		kern/199676
Differential Revision:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Add a few local variables to improve readability.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Remove this; it's currently a no-op.

History note: it's good to document what the driver expects like this even
if it's currently a no-op.

Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[adrian] Retry twice at the same rate.

Submitted by:	Andriy Voskoboinyk <s3erios_at_gmail.com>

[mav] Implement basic PxTFD.STS.BSY reporting.

MFC after:	2 weeks

[loos] Fix the vt(4) framebuffer driver on RPi 2.

Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove DMA code (its now done in bcm2835_mbox.c).

Also adjust the color palette when bcm2708_fb.fbswap is set.  The
firmware used on RPi 2 uses this mode.

Tested on:	RPi-B and RPi 2 with 16, 24 and 32bpp
Note:		The 32bpp mode on RPi-B has the red and blue swapped, this
		is a know problem (not a driver problem).

[loos] Fix the sc(4) framebuffer driver on RPi 2.

Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove unused code and unnecessary includes.

Adjust the color palette when bcm2708_fb.fbswap is set on /chosen/bootargs
node of DTB.  The firmware used on RPi 2 uses this mode.

Tested on:	RPi-B and RPi 2 with 16, 24 and 32bpp

[loos] Add the routines to query and setup the framebuffer state using the
BCM2835_MBOX_CHAN_PROP channel.  The old channel (BCM2835_MBOX_CHAN_FB)
seems deprecated on recent firmware versions and is causing a freeze on
RPi 2.

The actual changes in the framebuffer drivers will follow in subsequent
commits.

[loos] Fix the kernel ident for RPI2.

[glebius] After r281643 an #ifdef IFT_FOO preprocessor directive returns false,
since types became a enum C type.  Some software uses such ifdefs to
determine whether an operating systems supports certain interface type.
Of course, such check is bogus. E.g. FreeBSD defines about 250 interface
types, but supports only around 20.
However, we need not upset such software so provide a set of defines. The
current set was taken to suffice the dhcpd.

Reported & tested by:	Guy Yur <guyyur gmail.com>

[glebius] Remove #ifdef IFT_FOO.

Submitted by:	Guy Yur <guyyur gmail.com>

[glebius] Instead of reading, validating and adjusting value of the vm.swap_async_max
in the main swapper work cycle, do it in the sysctl handler.  This removes
extra mutex acquisition from the main cycle and makes the sysctl knob return
error on an invalid value, instead of accepting and fixing it.

Reviewed by:	kib
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.

[loos] Remove an unused variable.

[neel] Don't advertise the Intel SMX capability to the guest.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	1 week

[oshogbo] nv_malloc can fail in userland.
Add check to prevent a NULL pointer dereference.

Pointed out by:	mjg
Approved by:	pjd (mentor)

[oshogbo] Remove duplicated code using macro template for the nvlist_add_.* functions.

Approved by:	pjd (mentor)

[oshogbo] Add test case for unpack with diffrent flags.

Approved by:	pjd (mentor)

[oshogbo] Introduce the NV_FLAG_NO_UNIQUE flag. When set, it allows to store
multiple values using the same key in a nvlist.

Approved by:	pjd (mentor)
Obtained from:	WHEEL Systems (http://www.wheelsystems.com)

Update man page.

Reviewed by:	AllanJude
Approved by:	pjd (mentor)

[oshogbo] Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.

Change the nvlist_recv() function to take additional argument that
specifies flags expected on the received nvlist. Receiving a nvlist with
different set of flags than the ones we expect might lead to undefined
behaviour, which might be potentially dangerous.

Update consumers of this and related functions and update the tests.

Approved by:	pjd (mentor)

Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist
and cap_xfer_nvlist.

Reviewed by:	AllanJude
Approved by:	pjd (mentor)

[mav] Initialize PxCMD on reset and make its read-only bits such.

MFC after:	2 weeks

[mav] Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().

MFC after:	1 week

[bapt] Capsicumize col(1)

[bapt] Actually push the right tests

[bapt] Add regression test about reverse line feed to col(1)

[bapt] Add regression tests for soelim(1)

[bz] Fix an off-by-one bug in string/array handling which lead to memory overwrite
and follow-up assertion errors on at least ARM after r282257,
with nvp_magic being 0x6e7600:
Assertion failed: ((nvp)->nvp_magic == 0x6e7670), function nvpair_name, file .../subr_nvpair.c, line 713.

Sponsored by:	DARPA/AFRL

[neel] Emulate machine check related MSRs to allow guest OSes like Windows to boot.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[neel] Advertise an additional memory BAR in the "dummy" device emulation.

This is useful for testing the MOVS emulation when both the source and
destination addresses are in the MMIO space.

MFC after:	1 week

[imp] Remove support for being compiled under OABI. We don't support that
any more, so this is just dead code.

Differential Revision: https://reviews.freebsd.org/D2419

[markj] fork(2): Add a note to the effect that kqueue descriptors, unlike other
descriptor types, are not inherited from the parent process.

Reported by:	kmacy
MFC after:	1 week

[markj] Remove a stale reference to the stop_scheduler_on_panic tunable, which
itself was removed in r243515.

MFC after:	1 week

[markj] Don't drop the idr lock before verifying that the newly-inserted element
is present in the tree. Otherwise there exists a window during which the
element could be removed by another thread, triggering an incorrect
assertion failure.

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

[bapt] Improve compatibility groff's soelim
While here implement -C from GNU groff

Reported by:	delphij

[delphij] Correct - handling.

Reported by:	pkg-fallout
X-MFC-with:	r282318

[bapt] Import sqlite3 3.8.9

[bapt] Add a note about the replacement of GNU groff's soelim(1)

[pfg] No need for result_use_check attribute in reallocf(3).

[bapt] Apply the copyright the the same owners as the original malloc(3) where most of
the text here comes from

Reported by:	many
Discussed with:	miod_at_OpenBSD.org
Pointyhat to:	bapt

[andreast] Fix the loader for sparc64.
The commit from r279799 missed the adaptation of md_load in
sparc64/loader/main.c. This resulted in Memory Address Align issues at the
early boot stage.

Tested on a netbooted Fire 120.

[bapt] Bump _FreeBSD_version after reallocarray import

Requested by:	delphij

[bapt] Replace groff's soelim by soeliminate(1) renamed soelim(1)

[bapt] Move reallocarray definition to the _BSD_VISIBLE block
Add the required __alloc_size attributes

Requested by:	pfg

[bapt] libc now has reallocarray

[bapt] Remove bundled reallocarray(3) since it is now in libc

[bapt] Import reallocarray(3) from OpenBSD

Add a manpage for it, assign the copyright to the OpenBSD project on it since it
is mostly copy/paste from OpenBSD manpage.
style(9) fixes

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

[oshogbo] Add nvlist_flags() function, which returns nvlist's public flags.

Approved by:	pjd (mentor)

[bapt] Use defines to improve clarity

MFC after:	2 weeks

[bapt] col: fixing 25 year old bug

Makes col(1) respect POSIX again for escape sequences as decribed in its manpage
The bug was introduced in CSRG in 1990
This also reverts r280911

Differential Revision:	https://reviews.freebsd.org/D2424
Reviewed by:	jhb
MFC after:	2 weeks

[oshogbo] Sort MLINKS alphabetically.

Approved by:	pjd (mentor)

[emaste] OptionalObsoleteFiles: don't remove c++filt when using ELF Tool Chain

c++filt is listed here twice, for MK_CXX == no and MK_GCC == no, but
r282285 only caught one of them.

[oshogbo] Remove symlinks to the nvlist_.*[vf] functions.
This should be done with r282257 commit.

Approved by:	pjd (mentor)

[neel] r281630 relaxed the limits on the vectors that can be asserted in the IRRs.

Do the same when transitioning a vector from the IRR to the ISR and also
when extinguishing it from the ISR in response to an EOI.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[gnn] Add a state transition call to show that we have entered TIME_WAIT.
Although this is not important to the rest of the TCP processing
it is a conveneint way to make the DTrace state-transition probe
catch this important state change.

MFC after:	1 week

[bz] Remove the extra extern which makes gcc complain; I assume it came from
r282289.

We do include ixgbe.h which does include ixgbe_common.h which has the
extern statement for ixgbe_stop_mac_link_on_d3_82599().

[bz] Unreak DNS usage through libcapsicum, which broke, e.g., ping in r282252
with what looks like a copy and paste error.

Sponsored by:	DARPA/AFRL

[bapt] Fix font issues

Submitted by:	heirloom doctools upstream

[neel] Emulate MSR_SYSCFG which is accessed by Linux on AMD cpus when MTRRs are
enabled.

MFC after:	2 weeks

[bdrewery] Add a -v to tell where each symbol is resolved from.

Sponsored by:	EMC / Isilon Storage Division

[bdrewery] Fix a comment

[erj] Fix build by adding ixgbe_x550.c to sys/conf/files for ixgbe.

Submitted by:	neel
Approved by:	jfv (mentor)

[emaste] crunchide: Restore local EM_AARCH64 constant for bootstrapping

Most of the EM_* constants are available in all supported host branches,
but EM_AARCH64 was added relatively recently. Add it back to fix
building HEAD on 10.x.

Noticed by:	adrian, jmallett

[erj] Include makefiles necessary to make ixgbe build with the new code.

Originally supposed to be included in r282289.

Differential Revision: D2414

[erj] Add support for certain Intel X550 devices.

These include standalone X550 adapters, X552 10GbE backplane, and
X552/X557-AT 10GBASE-T; with the latter two being integrated into Xeon D SoCs.

As well, this bumps the ixgbe version number to 2.8.3, and includes updates
to shared code for support for the new devices.

Differential Revision: D2414
Reviewed by:	gnn, adrian
Approved by:	jfv (mentor), gnn (mentor)

[emaste] Actually add c++filt's Makefile

Missed in r282285

Pointy hat to:	emaste

[neel] Don't require <sys/cpuset.h> to be always included before <machine/vmm.h>.

Only a subset of source files that include <machine/vmm.h> need to use the
APIs that require the inclusion of <sys/cpuset.h>.

MFC after:	1 week

[melifaro] Fix KASSERT introduced in r282155.

Found by:	dhw

[emaste] Add ELF Tool Chain's c++filt to the build

Differential Revision:	https://reviews.freebsd.org/D2408
Reviewed by:	brooks, imp
Sponsored by:	The FreeBSD Foundation

[neel] When an instruction cannot be decoded just return to userspace so bhyve(8)
can dump the instruction bytes.

Requested by:	grehan
MFC after:	1 week

[oshogbo] Mark local function as static as a result of removing recursion.

Approved by:	pjd (mentor)

[oshogbo] Rename macros to use prefix ERRNO. Add macro ERRNO_SET. Now
ERRNO_{RESTORE/SAVE} must by used together, additional variable is not
needed. Always use ERRNO_{SAVE/RESTORE/SET} macros.

Approved by:	pjd (mentor)

[neel] Advertise the MTRR feature via CPUID and emulate the minimal set of MTRR MSRs.
This is required for booting Windows guests.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[jhb] Various fixes to the stats in igb(4), ixgbe(4), and ixl(4).
- Use hardware counters for ifnet stats in igb(4) when possible.  This
  ensures these stats include packets that bypass the regular stack via
  netmap.
- Don't derefence values off the end of the igb(4) VF stats structure.
  Instead, add a dedicated if_get_counter method for igb(4) VF interfaces.
- Report missed packets on igb(4) as input queue drops rather than an
  input error.
- Report bug_ring drop counts as output queue drops for igb(4) and ixgbe(4).
- Export the buf_ring drop stats for individual rings via sysctl on
  ixgbe(4).
- Fix a typo that in ixl(4) that caused output queue drops to be reported
  as input queue drops and input queue drops to be unreported.

Differential Revision:	https://reviews.freebsd.org/D2402
Reviewed by:	jfv, rstone (6)
Sponsored by:	Norse Corp, Inc.

[jkim] Remove leftover from r282269.

MFC after:	2 weeks
X-MFC with:	r282269

[gnn] Move the SIFTR DTrace probe out of the writing thread context
and directly into the place where the data is collected.

[jhb] Remove support for Xen PV domU kernels.  Support for HVM domU kernels
remains.  Xen is planning to phase out support for PV upstream since it
is harder to maintain and has more overhead.  Modern x86 CPUs include
virtualization extensions that support HVM guests instead of PV guests.
In addition, the PV code was i386 only and not as well maintained recently
as the HVM code.
- Remove the i386-only NATIVE option that was used to disable certain
  components for PV kernels.  These components are now standard as they
  are on amd64.
- Remove !XENHVM bits from PV drivers.
- Remove various shims required for XEN (e.g. PT_UPDATES_FLUSH, LOAD_CR3,
  etc.)
- Remove duplicate copy of <xen/features.h>.
- Remove unused, i386-only xenstored.h.

Differential Revision:	https://reviews.freebsd.org/D2362
Reviewed by:	royger
Tested by:	royger (i386/amd64 HVM domU and amd64 PVH dom0)
Relnotes:	yes

[jhb] Update this page to note that XENHVM now works on i386.  (It shipped
enabled in GENERIC in 10.0.)

Reviewed by:	royger (earlier version)
MFC after:	1 week

[trasz] Remove oldnfs remnants from nfsd(8).

Reviewed by:	rmacklem_at_
Sponsored by:	The FreeBSD Foundation

[royger] atkbd: remove usage of x86bios

Instead of trying to get the keyboard repeat rate set by the BIOS just set a
default one. This allows removing the usage of x86bios from atkbd.

Sponsored by: Citrix Systems R&D
Reviewed by: jkim, delphij
Differential Revision: https://reviews.freebsd.org/D2399
MFC after: 2 weeks

[jhibbits] Also happened to miss this in r282264.

[jhibbits] Missed ofw_machdep.c in r282264.

[kevlo] - Disable usb aggregation mode by default since it boots performance
- Minor tweak

PR:	199718
Submitted by:	Mikhail <mp39590 at gmail dot com>

[sbruno] Setting PATH to anything is useless as a bare command.  Its only relevant
if its set in the environement of each command seperately.

Move the PATH setting to the NXBMAKE variable so its picked up to find
the one-off gperf build for the native-xtools target.

Pointed Out by: ngie

[jhibbits] Unify booke and AIM machdep.

Much of the code was common to begin with.  There is one nit, which is likely
not an issue at all.  With the old code, the AIM machdep would __syncicache()
the entire kernel core at setup.  However, in the unified setup, that seems to
hang on the MPC7455, perhaps because it's running later than before.  Removing
this allows it to boot just fine.  Examining the code, the FreeBSD loader
already does syncicache of the full kernel, and each module loaded, so this
doesn't appear to be an actual problem.

Initial code by Nathan Whitehorn.

[eadler] Phabricator: enable "history.immutable":
	With certain arc workflows leaving history.immutable as false
	results in using the upstream template instead of our usual
	commit template.  Since the git workflow issues alluded to in my
	prior commit message can be worked around, set history.immutable
	once again.

[sbruno] Fix native-xtools breakage when building a gcc enabled target on a clang
enabled host.  Build a one-off gperf and put it in the PATH for the rest
of the target so the ONE call to gperf by the gcc build picks it up and
DTRT.

Reviewed by:	imp

[neel] Re-implement RTC current time calculation to eliminate the possibility of
losing time.

The problem with the earlier implementation was that the uptime value
used by 'vrtc_curtime()' could be different than the uptime value when
'vrtc_time_update()' actually updated 'base_uptime'.

Fix this by calculating and updating the (rtctime, uptime) tuple together.

MFC after:	2 weeks

[oshogbo] Save errno from close override.

Approved by:	pjd (mentor)

[oshogbo] Remove the nvlist_.*[fv] functions.

Those functions are problematic, because there is no way to report
memory allocation problems without complicating the API, so we can
either abort or potentially return invalid results. None of which is
acceptable.

In most cases the caller knows the size of the name, so he can allocate
buffer on the stack and use snprintf(3) to prepare the name.

After some discussion the conclusion is to removed those functions,
which also simplifies the API.

Discussed with: pjd, rstone
Approved by:	pjd (mentor)

[grembo] Bump __FreeBSD_version for smb(4) changes in r281985

Differential Revision:	https://reviews.freebsd.org/D2398
Reviewed by:	bapt, flo
Approved by:	bapt, flo

[sbruno] Obsolute /usr/bin/gperf for non-gcc enabled targets.

Leave it as valid for mips/sparc64 gcc enabled targets.

Reviewed by:	imp_at_

[oshogbo] Remove the use of nvlist_.*[fv] functions from tests.

Approved by:	pjd (mentor)

[oshogbo] Remove the use of nvlist_.*[vf] functions from casper and replace
them with snprintf(3). Assert the results of snprintf(3).

Approved by:	pjd (mentor)

[oshogbo] Remove the use of nvlist_.*[vf] functions from libcapsicum and replace
them with snprintf(3). Assert the results of snprintf(3).

Approved by:	pjd (mentor)

[oshogbo] Remove recursion from descriptor-related functions.

Approved by:	pjd (mentor)

[oshogbo] Nvlist functionality is not used within interrupt context, so we should
use M_WAITOK to allocate memory.

Approved by:	pjd (mentor)

[oshogbo] Always use the nv_malloc macro instead of malloc(3).

Approved by:	pjd (mentor)

[oshogbo] Style fixes.

Approved by:	pjd (mentor)

[emaste] vt: fix vt_fb_bitblt_bitmap mask corruption

Previously the mask wrapped when one or more of the mask bytes extended
past the right edge of the window. Simplify the logic and use the same
byte offset and bit in both the pattern and mask.

PR:		199648
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2360

[pfg] Revert r281889:

The change would appease the static analyzers but it is pretty much a
no-op. I need to trust static analyzers much less, especially for the
kernel.

Requested by:	jkim

[kib] Remove the #ifdef DEBUG code, which is not compilable on 64bit
architectures.  It seems to be an overlooked chunk in the r15645.

PR:	199767
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[ngie] Fix typo. It should have been atf_tc_skip, not atf_skip

Reported by: many, Jenkins
Pointyhat to: ngie
MFC after: 4 days

[gnn] Brief demo script showing the various values that can be read via the new SIFTR statically defined tracepoint (SDT).

Reviewed by:	bz, markj

[jhb] Don't free mbufs when stopping an interface in netmap mode.

Currently if you ifconfig down a vtnet interface while it is being used
via netmap, the kernel panics due to trying to treat the cookie values
in the virtio rings as mbufs to be freed. When netmap is enabled, these
cookie values are pointers to something else.

Note that other netmap-aware drivers don't seem to need this as they
store the mbuf pointers in the software rings that mirror the hardware
descriptor rings, and since netmap doesn't touch those, the software
state always has NULL mbuf pointers causing the loops to free mbufs to
not do anything. However, vtnet reuses the same state area for both
netmap and non-netmap mode, so it needs to explicitly avoid looking at
the rings and treating the cookie values as mbufs if netmap is
enabled.

Differential Revision:	https://reviews.freebsd.org/D2348
Reviewed by:	adrian, bryanv, luigi
MFC after:	1 week
Sponsored by:	Norse Corp, Inc.

[gnn] Brief demo script showing the various values that can be read via
the new SIFTR statically defined tracepoint (SDT).

Differential Revision:	https://reviews.freebsd.org/D2387
Reviewed by:	bz, markj

[scottl] Revert r282227.  It is clearly incorrect as it frees an object that is still
referenced.  I think that there does exist an unlikely edge case for a
memory leak, but only if a driver is incorrectly written and specifies no
valid range of targets to scan.  That can be fixed in a follow-up commit.

Obtained from:	Netflix, Inc.

[trasz] Remove spurious period.

MFC after:	1 month
Sponsored by:	International OCD Foun^W^W^WThe FreeBSD Foundation

[brd] Fix typo

[trasz] Make rctl(8) more user-friendly when RACCT/RCTL is disabled for some reason.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[bapt] Fix mis usage of ms(7) macros

Submitted by:	heirloom doctools upstream

[gjb] Document r280297, OpenSSL updated to version 1.0.1m.

Sponsored by:	The FreeBSD Foundation

[scottl] Improve support for blacklisting bad memory locations.  The user can supply
a text file with a list of physical memory addresses to exclude, and have it
loaded at boot time via the provided example in loader.conf.  The tunable
'vm.blacklist' remains, but using an external file means that there's no
practical limit to the size of the list.  This change also improves the
scanning algorithm for processing the list, scanning the list only once
instead of scanning it for every page in the system.  Both the sysctl and
the file can be unsorted and contain duplicates so long as each entry is
numeric (decimal or hex) and is separated by a space, comma, or newline
character.  The sysctl 'vm.page_blacklist' is now provided to report what
memory locations were successfully excluded.

Reviewed by:	imp, emax
Obtained from:	Netflix, Inc.
MFC after:	3 days

[pfg] Fix memory leak in scsi_scan_bus()

CID:	1007770
PR:	199671

[pfg] Plug memory leaks in kbdmux(4) (take 2)

This is a fix to the previous attempt in r281889, which some (most?)
keyboards.

Discussed with:	emaste, jkim

Found by:	clang static analyzer
CID:		1007072
CID:		1007073
CID:		1007074

[andrew] Add pmap_mapbios and pmap_unmapbios. These will be needed to support acpi.

Sponsored by:	The FreeBSD Foundation

[smh] Correct date typo in UPDATING

MFC after:	1 month
X-MFC-With: r282208
Sponsored by:	Multiplay

[bapt] Remove never written documentation

[bapt] Explicitly declare to not print the current date

Found with heirloom-doctools which uses the original AT&T macros

[royger] vt_vga: add a timeout while waiting for vertical retrace

On one of my systems FreeBSD will fail to boot because vt_vga gets stuck
waiting for the vertical retrace if there's no monitor attached. Fix this by
adding a timeout and exiting if the vertical retrace times out.

Sponsored by: Citrix Systems R&D
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D2397

[gnn] Make it possible to statically link SIFTR into the kernel
as a new option.

Reviewed by:	bz
Discussed with:	lstewart
MFC after:	2 weeks

[trasz] Remove oldnfs leftovers from mountd(8).

Reviewed by:	rmacklem_at_
Sponsored by:	The FreeBSD Foundation

[trasz] Add kern.racct.enable tunable and RACCT_DISABLED config option.
The point of this is to be able to add RACCT (with RACCT_DISABLED)
to GENERIC, to avoid having to rebuild the kernel to use rctl(8).

Differential Revision:	https://reviews.freebsd.org/D2369
Reviewed by:	kib_at_
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation

[whu] Microsoft vmbus, storage and other related driver enhancements for HyperV.
    - Vmbus multi channel support.
    - Vector interrupt support.
    - Signal optimization.
    - Storvsc driver performance improvement.
    - Scatter and gather support for storvsc driver.
    - Minor bug fix for KVP driver.
Thanks royger, jhb and delphij from FreeBSD community for the reviews
and comments. Also thanks Hovy Xu from NetApp for the contributions to
the storvsc driver.

PR:     195238
Submitted by:   whu
Reviewed by:    royger, jhb, delphij
Approved by:    royger
MFC after:      2 weeks
Relnotes:       yes
Sponsored by:   Microsoft OSTC

[ngie] ATF_REQUIRE_KERNEL_MODULE: use atf_skip, not ATF_REQUIRE_MSG so the testcase
no longer bombs out
PLAIN_REQUIRE_KERNEL_MODULE: use printf + _exit, no err so the testcase no
longer bombs out if it prints to stderr

MFC after: 5 days

[adrian] Constify some const parameters in seq.h.

The NUMA work I'm doing uses const for read-only parameters, which requires
the seq.h API to also use const for read-only parameters.

Reviewed by:	mjg

[neel] Emulate the 'bit test' instruction. Windows 7 uses 'bit test' to check the
'Delivery Status' bit in APIC ICR register.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[smh] Standardise chmod, chflags, chown and chgrp recursive symlink processing

chmod, chflags, chgrp, chmod and chown now affect symlinks in -R mode as
defined in symlink(7); previously symlinks were silently ignored.

Differential Revision:	https://reviews.freebsd.org/D2316
Reviewed by:	jilles
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Multiplay

[imp] Only include CWARNFLAGS once to reduce command line size from ~1400
characters to "only" ~900 for kernel builds.

[neel] Implement the century byte in the RTC. Some guests require this field to be
properly set.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[smh] Fix misuse of input argument in traverse_visitbp

In traverse_visitbp(), the input argument dnp is modified in the middle
to point to a temporary buffer. Originally this doesn't matter, because
no user of TRAVERSE_POST dereferences it. However, in fbeddd6 a piece of
code is added dereferencing dnp after the modification, creating a possible
bug.

We fix this by creating a new local variable cdnp for the DMU_OT_DNODE case,
so we don't modify the input argument. Also we introduce different local
variables in the DMU_OT_OBJSET case to prevent confusion between the input
argument.

Obtained from:	zfsonlinux (a585f2f844ed3d4270221fed88f5e494eb55d932)
MFC after:	2 weeks
Sponsored by:	Multiplay

[gjb] Refine the entry regarding devfs(5) timestamps, as of
r280949, devfs(5) updates default to seconds precision.

Submitted by:	jilles
Sponsored by:	The FreeBSD Foundation

[pfg] libgomp: bring initial BSD support from upstream.

Initial support for FreeBSD specific routines related to counting
online processors and dynamic load balancing.

Fix "detection" of the <sys/sysctl> header which upstream seems to have
done wrong.

Obtained from:	GCC pre-4.4 branch (rev. 140497; LGPLv2.1+)

[br] o Fix bus_space_read_multi functions: correct increment value
o Use these functions for streaming

Tested with ATA (PCI bus) / Gem5 simulator

Reviewed by:	andrew
Sponsored by:	HEIF5

[ngie] Followup to r282083: add GCC_BOOTSTRAP to the list of broken options on arm64

Differential Revision: https://reviews.freebsd.org/D2379
Reviewed by: imp

[gjb] Document r281387, hptnr(4) driver updated to version 1.1.1.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281396, ACPI update to 20150410.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280870, fix directory inclusion when '--one-file-system'
is specified.

Sponsored by:	The FreeBSD Foundation

[gjb] Update the svn revision marker.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281845, file verification support in MAC.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281713, hwpmc(4) support for Freescale e500 core.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281439, support for the 'virt' QEMU SoC.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281311, disallow directory traversal in ar(1).

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281261, DTrace support for the Book-E.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281130, gcc attributes added to standard include headers.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix a whitespace nit.

Sponsored by:	The FreeBSD Foundation

[gjb] Typo/spelling fixes.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280971, support for RFC6864.
Add Netflix and Nginx to the sponsors.ent file.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix revision for GELI prompt support in the loader.
The initial commit was reverted (without a useful commit
message), and committed again as r281616.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280938, GELI passphrase prompt support added to the
boot loader.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280932, elftoolchain update to version 3179.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280930, several RPC fixes.
Add MIT AI Lab to sponsors.ent.

Sponsored by:	The FreeBSD Foundation

[gjb] Partially document r280859, readelf(1) is now switched to the ELF
toolchain version.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280308, devfs(5) timestamp updates for read/write operations
is now disabled by default.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280259, initial support for arm64/aarch64.
Add arch.arm64 entity to release.ent.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r280183, drm update to match Linux 3.8.13.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r279957, DSM TRIM support for virtual AHCI disks.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281316, xz(1) update to version 5.2.1.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281373, nvi(1) update to version 2.1.3.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281806, wpa_supplicant(8)/hostapd(8) update to version 2.4.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r281812, make(1) update to version 20150418.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r282089, unbound(8) update to 1.5.3.

Sponsored by:	The FreeBSD Foundation

[gjb] Document r279122, netstat(1) updated to use libxo(3).

Sponsored by:	The FreeBSD Foundation

[gjb] Document r273562, libxo(3) import.
Add Juniper Networks to sponsors.ent.

Sponsored by:	The FreeBSD Foundation

[emaste] Don't add arm64 to universe builds if the user provided a TARGETS list

Differential Revision:	https://reviews.freebsd.org/D2375
Reported by:	andrew
Reviewed by:	andrew, imp
Sponsored by:	The FreeBSD Foundation

[melifaro] Fix panic introduced by r282070.
Arm friendly KASSERT() to ease debug of similar crashes.

Submitted by:	Olivier Cochard-Labbé

[andrew] Allow the arm64 config file to define SOCDEV_PA and SOCDEV_VA that may be
used in locore.S to map an extra range when enabling the MMU.

[andrew] Only enable the hpet driver on x86 hardware, it doesn't exist on arm64.

Sponsored by:	The FreeBSD Foundation

[pfg] MFV	r282150
libgomp: Update to version 4.3.5.

This is a partial revert of r282115, to bring the fromal upstream
libgomp from GCC 4.3.5 Release under LGPLv2.1+.

This is only brought to ease the ongoing development of the CPU
affinity support.

This shall not be MFC'd.

[andrew] Fix pmap_dcache_wb_pou in the new armv6 pmap to correctly achieve icache
consistency from ptrace.

PR:		199739
Submitted by:	Jurgen Weiss <weiss at uni-mainz.de> (original version)
Submitted by:	Svatopluk Kraus <onwahe at gmail.com>

[andrew] There may not be an FACS table, check for this before accessing it.

Sponsored by:	The FreeBSD Foundation

[gjb] Fix CROCHETBRANCH, forgotten in r280640.

Submitted by:	ruben.kerkhof_at_gmail.com
PR:		199760
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[imp] The presence/absence of CPU features should be tested with
MACHINE_CPUARCH or MACHINE_ARCH, not MACHINE. The latter is for kernel
only things. Also, I think this should be unconditional since all our
architectures have long double support, but I don't have time to test
that thoroughly so just add a comment to that effect.

[glebius] Require "ldconfig" for "devd". It is possible that user puts into
devd.conf execution of third-party software, that needs libraries
from /usr/local. Since devd is launched before ldconfig script, if
the hardware that has associated software is attached on boot, then
execution would fail.

Differential Revision:	https://reviews.freebsd.org/D2332
Reviewed by:		imp

[emaste] crunchide: add basic string table sanity checks

Reported by:	Coverity Scan
CID:		978805, 980919
Sponsored by:	The FreeBSD Foundation

[ae] Fix the comment. We will not do SPD lookup again, because
ip[6]_ipsec_output() will find PACKET_TAG_IPSEC_OUT_DONE mbuf tag.

Sponsored by:	Yandex LLC

[ngie] Adjust CFLAGS to find freebsd_test_suite/macros.h

MFC after: 6 days

[ngie] Use PLAIN_REQUIRE_KERNEL_MODULE to require "mqueuefs"

MFC after: 6 days

[ngie] - Use ATF_REQUIRE_KERNEL_MDOULE to require aio(4)
- Don't use /tmp as a basis for temporary files as it's outside of the ATF
  sandbox
- Don't override MAX macro in sys/param.h

MFC after: 6 days

[ngie] Use ATF_REQUIRE_KERNEL_MODULE instead of aio_available function

MFC after: 6 days

[ngie] Add initial (unpolished) macros for interfacing with the FreeBSD test suite

This is very rough, but will be replaced/redesigned some time soon after I fix
the Jenkins breakage I introduced

MFC after: 6 days

[ngie] Fill in the copyright boilerplate for the test program

MFC after: 6 days

[ae] Since PFIL can change mbuf pointer, we should update pointers after
calling ipsec_filter().

Sponsored by:	Yandex LLC

[avg] replace a comment about zfs recv -F corner case with a longer, more detailed one

The old comment in zfs_rezget explains what situation the code handles,
the new comment also describes how the situation can arise.

Also, re-join a line that became sufficiently shorti some time ago.

Differential Revision:	https://reviews.freebsd.org/D2352
Reviewed by:	delphij, smh
MFC after:	12 days

[avg] zfs_onexit_fd_hold: return EBADF even if devfs_get_cdevpriv gave ENOENT

/dev/zfs always has per-open data, so when it is missing the file
descriptor is for some other file.  Returning ENOENT in this case
is confusing as a variety of other conditions (like a missing dataset)
may result in the same error.  It's better to consistently return
EBADF for any problems with the file descriptor.

Note that zfs_onexit_fd_hold() is used with 'automatic cleanup fd'
- when that fd is closed, typically because a process is terminated,
some cleanup action is taken by ZFS driver.  E.g. a temporary
snapshot hold is released.

Perhaps, it would even be worthwhile changing devfs_get_cdevpriv()
to return EBADF if there is no associated data.

Differential Revision:	https://reviews.freebsd.org/D2370
Reviewed by:	delphij, smh
MFC after:	12 days

[ganbold] Update Amlogic MMC driver:

  1) Advertise the actual min / max speeds the hardware is capable
       of supporting given the reference clock used by the board.

  2) Rather than attempting to extend the hardware's timeout register
       in software (the hardware doesn't have sufficient bits to directly
            support long timeouts), simply implement the same timeout approach
	         used in the SDXC driver.

  3) Set the timeout for a linked command (e.g. STOP TRANSMISSION) based
       on the previous multiblock read / write.

The changes have been smoke tested on both the ODROID-C1 and the VSATV102-M6
using the following cards:

* PQI 2GB microSD
* SanDisk 2GB microSD
* PQI 8GB SDHC (not a microSD so only tested on the ATV-102)
* PNY 8GB microSDHC
* SanDisk Ultra 32GB microSDHC

Submitted by:  John Wehle

[kib] Do not sleep waiting for the MAP_ENTRY_IN_TRANSITION state ending with
the vnode locked.

Review:	https://reviews.freebsd.org/D2381
Submitted by:	Conrad Meyer, Attilio Rao
MFC after:	1 week

[avg] dsl_dir_rename_check: return EXDEV on cross-pool rename attempt

Obtained from:	zfsonlinux/zfs_at_9063f65476b7b7d78ccf096fec890b8727117e2a
Obtained from:	Boris Protopopov <boris.protopopov_at_actifio.com>
MFC after:	10 days

[avg] MFV r282123: 5610 zfs clone from different source and target pools produces coredump

MFC after:	10 days

[avg] MFV r282124: 5393 spurious failures from dsl_dataset_hold_obj()

The actual bugfix was pro-actively committed in r275515.
This MFV is cosmetic, it just aligns code style with the upstream.

MFC after:	10 days

[avg] nvpair_type_is_array: DATA_TYPE_INT8_ARRAY was not recognized

To do:	upstream (https://www.illumos.org/issues/5778)
MFC after:	10 days

[avg] dump_nvlist: handle DATA_TYPE_BOOLEAN_ARRAY

To do:	upstream (https://www.illumos.org/issues/5752)
MFC after:	10 days

[hselasky] The add_bounce_page() function can be called when loading physical
pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET
flag is set, use the physical address to compute the page offset
instead. The physical address should always be valid when adding
bounce pages and should contain the same page offset like the virtual
address.

Submitted by:	Svatopluk Kraus <onwahe_at_gmail.com>
MFC after:	1 week
Reviewed by:	jhb_at_

[kevlo] - Add a new urtwn(4) device
- Remove duplicate REALTEK RTL8188CU_0 entry.

[marcel] Fix build breakage with GCC.

Pointed out by: bz_at_

[gjb] Add the cw-ec2-portinstall target to always install the
net/bsdec2-image-upload port.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[pfg] libgomp: bring early CPU affinity support from FSF GCC-4_3 branch.

This is not likely to make it into a release and is basically disabled
but should still be useful for testing.

Obtained from: GCC pre-4.3 (rev. 123494, 125542; LGPLv2.1+)

[delphij] Generate new UUID if system UUID is known bad or malformed and add a two
seconds sleep if we found the system UUID be invalid.

Obtained from:	FreeNAS
MFC after:	2 weeks

[gjb] Fix a comment.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[adrian] Drop the default for performance_cx_lowest (ie, what to use when AC is connected) to ACPI C2.

ACPI C3 ends up doing a lot more work before entering sleep, some of which
requires grabbing a global ACPI hardware serialising mutex.

Because of this, the more CPU cores you have, the more that lock contends
under load, reaching close to the #1 lock contention (after VM, which is being
worked on.)

Tested:

* Sandy bridge Xeon, 2 socket * 8 core
* Ivy bridge Xeon v2, 2 socket * 8 core
* Westmere-EX, 4 socket * 10 core
* Ivybridge desktop
* Sandybridge mobile
* Ivybridge mobile

MFC after:	2 weeks

[kib] Change interpretation of the DF_ORIGIN and DF_1_ORIGIN flags.
According to standard, the presence of the flags only means that the
object path must be resolved at the time object loading, instead of my
reading that the flag is required to enable token substitution at all.

The consequence is that -z origin linker flag is no longer required
for the token substitution in the run/rpath or the needed library
soname.  It is only recommended if token substition is needed at
dlopen(3) time, since namecache might drop the required entries at the
time of resolution.

Found, reviewed and tested by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[ngie] Fix a typo (linnker -> linker)

[gjb] Do not nest the BSD and MBR partitions, which produces
an unbootable image.  Use just an MBR scheme instead.

Sponsored by:	The FreeBSD Foundation

[ngie] Remove per-architecture checks for enabling HAVE_FENV_H

The conditional came from NetBSD, where only select architectures have this
header/support

All architectures on FreeBSD have the necessary support though, so the
conditional's completely unnecessary

make tinderbox done on all architectures (including arm64, where the issue
occurred before) this time

X-MFC with: r282057, r282092
MFC after: 6 days

[ngie] Add OLD_FILES entry for r282076

MFC after: never

[ngie] Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_test

As jhb noted, the actual mmap(2) implementation is under sys/vm, not
sys/kern/, so the correct logical place is tests/sys/vm/, not
tests/sys/kern/

X-MFC with: r282076
MFC after: 6 days

[gjb] Generate the arm64/aarch64 memstick image as MBR instead of
GPT.

Boot tested by:	andrew
Sponsored by:	The FreeBSD Foundation

[oshogbo] Fix potential memory leak.

Pointed-out by:	pfg
Approved by:	pjd (mentor)

[marcel] Upgrade libxo to 0.3.2.

Obtained from:  https://github.com/Juniper/libxo/tree/0.3.2
Requested by: Phil Shafer <phil_at_juniper.net>

This import incorporates local change 279966.
Local change 276260 has been merged-in.

[rene] The Dutch queen abdicated two years ago, the national holiday associated with
her birthday is now associated with the birthday of her son.

[oshogbo] Add myself (oshogbo) to calendar.freebsd and committers-src.dot.

Approved by:	pjd (mentor)

[jgh] - remove -l option from ntpdate manpage, as it is no longer an option

Differential Revision:	https://reviews.freebsd.org/D2358
Submitted by:	gnn_at_
Approved by:	wblock (mentor)
MFC after:	after 1 week

[andrew] Return NULL on failure from nexus_alloc_resource as it reutrns a pointer.

[zbb] Fix wrong cast of pointer to u_int in db_interface.c on ARM64

Fix to commit introduced in: r282078

Pointed out by: andrew
Obtained from:  Semihalf
Sponsored by:   The FreeBSD Foundation

[andrew] Correct the spelling of MACHINE_CPUARCH, MACHINE_CPU is not set on arm64.

[andrew] Disable the tests that use makecontext on arm64, it still needs to be
written.

[des] Upgrade Unbound to 1.5.3.

[des] Add a script that runs configure for both ldns and drill.

Run configure for drill (I forgot to do it when I imported 1.6.17, but the
omission was harmless).  Note that running configure --with-drill at the
top level doesn't quite work for us since it is geared toward the slightly
weird upstream Makefiles, which we don't use.

[des] Restore packaging subdir to enable running unmodified configure script.

[trasz] Make setproctitle(3) work in Capsicum capability mode.  This makes
ctld(8) child processes to indicate initiator address and name in
their titles, similar to what iscsid(8) child processes do.

PR:		181352
Differential Revision:	https://reviews.freebsd.org/D2363
Reviewed by:	rwatson_at_, mjg_at_
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[kib] Partially revert r255986: do not call VOP_FSYNC() when helping
bufdaemon in getnewbuf(), do use buf_flush().  The difference is that
bufdaemon uses TRYLOCK to get buffer locks, which allows calls to
getnewbuf() while another buffer is locked.

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

[kib] Fix locking for oshmctl() and shmsys().

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

[andrew] Add GCC to the list of broken options on arm64.

[melifaro] Fix 'may be used uninitialized' warning not caught by clang.

[melifaro] Use free_nat_instance() for nat instance deletion.

Sponsored by:	Yandex LLC

[zbb] Introduce ddb(4) support for ARM64

Obtained from: Semihalf
Reviewed by:   emaste
Sponsored by:  The FreeBSD Foundation

[ngie] Integrate tools/regression/mmap into the FreeBSD test suite as
tests/sys/kern/mmap_test

MFC after: 1 week

[ngie] Convert this testcase over to a TAP format testcase

MFC after: 1 week

[ngie] Integrate tools/regression/aio/aiotest and tools/regression/aio/kqueue into the
FreeBSD test suite as tests/sys/aio

MFC after: 1 week

[ngie] - Fix style(9) a bit
-- Fix whitespace
-- Use err/errx
-- Remove superfluous braces
- Be a bit more defensive with input from the end-user
- Don't throw a floating point exception by dividing by 0 when processing a
  zero-byte file

MFC after: 1 week

[ngie] - Fix compilation (MAP_INHERIT's dead)
- Fix warnings
- Use mkstemp instead of tmpnam

MFC after: 1 week

[ngie] Integrate tools/regression/mqueue into the FreeBSD test suite as
tests/sys/mqueue

MFC after: 1 week

[melifaro] Make rule table kernel-index rewriting support any kind of objects.

Currently we have tables identified by their names in userland
with internal kernel-assigned indices. This works the following way:

When userland wishes to communicate with kernel to add or change rule(s),
it makes indexed sorted array of table names
(internally ipfw_obj_ntlv entries), and refer to indices in that
array in rule manipulation.
Prior to committing new rule to the ruleset kernel
a) finds all referenced tables, bump their refcounts and change
 values inside the opcodes to be real kernel indices
b) auto-creates all referenced but not existing tables and then
 do a) for them.

Kernel does almost the same when exporting rules to userland:
 prepares array of used tables in all rules in range, and
 prepends it before the actual ruleset retaining actual in-kernel
 indexes for that.

There is also special translation layer for legacy clients which is
able to provide 'real' indices for table names (basically doing atoi()).

While it is arguable that every subsystem really needs names instead of
numbers, there are several things that should be noted:

1) every non-singleton subsystem needs to store its runtime state
somewhere inside ipfw chain (and be able to get it fast)
2) we can't assume object numbers provided by humans will be dense.

Existing nat implementation (O(n) access and LIST inside chain) is a
good example.

Hence the following:
* Convert table-centric rewrite code to be more generic, callback-based
* Move most of the code from ip_fw_table.c to ip_fw_sockopt.c
* Provide abstract API to permit subsystems convert their objects
  between userland string identifier and in-kernel index.
  (See struct opcode_obj_rewrite) for more details
* Create another per-chain index (in next commit) shared among all subsystems
* Convert current NAT44 implementation to use new API, O(1) lookups,
 shared index and names instead of numbers (in next commit).

Sponsored by:	Yandex LLC

[ngie] Remove mergeinfo added from ^/user/ngie/more-tests

[ngie] Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifo
and tools/regression/file into the FreeBSD test suite as tests/sys/file

MFC after: 1 week

[scottl] Small change in header order to allow this to compile.

Obtained from:	Netflix, Inc.
MFC after:	3 days

[ngie] Integrate tools/regression/kqueue into the FreeBSD test suite as
tests/sys/kqueue

MFC after: 1 week

[ngie] Fix -Wformat warnings by using proper format string qualifiers for
long and unsigned[ long] types

MFC after: 1 week

[ngie] Integrate tools/regression/execve into the FreeBSD test suite as
tests/sys/kern/execve

MFC after: 1 week

[ngie] Move etc/tests/rc.d to etc/rc.d/tests to match the directory layout jmmv_at_
documented and implemented in other areas of the FreeBSD tree

MFC after: 1 week

[ngie] Build/install libc, librt, libthr, and msun NetBSD test suites on all
architectures

MFC after: 1 week

[ngie] The fmodl compat shims on arm/mips/powerpc aren't complete

Disable the test code for now on those architectures

MFC after: 1 week
PR: 199422

[ngie] ath3kfw, bcmfw, bthidcontrol, bthidd all require usb(4); build them
conditionally if MK_USB != no

MFC after: 1 week

[glebius] Fix memory leak.

PR:		199670
Reviewed by:	ae

[loos] Pass the supplied buffer length instead of a fixed size.

[ae] Make ipsec_in_reject() static. We use ipsec[46]_in_reject() instead.

Sponsored by:	Yandex LLC

[ae] Remove now unneded KEY_FREESP() for case when ipsec[46]_process_packet()
returns EJUSTRETURN.

Sponsored by:	Yandex LLC

[ae] Fix possible use after free due to security policy deletion.

When we are passing mbuf to IPSec processing via ipsec[46]_process_packet(),
we hold one reference to security policy and release it just after return
from this function. But IPSec processing can be deffered and when we release
reference to security policy after ipsec[46]_process_packet(), user can
delete this security policy from SPDB. And when IPSec processing will be
done, xform's callback function will do access to already freed memory.

To fix this move KEY_FREESP() into callback function. Now IPSec code will
release reference to SP after processing will be finished.

Differential Revision:	https://reviews.freebsd.org/D2324
No objections from:	#network
Sponsored by:	Yandex LLC

[ganbold] Enable root mounting from mmc/sd card.

[tuexen] Don't panic under INVARIANTS when receiving a SACK which cumacks
a TSN never sent.
While there, fix two typos.

MFC after: 1 week

[jilles] hexdump: Don't use uninitialized struct stat.

[glebius] Don't use ifm_data.  It was used only for self checking debug.

Reviewed by:	np

[mjg] fd: plug an always overwritten initialization in fdalloc

[mjg] Consistently use p instead of td->td_proc in create_thread

No functional changes.

[andrew] Cleanup a little more:
 - Remove whitespace at the end of lines
 - Use a tab after instructions, not spaces

[andrew] Fix the style of locore-v4.S and locore-v6.S to help find any common code.

[andrew] Remove the armv6 code from locore-v4.S, it's not needed there.

[grembo] Improve smb(4) man page.

Differential Revision:	https://reviews.freebsd.org/D2368
Reviewed by:	wblock
Approved by:	wblock

[andrew] Use ARMv7 style unaligned access on ARMv6. We set this bit in locore, but
it was missing from here.

[bapt] mdoc: fix rendering issues

[hselasky] Allow DSP basename cloning to be disabled or enabled at boot and
runtime. This is useful when implementing OSS sound stacks in
userspace via libcuse for example.

MFC after:	2 weeks

[bapt] mdoc: fix function declaration

[bapt] mdoc: remove empty line

[bapt] Remove end of line whitespace

[bapt] mdoc: remove end of line whitespace

[bapt] mdoc: rendering fixes

[bapt] Use mdoc(7) macros to handle parenthesis

[bapt] mdoc: fix functions declarations

[melifaro] Generalize object reference handling in ipfw rules.
No ABI changes.

[bapt] Escape "Ed"

[bapt] Pet manlint

[bapt] Escape "Ed"

[bapt] Remove End Of Line whitespaces

[bapt] Fix 2 rendering issue with mandoc

[bapt] Use mdoc(7) macros for curly braces

[bapt] mdoc: escape Re

[bapt] Add a forgotten vi.chars

Reported by:	ngie

[bapt] Do not modify locales

[bapt] Reincorporate documentation lost with update to nvi 2.1.3

[loos] Set ARM_L2_PIPT for A10 and RPI2, they are probably missing by accident.

Noted by:	Michal Meloun <meloun_at_miracle.cz>

[loos] Make the pcf8563 RTC work on FDT systems and on interrupt based i2c
controllers.

Call iicbus_transfer() from the device context and not from the iicbus
context.

I am committing a slightly different patch, so if something break, it is
probably my fault.

PR:		199496
Submitted by:	Juraj Lutter <otis_at_sk.FreeBSD.org>

[jilles] libarchive: Allow setting nanosecond timestamps.

[tychon] STOS/STOSB/STOSW/STOSD/STOSQ instruction emulation.

Reviewed by:	neel

[pfg] Cleanup a bit the clang attributes for type safety checking.

Cleanup r281861 by moving the definitions to their own section but
still leave the definitions out of lint.

In addition to the 'argument_with_type_tag' attribute, bring
'type_tag_for_datatype' which is necessary for annotating the
data types.

[grembo] Expand SMBUS API to add smbus_trans() function.

Differential Revision:	https://reviews.freebsd.org/D1955
Reviewed by:	adrian, jhb, wblock
Approved by:	adrian, jhb

[hiren] Currently there is no easy way to specify net.isr.maxthreads = all cpus. We need
to specify exact number of cpus in loader.conf which get annoying when you have
mix of machines which don't have equal number of total cpus. I propose "-1" as
that value. When loader.conf has net.isr.maxthreads = -1, netisr will use all
available cpus.

In collaboration with:	davide
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D2318
MFC after:	2 weeks
Sponsored by:	Limelight Networks

[rwatson] Adjust PROF_ARTIFICIAL_FRAMES in the DTrace profile provider on ARM to
skip 10, rather than 9, frames.  This appears to work quite well in
practice on the BeagleBone Black, so remove a comment about the value
being bogus and replace it with a slightly less negative one.  However,
the number of frames to skip is quite sensitive to details of the timer
and interrupt handling paths, so this is necessarily fragile -- but no
more so than on x86.

Sponsored by:	DARPA, AFRL

[jilles] sh: Pass along SIGINT from a child if job control is enabled, even when not
interactive.

I added the interactive check in r208881 to be safe, but in actual use
(scripts in set -m mode) passing along SIGINT seems best.

Discussed with:	bdrewery

[sobomax] o Properly init prevtime, so that we don't print bogus value in the
first entry reported by the relative mode (-R).

o Properly print negative offsets, which I guess may happen if
records get re-ordered somehow, possibly due to the locking. Right
now we report huge bogus diff (i.e. 2 seconds or so).

[ngie] Assuming a system has /bin/csh on it is a bad idea (especially it being
optional on FreeBSD). Look for /bin/cat instead

MFC after: 3 days

[ngie] Add #include sys/types.h for register_t for mips

MFC after: 3 days

[rmacklem] Fix the NFS server's handling of a bogus NFSv2 ROOT RPC.
The ROOT RPC is deprecated in the NFSv2 RFC, RFC-1094
and should never be used by a client.

Tested by:	thmu_at_freenet.de
MFC after:	1 week

[rmacklem] MAXBSIZE defines both the largest UFS block size and the
largest size for a buffer in the buffer cache. This patch
defines a new constant MAXBCACHEBUF, which is the largest
size for a buffer in the buffer cache. Having a separate
constant allows MAXBCACHEBUF to be set larger than MAXBSIZE
on a per-architecture basis, so that NFS can do larger read/writes
for these architectures. It modifies sys/param.h so that BKVASIZE
can also be set on a per-architecture basis.
A couple of cases where NFS used MAXBSIZE instead of NFS_MAXBSIZE
is fixed as well.

Differential Revision:	https://reviews.freebsd.org/D2330
Reviewed by:	mav, kib
MFC after:	2 weeks

[delphij] Try alternate addresses more agressively.

Attempt to connect to alternate addresses if the connect doesn't
succeed in 180ms, and cut wait time between connection attempts
in half for each additional, if no connection was established.

Take the first connection to succeed and close the others.

This makes whois more responsive when e.g. IPv6 service took long
time or fail to respond.

PR:		158125
Submitted by:	Mark Andrews <marka isc org> (with changes from me)
MFC after:	2 weeks

[mckusick] Limit the number of cylinder groups that will be searched when
trying to build a cluster. The limit is tunable using the sysctl
vfs.ffs.maxclustersearch. The current limit is 10 cylinder groups
per block allocation. It was previously limited to the number of
cylinder groups in the filesystem per block allocation. When there
were no clusters of the needed size left, it repeatedly searched
the whole filesystem for a non-existent cluster on every block
allocation. The result was very slow filesystem allocation with
100% CPU utilization. The old behavior can be had by setting
vfs.ffs.maxclustersearch to a huge number (1,000,000).

This change affects only the layout policy routines so is not able
to interfere with the integrity of the filesystem.

Reported by: Dmitry Sivachenko (demon_at_)
Tested by:   Dmitry Sivachenko (demon_at_)
MFC after:   2 weeks

[kib] Use correct length for sparse uiomove().  It must be the clipped to
the page size, len is the total transfer length, which may be larger
than zero_region.

Reported and tested by:	clusteradm (gjb)
Sponsored by:	The FreeBSD Foundation
X-MFC-With:	r281442

[emaste] Add LLDB to BROKEN_OPTIONS for arm prior to armv6

LLVM lacks support on FreeBSD for ARMv4/ARMv5 64-bit atomic operations.

Sponsored by:	The FreeBSD Foundation

[ae] Fix possible reference leak.

Sponsored by:	Yandex LLC

[neel] Don't allow guest to modify readonly bits in the PCI config 'status' register.

Reported by:	Leon Dang (ldang_at_nahannisys.com)
MFC after:	2 weeks

[pfg] Add definition to support alloc_align attribute.

gcc 4.9 added support for new alignment attribute alloc_align:

The alloc_align attribute is used to tell the compiler that the function
return value points to memory, where the returned pointer minimum
alignment is given by one of the functions parameters. GCC uses this
information to improve pointer alignment analysis.

This attribute is not (yet) available on clang.

[emaste] vt(4): Simplify mouse area detection

vt_is_cursor_in_area needs to return true if any part of the mouse
cursor is visible in the rectangle area. Replace the existing test with
a simpler version of a test for overlapping rectangles.

Differential Revision:	https://reviews.freebsd.org/D2356
Reviewed by:	ray
Sponsored by:	The FreeBSD Foundation

[scottl] Revert r281451.  It causes a panic/hang early in boot for a number of
users, myself included.  The original code is likely papering over a
larger bug that needs to be explored, but for now get things back to
a working state.

Obtained from:	Netflix, Inc.
MFC after:	immediately

[jhb] Watchdog drivers need to support rearming the watchdog in contexts which
are not permitted to sleep.  Only use the IPMI watchdog with backends
which poll driver-initiated requests to meet this requirement.

In practice this means that watchdogs will no longer be used on systems
that use the SSIF backend.

Differential Revision:	https://reviews.freebsd.org/D2062
MFC after:	2 weeks

[kib] Move common code from sys/i386/i386/mp_machdep.c and
sys/amd64/amd64/mp_machdep.c, to the new common x86 source
sys/x86/x86/mp_x86.c.

Proposed and reviewed by:	jhb
Review:	https://reviews.freebsd.org/D2347
Sponsored by:	The FreeBSD Foundation

[brooks] Merge from CheriBSD: 1065cf515a7c2062598009c1318055aacbb39e80

Convert the pfsync dissector to use the netdissect framework.

Differential Revision:	https://reviews.freebsd.org/D2359
Reviewed by:	glebius
Sponsored by:	DARPA, AFRL

[jhb] Rename the kld for oce(4) to if_oce.ko.  ifconfig(8) has special knowledge
about kld filenames for network drivers that requires them to follow the
pattern of if_<foo>.  This also fixes the existing documentation in the
manpage which says to use if_oce_load=YES in loader.conf.

PR:		199095
MFC after:	1 week

[joel] Fix minor mdoc issues.

[jhb] Update this driver to not save copies of registers that are no longer used
after r281874.  While here, also update it to always write the parent's
PCI bus number to the primary bus register.

[trasz] Fix growfs(8) build with debug enabled (make -DGFSDBG).

PR:		199641
Submitted by:	Willem Jan Withagen <wjw at digiware dot nl>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[ngie] Avoid an infinite loop by ensuring that the amount of bytes read is greater
than 0 in MDXFileChunk when calculating the checksum

This edgecase can be triggered if the file is truncated while the checksum
is being calculated (i.e. the EOF is reached)

Differential Revision: https://reviews.freebsd.org/D2351 (patch by darius)
PR: 196694
Reviewed by: delphij, ngie
Submitted by: Daniel O'Connor <darius_at_dons.net.au>
Sponsored by: EMC / Isilon Storage Division

[theraven] __xlocale_C_ctype should not be const.  It contains a reference count that is modified by newlocale / duplocale / freelocale.

MFC after:	1 week

[theraven] Small changes to locale-related man pages.
Fix a missing .h and change the recommended include for the POSIX2008 functions from xlocale.h to locale.h.  Including xlocale.h is for legacy / Darwin compatibility so should not be encouraged.

[mav] Oops, add missing comma.

MFC after:	1 week

[mav] Add link to mvs(4).

MFC after:	1 week

[trasz] Make nfsstat(1) build with WARNS=6.

Sponsored by:	The FreeBSD Foundation

[takawata] Add Lynx-Point LP smbus controller ID.

[kevlo] Plural fix.

[kevlo] - Fix the length of efuse content.
- Replace the magic numbers with something more readable.

[markj] Add _.arm64.* to the svn:ignore property for head/.

[markj] Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code and
return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Differential Revision:	https://reviews.freebsd.org/D2349
Reviewed by:	avg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division

[markj] Make vpanic() externally visible so that it can be called as part of the
DTrace panic() action.

Differential Revision:	https://reviews.freebsd.org/D2349
Reviewed by:	avg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division

[andrew] Add the SOC_IMX51, SOC_IMX53, and SOC_IMX6 options. These are used to
select which SoCs the kernel config will support.

Use these options to merge files.imx51 and files.imx53.

[andrew] Reduce the diff between files.imx51 and files.imx53

[andrew] Pull out the common parts of the ODROIDC1 and VSATV102 kernels to a new
kernel config. This also removes the per-board config files from universe.

[andrew] Remove the need for board specific std files on aml8726 by moving the
options they set to the main kernel config.

[andrew] Move KERNVIRTADDR to the common std.aml8726.

[andrew] - Move files selected in files.smp to files.aml8726 and remove it.
 - Remove a redundant file from files.aml8726

[andrew] Update the ODROIDC1 and VSATV102 to reduce the diff to the other armv6
kernel config files.

[emaste] Revert r281889, it broke keyboard input

[loos] Now that we have an U-Boot for RPI2, do not use the static DTB compiled
into the kernel, which is used mostly on early development stages.

On RPI(2) the DTB is loaded and modified by firmware and then handed to
kernel via U-Boot and ubldr.

The RPI firmware adds (or modify) a few valuable data to the in memory
DTB, like:

 - System memory;
 - Ethernet MAC address;
 - framebuffer settings;
 - Board serial and revision;
 - clock-frequency for most of devices.

[loos] Fix the gpio-leds node to match the LEDs on RPI2.

The 'pwr' LED is connected to GPIO pin 35 (active high) and the 'act' LED
is connected to GPIO pin 47 (active high).

Remove the GPIO pin 47 from reserved pins list, previously it was used to
signaling the SD Card presence and now it is used by act LED.

[loos] Enable the watchdog on RPI2.

The watchdog is used to reset the SoC on cpu_reset().

Without this, RPI2 will not reboot when asked to.

[pfg] Plug memory leaks in kbdmux(4)

Al kudos here for the Clang static analyzer which, unlike Coverity,
failed to flag a false positive.

Found by:	clang static analyzer
CID:		1007072
CID:		1007073
CID:		1007074

MFC after:	1 week

[trasz] Remove oldnfs support from nfsstat(1).

Reviewed by:	rmacklem_at_ (earlier version)
Sponsored by:	The FreeBSD Foundation

[jhb] Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week

[emaste] Reduce diffs between the three copies of libstand's Makefile

This should be a non-functional change.  A future change should
address the functional differences between these three and converge
on a single source.

Differential Revision:	https://reviews.freebsd.org/D2058
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation

[glebius] Don't propagate SIOCSIFCAPS from a vlan(4) to its parent. This leads to
quite unexpected result of toggling capabilities on the neighbour vlan(4)
interfaces.

Reviewed by:		melifaro, np
Differential Revision:	https://reviews.freebsd.org/D2310
Sponsored by:		Nginx, Inc.

[tuexen] A complete user message is signalled with the MSG_EOR flag, not the MSG_EOF
flag.
Thanks to Valentin Nechayev for reporting the issue.

MFC after: 1 week

[kib] Handle incorrect ELF images specifying size for PT_GNU_STACK not being
multiple of page size.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days

[trasz] Simplify linux_getcwd(), removing code that was longer used.

Differential Revision:	https://reviews.freebsd.org/D2326
Reviewed by:	dchagin_at_, kib_at_
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[hselasky] Disable multi process interrupts, because the current code doesn't use
them. Else we can end up in an infinite interrupt loop in USB device
mode.

MFC after:	3 days

[araujo] Missing break in switch case.

Differential Revision:	D2342
Reviewed by:		neel

[yongari] Add another variant of BCM5708S controller to IBM HS21 workaround
list.

PR:		118238
MFC after:	2 weeks

[gjb] Create the arm64/aarch64 VM disk image as MBR instead of
GPT scheme.  UEFI needs to know the unique partition GUID
with GPT, which changes each time.  Specifically, the QEMU
EFI BIOS file has this hard-coded.[1]

Since the GPT labels are now unavailable, unconditionally
label the root filesystem as 'rootfs' with newfs(8), since
it does not hurt anything anywhere else.  For the arm64 case,
'/' is mounted from /dev/ufs/rootfs; for all other VM images,
'/' is mounted from /dev/gpt/rootfs.

Unfortunately, since the /dev/gpt/swapfs label is also lost,
set NOSWAP=1 for the arm64/aarch64 images.  This is temporary,
until I figure out a scalable solution to this.  But, a certain
piece of softare was written "very fast", and ended up living
for 15 years.  We can deal with this for a week or so.

Information from:	andrew, emaste [1]
Sponsored by:	The FreeBSD Foundation

[pfg] libgeom: plug memory leak in EndElement.

CID:		1016696
Found by:	Clang static checker
MFC after:	1 week

[jhb] Update the pci_cfg_save/restore routines to operate on bridge devices
(type 1 and type 2) as well as leaf devices (type 0).  In particular,
this allows the existing PCI bus logic to save and restore capability
registers such as MSI and PCI-express work for bridge devices rather than
requiring that code to be duplicated in bridge drivers.  It also means
that bridge drivers no longer need to save and restore basic registers
such as the PCI command register or BARs nor manage powerstates for the
bridge device.

While here, pci_setup_secbus() has been changed to initialize the 'sec'
and 'sub' fields in the 'secbus' structure instead of requiring the pcib
and pccbb drivers to do this in the NEW_PCIB + PCI_RES_BUS case.

Differential Revision:	https://reviews.freebsd.org/D2240
Reviewed by:	imp, jmg
MFC after:	2 weeks

[jhb] Don't explicitly manage power states for PCI-PCI bridge devices in the
driver's suspend and resume routines.  These have been redundant no-ops
since r214065 changed the PCI bus driver to manage power states for
all devices (including type 1/2 bridge devices) during suspend and resume.

[jhb] Fix some incorrect #if conditions around older workarounds for bus
numbering goofs.

MFC after:	1 week

[jhb] The minimim grant and maximum latency PCI config registers are only valid
for type 0 devices, not type 1 or 2 bridges.  Don't read them for bridge
devices during bus scans and return an error when attempting to read them
as ivars for bridge devices.

[jhb] Cosmetic change: use PCIR_SECLAT_2 rather than PCIR_SECLAT_1.

[loos] Fetch the SDHCI frequency from videocore (our prefered source) and only if
it fails, fetch the clock-frequency from DTB.

If both methods fail, use the hardcoded default.

[rodrigc] Move zlib.c from net to libkern.

[pfg] Add definition for the argument_with_type_tag attribute.

This attribute originates in clang and brings support for checking types
of variadic functions' arguments for functions like fcntl() and ioctl().

Unfortunately lint(1) will complain about them: in particular as one of
the parameters is the function being tagged. For now define this attribute
in the lint-sensitive section.

Reference:
http://clang.llvm.org/docs/AttributeReference.html#type-safety-checking

[mav] Make AIO to not allocate pbufs for unmapped I/O like r281825.

While there, make few more performance optimizations.

On 40-core system doing many 512-byte AIO reads from array of raw SSDs
this change removes lock congestions inside pbuf allocator and devfs,
and bottleneck on single AIO completion taskqueue thread.  It improves
peak AIO performance from ~600K to ~1.3M IOPS.

MFC after:	2 weeks

[loos] Fix the SDHCI clock frequency for RPI2, the default clock (for the newer
firmware versions) is 250MHz.

[pfg] computematchjumps(): fix allocator sizeof operand mismatch.

Mostly cosmetical warning.

Found by:	Clang static analyzer

[pfg] _pthread_cleanup_push: fix allocator sizeof operand mismatch

Same fix appears to be in DragonFly's libthread_xu.

Found by:	Clang Static Analyzer
MFC after:	1 week

[rodrigc] Move zlib.c from net to libkern.

It is not network-specific code and would
be better as part of libkern instead.
Move zlib.h and zutil.h from net/ to sys/
Update includes to use sys/zlib.h and sys/zutil.h instead of net/

Submitted by:		Steve Kiernan stevek_at_juniper.net
Obtained from:		Juniper Networks, Inc.
GitHub Pull Request:	https://github.com/freebsd/freebsd/pull/28
Relnotes:		yes

[gjb] Remove the gptboot partition from the arm64 memory stick image,
which is not needed/used.

Sponsored by:	The FreeBSD Foundation

[kib] Move some common code from sys/amd64/amd64/machdep.c and
sys/i386/i386/machdep.c to new file sys/x86/x86/cpu_machdep.c.  Most
of the code is related to the idle handling.

Discussed with:	pluknet
Sponsored by:	The FreeBSD Foundation

[andrew] Add the null implementation of stack_save and stack_save_td.

Sponsored by:	The FreeBSD Foundation

[andrew] Remove the calls to panic from pmap_object_init_pt and pmap_clear_modify.

Sponsored by:	The FreeBSD Foundation

[rodrigc] Support file verification in MAC.

* Add VCREAT flag to indicate when a new file is being created
* Add VVERIFY to indicate verification is required
* Both VCREAT and VVERIFY are only passed on the MAC method vnode_check_open
  and are removed from the accmode after
* Add O_VERIFY flag to rtld open of objects
* Add 'v' flag to __sflags to set O_VERIFY flag.

Submitted by:		Steve Kiernan <stevek_at_juniper.net>
Obtained from:		Juniper Networks, Inc.
GitHub Pull Request:	https://github.com/freebsd/freebsd/pull/27
Relnotes:		yes

[rodrigc] Quiet compiler warnings in mbuf.h

 * Mark unused arguments with __unused
 * Move inline before the return type (and use __inline to keep the file
   consistent in style.)

Submitted by:	Steve Kiernan <stevek_at_juniper.net>
Obtained from:	Juniper Networks, Inc.

[delphij] Extend DA_Q_NO_RC16 to MXUB3* devices.

PR:		kern/198647
MFC after:	2 weeks

[glebius] Improve carp(4) locking:
- Use the carp_sx to serialize not only CARP ioctls, but also carp_attach()
  and carp_detach().
- Use cif_mtx to lock only access to those the linked list.
- These locking changes allow us to do some memory allocations with M_WAITOK
  and also properly call callout_drain() in carp_destroy().
- In carp_attach() assert that ifaddr isn't attached. We always come here
  with a pristine address from in[6]_control().

Reviewed by:	oleg
Sponsored by:	Nginx, Inc.

[hiren] For igb(4), when we are doing multiqueue, we are all setup to have full 32bit
RSS hash from the card. We do not need to hide that under "ifdef RSS" and should
expose that by default so others like lagg(4) can use that and avoid hashing the
traffic by themselves.
While here, improve comments and get rid of hidden/unimplemented RSS support
code for UDP.

Differential Revision:	https://reviews.freebsd.org/D2296
Reviewed by:	jfv, erj
Discussed with:	adrian
Sponsored by:	Limelight Networks

[gjb] Revert r281809, which did more harm than good, and apply
a more proper fix when attempting to locate the /boot
files.

Sponsored by:	The FreeBSD Foundation

[trasz] Modify kern___getcwd() to take max pathlen limit as an additional
argument.  This will be used for the Linux emulation layer - for Linux,
PATH_MAX is 4096 and not 1024.

Differential Revision:	https://reviews.freebsd.org/D2335
Reviewed by:	kib_at_
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[jah] Fix numerous issues in iic(4) and iicbus(4):
--Allow multiple open iic fds by storing addressing state in cdevpriv
--Fix, as much as possible, the baked-in race conditions in the iic
ioctl interface by requesting bus ownership on I2CSTART, releasing it on
I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv
to use the I/O ioctls
--Reduce internal iic buffer size and remove 1K read/write limit by
iteratively calling iicbus_read/iicbus_write
--Eliminate dynamic allocation in I2CWRITE/I2CREAD
--Move handling of I2CRDWR to separate function and improve error handling
--Add new I2CSADDR ioctl to store address in current cdevpriv so that
I2CSTART is not needed for read(2)/write(2) to work
--Redesign iicbus_request_bus() and iicbus_release_bus():
    --iicbus_request_bus() no longer falls through if the bus is already
owned by the requesting device.  Multiple threads on the same device may
want exclusive access.  Also, iicbus_release_bus() was never
device-recursive anyway.
    --Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but
the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be
issued again
    --Do not hold iicbus mtx during IICBUS_CALLBACK call.  There are
several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed.
    --Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns
EWOULDBLOCK; instead pass that to the caller so that it can retry if so
desired.

Differential Revision:	https://reviews.freebsd.org/D2140
Reviewed by:	imp, jhb, loos
Approved by:	kib (mentor)

[mav] Rewrite physio() to not allocate pbufs for unmapped I/O.

pbufs is a limited resource, and their allocator is not SMP-scalable.
So instead of always allocating pbuf to immediately convert it to bio,
allocate bio just here.  If buffer needs kernel mapping, then pbuf is
still allocated, but used only as a source of KVA and storage for a list
of held pages.

On 40-core system doing many 512-byte reads from user level to array of
raw SSDs this change removes huge lock congestion inside pbuf allocator.
It improves peak performance from ~300K to ~1.2M IOPS.  On my previous
24-core system this problem also existed, but was less serious.

Reviewed by:	kib
MFC after:	2 weeks

[glebius] Make IFMEDIA_DEBUG a kernel option.

Sponsored by:	Nginx, Inc.

[ngie] Serialize all of _kerberos5_bootstrap_tools to avoid build failures involving
make bootstrap-tools

On the plus side, this also greatly reduces complexity

MFC after: 1 week
Pointyhat to: ngie
Reported by: Willem Jan Withagen <wjw_at_digiware.nl>

[glebius] Instead of storing mii_media_table array index in ifm_data, determine
it in mii_phy_setmedia() functionally.

Sponsored by:	Nginx, Inc.

[trasz] Add hint about "volmode=dev" to ctl.conf(5).

Differential Revision:	https://reviews.freebsd.org/D2328
Reviewed by:	allanjude_at_, bcr_at_
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[glebius] The comment on BMCR data in if_media entry is wrong. The ifm_data stores
the index array, not a value for BMCR register. In case of IFM_10_T there
could be either MII_MEDIA_10_T or MII_MEDIA_10_T_FDX, which are 1 and 2,
accordingly. Neither matches a valid BMCR value. My guessing is that this
write is harmless, since later mii_phy_setmedia() would write a proper
value there.

The code is here since the initial checkin. Note that case IFM_100_TX has
the same comment, but a proper value of BMCR_ISO is written. So, collapse
two cases into one, always writing there BMCR_ISO.

Sponsored by:	Nginx, Inc.

[glebius] Since xmphy doesn't call mii_phy_setmedia(), there is no reason to set ifm_data.

Sponsored by:	Nginx, Inc.

[glebius] Since brgphy doesn't call mii_phy_setmedia(), there is no reason to
set any value to ifm_data.  If brgphy ever to call mii_phy_setmedia(),
then the value of BRGPHY_S1000 | BRGPHY_BMCR_FDX will trigger KASSERT.

While here, remove the obfuscating macro and wrap long lines.

Sponsored by:	Nginx, Inc.

[hselasky] Don't print uninitialized variables.

CID:	1295242

[bdrewery] Tweak BSS symbol handling from r281811 to not consider them unresolved

[bdrewery] Support libraries linked by path.

Sponsored by:	EMC / Isilon Storage Division

[sjg] Merge bmake-20150418

PR: 199486

[bdrewery] - For executables search for matching (B) global uninitialized BSS symbols from
  linked libraries. Only do this for BSS symbols that have a size which avoids
  __bss_start. Without this some libraries would be considered unneeded even
  though they were providing a B symbol.
- Add in the symbols from crt1.o to cover a handful of common unresolved symbols.
- Consider (C) common data symbols as provided by libraries/crt1.
- Move libkey() function to more appropriate place.

Sponsored by:	EMC / Isilon Storage Division

[bdrewery] Revert r281805 for now as it breaks due to spaces in output

[gjb] Simplify variable expansion in attempt to fix the vm-image build.

Sponsored by:	The FreeBSD Foundation

[bdrewery] Pass full path to ldd(1) so it works on files in cwd.

[rpaulo] Fix wpa/hostapd build without OpenSSL.

[rpaulo] Merge wpa_supplicant/hostapd 2.4.

Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of
bug fixes.

Relnotes:	yes

[bdrewery] Support demangling C++ symbols with -D flag.

Sponsored by:	EMC / Isilon Storage Division

[gjb] Merge the following from ^/projects/release-arm64 to allow
building FreeBSD/arm64 VM images and memstick.img installation
medium:
r281786, r281788, r281792:

 r281786:
  Add support for building arm64/aarch64 virtual machine images.

 r281788:
  Copy amd64/make-memstick.sh to arm64/make-memstick.sh for
  aarch64 memory stick images.

  Although arm64 does not yet have USB support, the memstick
  image should be bootable with certain virtualization tools,
  such as qemu.

 r281792:

  Add a buildenv_setup() prototype, intended to be overridden as
  needed.

  For example, the arm64/aarch64 build needs devel/aarch64-binutils,
  so buildenv_setup() in the release.conf for this architecture
  handles the installation of the port before buildworld/buildkernel.

Sponsored by:	The FreeBSD Foundation

[pfg] patch(1): small include changes.

Mostly to match OpenBSD, no functional change.

Obtained from:	OpenBSD

[loos] Build and install the DTB for all the supported AllWinner SoCs.

We will need them when we start booting using ubldr.

[pfg] Fix improbable memory leak in _citrus_prop_read_str().

Found by:	Clang Static Analyzer

[markj] Move the definition of struct bpf_if to bpf.c.

A couple of fields are still exposed via struct bpf_if_ext so that
bpf_peers_present() can be inlined into its callers. However, this change
eliminates some type duplication in the resulting CTF container, since
otherwise ctfmerge(1) propagates the duplication through all types that
contain a struct bpf_if.

Differential Revision:	https://reviews.freebsd.org/D2319
Reviewed by:	melifaro, rpaulo

[pfg] scsi_parse_transportid_rdma(): fix mismatch in memoty access size.

Independently found by Coverity and gcc49.

CID:		1230006
Reviewed by:	ken
MFC after:	5 days

[joel] Minor mdoc fixes.

[bdrewery] - Speedup significantly by not using subshells for data already fetched.
  Ran against /usr/local/sbin/pkg:
   Before:  25.12 real        12.41 user        33.14 sys
   After:   0.53 real         0.49 user         0.13 sys
- Exit with 1 if any missing or unresolved symbol is detected.
- Add option '-U' to skip looking up unresolved symbols.
- Don't consider provided weak objects as unresolved (nm V).

Sponsored by:	EMC / Isilon Storage Division

[bdrewery] Fix indentation to use tabs

[eadler] phabricator related changes:
	- don't lint either contrib or crypto: these are both externally written
	  directories
	- add additional linters for spelling (check common typos like teh ->
	  the)
	- chmod linter checks for executible bit on bad files
	- merge-conflict checks for merge conflict tokens then may have been
	  resolved incorrectly
	- filename checks for back characters in filenames
	- json for json syntax correctness

	- remove history.immutable: it is meaningless on subversion, and causes
	  workflow problems when trying to use git.  It it set to 'true' by
	  default with hg

[vangyzen] dmesg: accommodate message buffer growth between the sysctl calls

Allocate 12.5% extra space to avoid ENOMEM when the message buffer
is growing steadily.

Reported by:	Steve Wahl <steve_wahl_at_dell.com> (and tested)
Approved by:	kib (mentor)
Obtained from:	Dell Inc.
MFC after:	1 week

[vangyzen] Always send log(9) messages to the message buffer.

It is truer to the semantics of logging for messages to *always*
go to the message buffer, where they can eventually be collected
and, in fact, be put into a log file.

This restores the behavior prior to r70239, which seems to have
changed it inadvertently.

Submitted by:	Eric Badger <eric_at_badgerio.us>
Reviewed by:	jhb
Approved by:	kib (mentor)
Obtained from:	Dell Inc.
MFC after:	1 week

[gjb] When building VM disk images, vm_copy_base() uses tar(1) to
copy the userland from one md(4)-mounted filesystem to a clean
filesystem to prevent remnants of files that were added and
removed from resulting in an unclean filesystem.  When newfs(8)
creates the first filesystem with journaled soft-updates enabled,
the /.sujournal file in the new filesystem cannot be overwritten
by the /.sujournal in the original filesystem.

To avoid this particular error case, do not enable journaled
soft-updates when creating the md(4)-backed filesystems, and
instead use tunefs(8) to enable journaled soft-updates after
the new filesystem is populated in vm_copy_base().

While here, fix a long standing bug where the build environment
/boot files were used by mkimg(1) when creating the VM disk
images by using the files in .OBJDIR.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

[mav] Don't set bits that should be zero for SATA devices.

Old value made Linux think that it is PATA device with SATA bridge.

MFC after:	2 weeks

[emaste] crunchide: Remove local EM_* ELF definitions provided by system ELF headers

Suggested by:	imp (in review D2314)

[dteske] Update usage statement to align with post-r279624 functionality.

MFC after:	3 days
X-MFC-to:	stable/10 stable/9

[emaste] vidcontrol: skip invalid video modes returned by vt(4)

vt(4) has a stub CONS_MODEINFO ioctl that does not provide any data
but returns success. This needs to be fixed in the kernel, but address
it in vidcontrol(1) as well in case it's run on an older kernel.

Reviewed by:	bde
Sponsored by:	The FreeBSD Foundation

[dim] Add llvm patch corresponding to r281775.

[dim] Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):

  MC: Allow multiple comma-separated expressions on the .uleb128 directive.

  For compatiblity with GNU as. Binutils documents this as
  '.uleb128 expressions'. Subtle, isn't it?

Reported by:	sbruno
PR:		199554
MFC after:	3 days

[araujo] Remove unused variable.

Differential Revision:	D2333
Reviewed by:		royger

[araujo] Add back ixgbe_rxeof, just remove the assignment to more.

[araujo] Remove unused variable.

Differential Revision:	D2331
Reviewed by:		erj

[alc] Eliminate an unused variable.

MFC after:	1 week

[pfg] Prevent a double free.

This is similar to r281756 so set the ptr NULL after free as a safety belt
against future changes.

Obtained from:	HardenedBSD (b2e77ced9ae213d358b44d98f552d9ae4636ecac)
Submitted by:	Oliver Pinter
Revewed by:	rmacklem

[pfg] g_uncompress_taste: prevent a double free.

Found by:	Clang Static Analyzer
MFC after:	1 week

[brooks] Bump doc date missed in r281605.

MFC after:	1 day

[mav] Report link as up if tap device is not specified (black hole).

MFC after:	2 weeks

[mav] Report link as up only if we managed to open tap device.

It would be cool to report tap device status, but it has no such API.

MFC after:	2 weeks

[mav] Activate write-only optimization if bpf device opened with O_WRONLY.

dhclient opens bpf as write-only to send packets. It never reads received
packets from that descriptor, but processing them in kernel takes time.
Especially much time takes packet timestamping on systems with expensive
timecounter, such as bhyve guest, where network speed dropped in half.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.

[mav] Disable RX/TX queues notifications when not needed.

This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.

[kib] Remove code to support the top of the stack layout for FreeBSD 1.x/2.x
kernel, but keep explanation of the old ps_strings structure to make
it clear what sanity check tries to accomplish.

Noted by:	Oliver Pinter <oliver.pinter_at_hardenedbsd.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks

[kib] Remove duplicate definitions of MWAIT_CX hints.  Identical defines in
specialreg.h are enough.

Discussed with:	mav
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[eadler] find.1: Add missing whitespace:

Obtained from:	Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)

[eadler] ed(1): Fix [-Werror=logical-not-parentheses]
	/usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to
	theleft hand side of comparison [-Werror=logical-not-parentheses]

Obtained from:	Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58)
MFC After:	1 month

[pfg] nfsrpc_createv4: fix double free.

Reported by:	Oliver Pinter, clang static checker
Obtained from:	HardenedBSD (commit 63cac77c42c0c3fc67da62f97d5ab651d52ae707)
Reviewed by:	rmacklem
MFC after:	5 days

[marius] Make a comment reflect reality.

[marius] Refine the workaround for Intel HSD131 [1] added in r269052:
- Use the full mask described by the erratum as with a sufficiently high
  number of these false-positives, the overflow bit (bit 62) additionally
  gets set [7].
- HSD131 has been brought into several other Haswell-derived CPUs including
  to the next generation, i. e. Intel Broadwell. Thus, also skip reporting of
  these benign errors by default on CPU models affected by HSM142, HSW131 and
  BDM48 [2 - 5], describing the HSD131 silicon bug for additional models.
  Also, Celeron 2955U with a CPU ID of 0x45 have been reported to be covered
  by this fault [6], with the specification update concerned with HSM142 [2]
  only referring to 0x3c and 0x46.

Submitted by:	David Froehlich [7]
MFC after:	3 days

http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf [1]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-mobile-specification-update.pdf [2]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/5th-gen-core-family-spec-update.pdf [3]
http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf [4]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf [5]
https://lists.freebsd.org/pipermail/freebsd-hackers/2015-January/046878.html [6]

[adrian] Refactor out the _PXM -> VM domain lookup done in ACPI, in preparation for
its use in upcoming code.

This is inspired by something in jhb's NUMA IRQ allocation patchset.

However, the tricky bit here is that the PXM lookup for a node may
fail, requiring a lookup on the parent node.  So if it doesn't
exist, don't fail - just go up to the parent.  Only error out of the
lookup is the ACPI lookup returns an error.

Sponsored by:	Norse Corp, Inc.

[adrian] Update pkt-gen to optionally use randomised source/destination
IPv4 addresses/ports.

When doing traffic testing of actual code that /does/ things to the
packet (rather than say, 'bridge.c'), it's typically a good idea to
use a variety of cache-busting and flow-tracking-busting packet
spreads.  The pkt-gen method of testing an IP range was to walk
it linearly - which is fine, but not useful enough.

This can be used to completely randomize the source/destination
addresses (eg to test out flow-tracking-busting) and to keep the
destination fixed whilst randomising the source (eg to test out
what a DDoS may look like.)

Tested:

* Intel ixgbe 10G (82599) netmap

Differential Revision:	https://reviews.freebsd.org/D2309
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.

[kevlo] Add new USB ID.

PR:	199522

[melifaro] Fix use-after-free.

Reported by:	Coverity Scan, pfg
CID:		1245747

[mav] Change wcommitsize default from one empirical value to another.

The new value is more predictable with growing RAM size:

        hibufspace maxvnodes      old      new
i386:
  256MB   32980992     15800  2198732  2097152
    2GB   94027776    107677   878764  4194304
amd64:
  256MB   32980992     15800  2198732  2097152
    1GB  114114560     68062  1678155  4194304
    4GB  217055232    111807  1955452  4194304
   16GB 1717846016    337308  5097465 16777216
   64GB 1734918144   1164427  1490479 16777216
  256GB 1734918144   4426453   391983 16777216

Reviewed by:	rmacklem
MFC after:	2 weeks

[eadler] identd: restore memcpy
	I should not be committing at 2:30am....

Reported by:	pluknet

[eadler] identd: also zero se_rpc_highvers

Reported by:	pluknet

[eadler] identd: remove redundant zeroing
	se_rpc_lowvers was set to 0 twice, so remove one of them
	I can not find any other variable which they may have been a typo of.

Reported by:	gcc5.1

[eadler] tzsetup: remove set but unused variable
	- leave a comment explaining which variable it used to be

Reported by:	gcc5.1

[eadler] config:	remove set but unchecked variable
	reported by: gcc5.1

[trasz] Add back fdrop() missed in r281726.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[eadler] README: changes and fixups
	Two orthogonal goals:
	- try to make README look a little nicer on phabricator by using
	  Remarkup syntax for commands (using `` instead of using a closing ')
	- try to make README look a little nicer on github.

	- Don't encourage `make world` when the handbook specifies otherwise
	- Change language around documentation to be a bit clearer

MFC After:	2 weeks

[trasz] Optimize the O_NOCTTY handling hack in linux_common_open().

Differential Revision:	https://reviews.freebsd.org/D2323
Reviewed by:	kib_at_
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[trasz] Replace "new NFS" with just "NFS" in some sysctl description strings.

Sponsored by:	The FreeBSD Foundation

[eadler] rpcgen: fix use use of strcmp
	strcmp only guarantee that it will return at least 1 if the string B
	is greater than that of string A.

[eadler] calendar: remove useless check
	lineline checked for 0 in the while loop condition.  There is no need to
	check for it additionally in the body.

CID:	1288959
MFC After:	1 week

[jhibbits] Fix the build.  Commit the last part of e500 PMC.

Pointy hat to:	jhibbits

[alc] Eliminate an unused variable.

MFC after:	1 week

[eadler] bin/ed: use correct type in multiplication
	The result is line_t** so the multiplication should be size *
	sizeof(line_t*)

MFC After:	1 month

[bdrewery] sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap n n...'.

The parser considered 'trap exit INT' to reset the default for both EXIT and
INT. This beahvior is not POSIX compliant. This was avoided if a value was
specified for 'exit', but then disallows exiting with the signal received. A
possible workaround is using ' exit'.

However POSIX does allow this type of behavior if the parameters are all
integers. Fix the handling for this and clarify its support in the manpage
since it is specifically allowed by POSIX.

Differential Revision:	https://reviews.freebsd.org/D2325
Reviewed by:	jilles
MFC after:	2 weeks

[kib] Regen.

[kib] Regen.

[kib] The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and
pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x
kernels which required padding before the off_t parameter.  The
fcntl(2) contains compatibility code to handle kernels before the
struct flock was changed during the 8.x CURRENT development.  The
shims were reasonable to allow easier revert to the older kernel at
that time.

Now, two or three major releases later, shims do not serve any
purpose.  Such old kernels cannot handle current libc, so revert the
compatibility code.

Make padded syscalls support conditional under the COMPAT6 config
option.  For COMPAT32, the syscalls were under COMPAT6 already.

Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to
(partially) disable the removed shims.

Reviewed by:	jhb, imp (previous versions)
Discussed with:	peter
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[jhibbits] Implement hwpmc(4) for Freescale e500 core.

This supports e500v1, e500v2, and e500mc. Tested only on e500v2, but the
performance counters are identical across all, with e500mc having some
additional events.

Relnotes:	Yes

[kib] Make wait6(2), waitid(3) and ppoll(2) cancellation points.  The
waitid() function is required to be cancellable by the standard.  The
wait6() and ppoll() follow the other syscalls in their groups.

Reviewed by:	jhb, jilles (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week

[kib] Revert unrelated chunk from the r281707.

MFC after:	2 weeks

[kib] Remove lazy pmap switch code from i386.  Naive benchmark with md(4)
shows no difference with the code removed.

On both amd64 and i386, assert that a released pmap is not active.

Proposed and reviewed by:	alc
Discussed with:	Svatopluk Kraus <onwahe_at_gmail.com>, peter
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks

[markj] Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers.
The format of these pages is somewhat experimental, so they may be subject
to further tweaking.

Differential Revision:	https://reviews.freebsd.org/D2170
Reviewed by:	bcr, rpaulo
MFC after:	2 weeks

[rpaulo] Synaptics: don't report the middle button when clickPad is used.

On trackpads that had support for both, we were sending two button
events when the trackpad was pressed.

Tested by:	Jakob Alvermark <jakob at alvermark.net>
MFC after:	1 week

[kib] Complete r281670, unlist removed files.

Sponsored by:	The FreeBSD Foundation

[markj] Remove unimplemented sched provider probes.

They were added for compatibility with the sched provider in Solaris and
illumos, but our sched provider is already incompatible since it uses native
types, so there isn't much point in keeping them around.

Differential Revision:	https://reviews.freebsd.org/D2167
Reviewed by:	rpaulo

[markj] SDT(9): add a section on SDT providers, mentioning the "sdt" provider.
Add examples demonstrating how one can list available providers and the
DTrace probes provided by a provider.

Differential Revision:	https://reviews.freebsd.org/D2166
Reviewed by:	rpaulo
MFC after:	2 weeks

[mav] Workaround bhyve virtual disks operation on top of GEOM providers.

GEOM does not support scatter/gather lists in its I/Os.  Such requests
are cut in pieces by physio(), that may be problematic, if those pieces
are not multiple of provider's sector size.  If such case is detected,
move the data through temporary sequential buffer.

MFC after:	2 weeks

[sjg] No need to delete export from filesystems which are not exported.

[mav] Do not report stripe size if it is equal to sector size.

MFC after:	1 week

[takawata] To ensure j formatting string valid, cast uint64_t values to uintmax_t.

[kib] Initialize td_sel in the thread_init().  Struct thread is not zeroed
on the initial allocation, but seltdinit() assumes that td_sel is NULL
or a valid pointer.  Note that thread_fini()/seltdfini() also relies
on this, but correctly resets td_sel to NULL.

Submitted by:	luke.tw_at_gmail.com
PR:	199518
MFC after:	1 week

[ae] Change ipsec_address() and ipsec_logsastr() functions to take two
additional arguments - buffer and size of this buffer.

ipsec_address() is used to convert sockaddr structure to presentation
format. The IPv6 part of this function returns pointer to the on-stack
buffer and at the moment when it will be used by caller, it becames
invalid. IPv4 version uses 4 static buffers and returns pointer to
new buffer each time when it called. But anyway it is still possible
to get corrupted data when several threads will use this function.

ipsec_logsastr() is used to format string about SA entry. It also
uses static buffer and has the same problem with concurrent threads.

To fix these problems add the buffer pointer and size of this
buffer to arguments. Now each caller will pass buffer and its size
to these functions. Also convert all places where these functions
are used (except disabled code).

And now ipsec_address() uses inet_ntop() function from libkern.

PR:		185996
Differential Revision:	https://reviews.freebsd.org/D2321
Reviewed by:	gnn
Sponsored by:	Yandex LLC

[ae] Requeue mbuf via netisr when we use IPSec tunnel mode and IPv6.

ipsec6_common_input_cb() uses partial copy of ip6_input() to parse
headers. But this isn't correct, when we use tunnel mode IPSec.

When we stripped outer IPv6 header from the decrypted packet, it
can become IPv4 packet and should be handled by ip_input. Also when
we use tunnel mode IPSec with IPv6 traffic, we should pass decrypted
packet with inner IPv6 header to ip6_input, it will correctly handle
it and also can decide to forward it.

The "skip" variable points to offset where payload starts. In tunnel
mode we reset it to zero after stripping the outer header. So, when
it is zero, we should requeue mbuf via netisr.

Differential Revision:	https://reviews.freebsd.org/D2306
Reviewed by:	adrian, gnn
Sponsored by:	Yandex LLC

[ae] Fix handling of scoped IPv6 addresses in IPSec code.

* in ipsec_encap() embed scope zone ids into link-local addresses
  in the new IPv6 header, this helps ip6_output() disambiguate the
  scope;
* teach key_ismyaddr6() use in6_localip(). in6_localip() is less
  strict than key_sockaddrcmp(). It doesn't compare all fileds of
  struct sockaddr_in6, but it is faster and it should be safe,
  because all SA's data was checked for correctness. Also, since
  IPv6 link-local addresses in the &V_in6_ifaddrhead are stored in
  kernel-internal form, we need to embed scope zone id from SA into
  the address before calling in6_localip.
* in ipsec_common_input() take scope zone id embedded in the address
  and use it to initialize sin6_scope_id, then use this sockaddr
  structure to lookup SA, because we keep addresses in the SADB without
  embedded scope zone id.

Differential Revision:	https://reviews.freebsd.org/D2304
Reviewed by:	gnn
Sponsored by:	Yandex LLC

[ae] Remove xform_ipip.c and code related to XF_IP4.

The only thing is used from this code is ipip_output() function, that does
IPIP encapsulation. Other parts of XF_IP4 code were removed in r275133.
Also it isn't possible to configure the use of XF_IP4, nor from userland
via setkey(8), nor from the kernel.

Simplify the ipip_output() function and rename it to ipsec_encap().
* move IP_DF handling from ipsec4_process_packet() into ipsec_encap();
* since ipsec_encap() called from ipsec[64]_process_packet(), it
  is safe to assume that mbuf is contiguous at least to IP header
  for used IP version. Remove all unneeded m_pullup(), m_copydata
  and related checks.
* use V_ip_defttl and V_ip6_defhlim for outer headers;
* use V_ip4_ipsec_ecn and V_ip6_ipsec_ecn for outer headers;
* move all diagnostic messages to the ipsec_encap() callers;
* simplify handling of ipsec_encap() results: if it returns non zero
  value, print diagnostic message and free mbuf.
* some style(9) fixes.

Differential Revision:	https://reviews.freebsd.org/D2303
Reviewed by:	glebius
Sponsored by:	Yandex LLC

[trasz] Remove some oldnfs remnants.

Differential Revision:	https://reviews.freebsd.org/D2287
Reviewed by:	rmacklem_at_
Sponsored by:	The FreeBSD Foundation

[takawata] Change printf formatting to unbroke i386 arch.

Submitted by:david_at_catwhisker.org

[trasz] Remove unused code from linux_mount(), and make it possible to mount
any kind of filesystem instead of harcoded three.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation

[takawata] Fix Typo.

[rpaulo] Fix French typos in etherswitch.

[araujo] Fix misspelling.

[araujo] Improve code style(9), no functional changes.

Differential Revision:	D2320
Reviewed by:		takawata

[takawata] Forgot to add  default event mask definition.

[takawata] Add LE related HCI control command to hccontrol(1).

[loos] Move the items common to all SoCs to a single file.

[loos] Fix the style(9) and adds two missing parentheses on the licence.

Reduce the differences to bring in the MMC/SD driver.

Approved by:	ganbold (licence change)

------------------------------------------
[...truncated 61311 lines...]
===> bin/pwait (installincludes)
--- gnu.includes__D ---
--- _sub.buildincludes ---
===> gnu/lib/csu (buildincludes)
--- libexec.includes__D ---
===> libexec/fingerd (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/EUC (buildincludes)
--- bin.includes__D ---
===> bin/pwd (installincludes)
--- gnu.includes__D ---
===> gnu/lib/libgcc (buildincludes)
--- libexec.includes__D ---
===> libexec/ftpd (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/EUCTW (buildincludes)
--- bin.includes__D ---
===> bin/rcp (installincludes)
--- libexec.includes__D ---
===> libexec/rbootd (installincludes)
--- gnu.includes__D ---
===> gnu/lib/libdialog (buildincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/GBK2K (buildincludes)
--- bin.includes__D ---
===> bin/realpath (installincludes)
--- libexec.includes__D ---
===> libexec/talkd (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/HZ (buildincludes)
--- bin.includes__D ---
===> bin/rm (installincludes)
--- gnu.includes__D ---
===> gnu/lib/libregex (buildincludes)
--- libexec.includes__D ---
===> libexec/tcpd (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/ISO2022 (buildincludes)
--- bin.includes__D ---
===> bin/rmail (installincludes)
--- gnu.includes__D ---
--- regex.h.patched ---
sed 's=<posix/regex\.h>=<gnu/posix/regex.h>=g'  < <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib/libregex/regex.h> > regex.h.patched
===> gnu/lib/libgcov (buildincludes)
--- libexec.includes__D ---
===> libexec/tftpd (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/JOHAB (buildincludes)
--- bin.includes__D ---
===> bin/rmdir (installincludes)
--- libexec.includes__D ---
===> libexec/hyperv (installincludes)
--- gnu.includes__D ---
===> gnu/lib/libgomp (buildincludes)
--- bin.includes__D ---
===> bin/setfacl (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/MSKanji (buildincludes)
--- include.includes__D ---
--- gnu.includes__D ---
--- omp.h ---
--- include.includes__D ---
===> include (includes)
--- gnu.includes__D ---
sed -e 's/_at_OMP_LOCK_ALIGN_at_/8/g'  -e 's/_at_OMP_LOCK_KIND_at_/8/g'  -e 's/_at_OMP_LOCK_SIZE_at_/8/g'  -e 's/_at_OMP_NEST_LOCK_ALIGN_at_/8/g'  -e 's/_at_OMP_NEST_LOCK_KIND_at_/8/g'  -e 's/_at_OMP_NEST_LOCK_SIZE_at_/16/g'  < <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib/libgomp/../../../contrib/gcclibs/libgomp/omp.h.in> > omp.h
===> gnu/lib/libssp (buildincludes)
--- bin.includes__D ---
===> bin/sh (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/UES (buildincludes)
--- gnu.includes__D ---
--- _sub.buildincludes ---
--- include.includes__D ---
--- includes ---
; cd <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include;> make buildincludes; make installincludes
--- gnu.includes__D ---
===> gnu/lib/libssp/libssp_nonshared (buildincludes)
--- bin.includes__D ---
--- _sub.installincludes ---
===> bin/sh/tests (installincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/UTF1632 (buildincludes)
--- bin.includes__D ---
--- _sub.installincludes ---
===> bin/sh/tests/builtins (installincludes)
--- gnu.includes__D ---
--- ssp.h ---
sed -e 's/_at_ssp_have_usable_vsnprintf_at_/define/' <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib/libssp/../../../contrib/gcclibs/libssp/ssp/ssp.h.in> > ssp.h
--- lib.includes__D ---
===> lib/libiconv_modules/UTF7 (buildincludes)
--- include.includes__D ---
--- _sub.buildincludes ---
===> include/arpa (buildincludes)
--- gnu.includes__D ---
===> gnu/lib/tests (buildincludes)
===> gnu/lib/libreadline (buildincludes)
--- bin.includes__D ---
===> bin/sh/tests/errors (installincludes)
--- include.includes__D ---
===> include/protocols (buildincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/UTF8 (buildincludes)
--- gnu.includes__D ---
--- _sub.buildincludes ---
===> gnu/lib/libreadline/readline (buildincludes)
--- bin.includes__D ---
===> bin/sh/tests/execution (installincludes)
--- include.includes__D ---
===> include/rpcsvc (buildincludes)
--- lib.includes__D ---
===> lib/libiconv_modules/VIQR (buildincludes)
--- gnu.includes__D ---
===> gnu/lib/libstdc++ (buildincludes)
--- bin.includes__D ---
===> bin/sh/tests/expansion (installincludes)
--- include.includes__D ---
--- key_prot.h ---
--- lib.includes__D ---
===> lib/libiconv_modules/ZW (buildincludes)
--- include.includes__D ---
RPCGEN_CPP=/usr/local/bin/x86_64-portbld-freebsd10.0-cpp\ -isystem\ <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/obj/builds/FreeBSD_HEAD_amd64_gcc4.9/tmp/usr/include\> -L<https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/obj/builds/FreeBSD_HEAD_amd64_gcc4.9/tmp/usr/lib\> --sysroot=<https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/obj/builds/FreeBSD_HEAD_amd64_gcc4.9/tmp\> -B/usr/local/x86_64-freebsd/bin/ rpcgen -C -h -DWANT_NFS3 <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include/rpcsvc/key_prot.x> -o key_prot.h
rpcgen: execvp /usr/local/bin/x86_64-portbld-freebsd10.0-cpp: No such file or directory
*** [key_prot.h] Error code 1

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include/rpcsvc>
1 error

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include/rpcsvc>
*** [_sub.buildincludes] Error code 2

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include>
1 error

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include>
*** [includes] Error code 2

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include>
1 error

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/include>
*** [include.includes__D] Error code 2

make[2]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
--- bin.includes__D ---
A failure has been detected in another branch of the parallel make

make[7]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin/sh/tests/expansion>
*** [_sub.installincludes] Error code 2

make[6]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin/sh/tests>
1 error

make[6]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin/sh/tests>
--- lib.includes__D ---
A failure has been detected in another branch of the parallel make

make[6]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib/libiconv_modules/ZW>
--- bin.includes__D ---
*** [_sub.installincludes] Error code 2

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin/sh>
1 error

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin/sh>
--- lib.includes__D ---
*** [_sub.buildincludes] Error code 2

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib/libiconv_modules>
1 error

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib/libiconv_modules>
--- bin.includes__D ---
*** [_sub.installincludes] Error code 2

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin>
1 error

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin>
--- lib.includes__D ---
*** [_sub.buildincludes] Error code 2

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib>
1 error

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib>
--- bin.includes__D ---
*** [includes] Error code 2

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin>
1 error

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/bin>
--- lib.includes__D ---
*** [includes] Error code 2

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib>
1 error

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/lib>
--- bin.includes__D ---
*** [bin.includes__D] Error code 2

make[2]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
--- lib.includes__D ---
*** [lib.includes__D] Error code 2

make[2]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
--- gnu.includes__D ---
A failure has been detected in another branch of the parallel make

make[6]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib/libstdc++>
*** [_sub.buildincludes] Error code 2

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib>
1 error

make[5]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu/lib>
*** [_sub.buildincludes] Error code 2

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu>
1 error

make[4]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu>
*** [includes] Error code 2

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu>
1 error

make[3]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/gnu>
*** [gnu.includes__D] Error code 2

make[2]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
4 errors

make[2]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
*** [_includes] Error code 2

make[1]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
1 error

make[1]: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
*** [buildworld] Error code 2

make: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
1 error

make: stopped in <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/ws/>
Build step 'Execute shell' marked build as failure
[WARNINGS] Skipping publisher since build result is FAILURE
Received on Wed May 20 2015 - 20:04:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:57 UTC