Ensure that sigaction flags for signal, which disposition is reset to
ignored or default, are not leaking.  Apparently, there exists code
which relies on SA_SIGINFO not reported for SIG_DFL or SIG_IGN.

In kern_sigaction, ignore flags when resetting.  Encapsulate the flag
and disposition testing into helper sigact_flag_test().

On exec, and when delivering signal with SA_RESETHAND flag set,
signals are reset automatically.  Use new helper sigdflt(), which
removes duplicated code and corrects all flag bits for the signal.

For proc0, set sigintr bit for all ignored signals.  Ignored signals
are consumed in tdsendsignal() and not delivered to the victim thread
at all.

Reported and tested by:	royger
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga

Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after:	1 week
vt_vga: Clip the draw area to never draw offscreen

This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after:	1 week
Fix a recursive lock acquisition in vi_reset_dev().

Reviewed by:	grehan
We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.
vt(4): Mark new mouse position as dirty only when it's actually displayed

MFC after:	1 week
vt(4): Store cursor bitmap & colors in struct vt_device

This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after:	1 week
pci: add a new pci_child_added newbus method.

This is needed so when running under Xen the calls to pci_child_added
can be intercepted and a custom Xen method can be used to register
those devices with Xen. This should not include any functional
change, since the Xen implementation will be added in a following
patch and the native implementation is a noop.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb

dev/pci/pci.c:
dev/pci/pci_if.m:
dev/pci/pci_private.h:
dev/pci/pcivar.h:
 - Add the pci_child_added newbus method.
netback: fixes for netback

This patch contains the following fixes for netback:
 - Only unbind the evtchn if it has been bound.
 - Set xnb->bridge to NULL after free to prevent double-freeing it.
 - Set the MAC address for the host-facing interface to a dummy value.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Prevent trying to unbind if the evtchn has not been bounded.
 - Prevent double-freeing xnb->bridge.
 - Set the MAC address of the host-facing interface to a dummy value,
   so it can work when the interface is added to a bridge.
vt(4): Give the window to vd_bitblt_text_t callback

... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after:	1 week
netback: remove dead code

Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D
vt(4): The offset to center the text area is per-window now

The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after:	1 week
xen: fix incorrectly accounted free

Fix some frees incorrectly assigned to M_XENBUS when the memory is
allocated with M_XENSTORE.

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

dev/xen/blkback/blkback.c:
 - Fix incorrect frees.
vt(4): Don't run vt_set_border() and vt_flush() concurrently

In the case of vt_vga, the two concurrent calls were writing to the same
VGA registers, causing incorrect refresh of the screen.

MFC after:	1 week
vt_vga: Remove a "FIXME" comment; the issue was solved in r270338

MFC after:	1 week
vt(4): Use the actual size of the mouse when marking its position as dirty

This fixes a bug where part of the cursor was not erased.

MFC after:	1 week
vt(4): Remove "FIXME" about multiple locking of vt_buf in vt_flush()

After some testing, it appears that acquiring the lock once and keeping
it longer is slower than taking it multiple times.

While here, fix a typo in another comment.

MFC after:	1 week
In do_lock_pi(), do not override error from umtxq_sleep_pi() when
doing suspend check.  This restores the pre-r251684 behaviour, to
retry once after the signal is detected.

PR:	kern/192918
Submitted by:	Elliott Rabe, Dell Inc., Eric van Gyzen <eric@vangyzen.net>
Obtained from:	Dell Inc.
MFC after:	1 week
Update to the Intel Base driver for the Intel XL710 Ethernet Controller Family
	- It was decided to change the driver name to if_ixl for FreeBSD
	- This release adds the VF Driver to the tree, it can be built into
	  the kernel or as the if_ixlv module
	- The VF driver is independent for the first time, this will be
	  desireable when full SRIOV capability is added to the OS.
	- Thanks to my new coworker Eric Joyner for his superb work in
	  both the core and vf driver code.

Enjoy everyone!

Submitted by:	jack.vogel@intel.com and eric.joyner@intel.com
MFC after:	3 days (hoping to make 10.1)
Restore historical behavior of in_control, which, when no matching address
is found, the first usable address is returned for legacy ioctls like
SIOCGIFBRDADDR, SIOCGIFDSTADDR, SIOCGIFNETMASK and SIOCGIFADDR.

While there also fix a subtle issue that a caller from a jail asking for
INADDR_ANY may get the first IP of the host that do not belong to the jail.

Submitted by:	glebius
Differential Revision: https://reviews.freebsd.org/D667