MFC revision 183744

Improve entropy in source port generation for libalias consumers.

Approved by:  re (kib)
MFC: Several top '-P' fixes originally from ru@.  This fixes top -P
on i386.

Approved by:	re (kib)
MFC of r183536: tzdata2008g
MFC of r183864: tzdata2008h

Approved by:	re (blackend)
Merge r179057 into stable/6, sorry it won't be in 6.4.
Add device ID for Nikon D300 digital camera.

PR:		usb/118741
Submitted by:	Yuri <yuri@tsoft.com>
Approved by:	re (rwatson)
MFC r183814:
  Read PCI device id instead of PCI revision id. Also checks the read
  device id is JMC260 family. Previously it just verified the deivce
  is JMC260 Rev A0. This will make it easy for newer JMC2xx support.

  Pointed out by:	bouyer at NetBSD

MFC r183859:
  Make sure to read the last byte of EEPROM descriptor. Previously
  the last byte of the ethernet address was not read which in turn
  resulted in getting 5 out of the 6 bytes of ethernet address and
  always returned ENOENT. I did not notice the bug on FPGA version
  because of additional configuration data in EEPROM.

  Pointed out by:	bouyer at NetBSD

Approved by:	re (gnn)
MFC: Use 32k transfers rather than 63k transfers for chipsets that can't do
64k transfers and use the MIO method to talk to the Serverworks HT1000_S1
SATA controller.

Approved by:	re (kib)
MFC: r183970

  Use the label from the socket credential rather than the
  solabel which was not set by the mac_partition policy.

Approved by:	re (rwatson)
MFC: r183923

  Check that the mbuf len is positive (like we do in the v4 case)
  to avoid possible panics.

PR:		kern/119123
Approved by:	re (kib)
MFC: Close a race in the kern.ttys sysctl handler that resulted in panics
in dev2udev() when a tty was being detached concurrently with the sysctl
handler.  One difference relative to 7.x+ is that we still leak tty
objects in tty_free() since destroy_dev() in 6.x doesn't purge all
threads.

Approved by:	re (kib)
Close races in the pthread_condvar implementation in 6.x, note that
7.x and beyond have very different implementations and these fixes
do not apply.

In the kernel:

  Move the flag UQF_UMTXQ from the thread's td_flags where it was
  unlocked to the umtx_q struct where it now has locking.

  Nuke the UMTX_DYNAMIC_SHARED define while here, it's unused and
  complex.

  Refactor do_wait so that if we get a signal or timeout AND woken
  up, we forward the wakeup to any other waiters pending to avoid
  a missed wakeup.

In userland:

  Bring over some fixes from DragonFlyBSD for the userland part of
  pthread_condvars, basically relax the consistency on the number of
  waiters and signals pending because it was both too strict and
  incorrect causing lost wakeups.

Reviewed by: davidxu
Approved by: re
MFS r184137 and r184166 from stable/7

Net effect is to add support for building DVD images when the MAKE_DVD
knob is enabled, and enable it for amd64 and i386 architectures.

Approved by:	re (kib)
MFC r183966:
  Some 88E1149 PHY's page select is initialized to point to other
  bank instead of copper/fiber bank which in turn resulted in
  wrong registers were accessed during PHY operation. It is
  believed that page 0 should be used for copper PHY so reinitialize
  E1000_EADR to select default copper PHY.
  This fixes link establishment issue of nfe(4) on Sun Fire X4140.

  OpenBSD also has similimar patch but they just reset the E1000_EADR
  register to page 0. However some Marvell PHYs((88E3082, 88E1000)
  don't have the extended address register and the meaning of the
  register is quite different for each PHY model. So selecting copper
  PHY is limited to 88E1149 PHY which seems to be the only one that
  exhibits link establishment problem. If parent device know the type
  of PHY(either copper or fiber) that information should be notified
  to PHY driver but there is no good way to pass this information yet.

  Reported by:	thompsa
  Reviewed by:	thompsa
  Approved by:	re (gnn)
MFC r184038: Restore mtime *after* restoring ACLs.  Otherwise,
setting the ACL changes the mtime.  (Plus a new test to exercise
basic ACL restore logic.)

PR:		kern/128203
Submitted by:	Udo Schweigert
Approved by:	re (Kostik Belousov)
Adjust package set for 6.4-REL.

Approved by:	re (kib)
MFS r184232:

> MFC r183921 and r184180
> When we notice the INDEX had volume numbers (so the media the packages
> are coming from has multiple volumes) walk through the dependency tree
> for the packages selected by the user once for each volume, only
> installing packages on the current volume.  If we can't install the
> package because its on a higher volume just note that we have looked
> at it during the pass for this volume to cut down on time spent checking
> dependencies.  This stops the excessive disc swapping that users have
> complained (a lot...) about.

Approved by:    re (kib)
MFC: r184227 - don't use *statep without holding the vnode interlock

This change is being merged earlier than originally planned at the request
of the release engineers.

Approved by:    re (kib)
MFC r183979:
 Display usage when pkg_add is called with no arguments.

PR:		bin/121093
Submitted by:	volker
Approved by:	re (kensmith)
MFC r183974:
 Support the remaining options listed in dhcp-options(5) and RFC 2132.

PR:		bin/127076
Submitted by:	jkim
Approved by:	re (kensmith)
MFC r183565:

  Small cleanups to openpty().

  - Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
    consistently on implementations that make the PTY the controlling TTY
    by default.

  - Call unlockpt() before opening the slave device. POSIX mentions that
    de slave device should only be opened after grantpt() and unlockpt()
    have been called.

  - Replace some redundant code by a label.

As a safety net, add a call to revoke() to unlockpt(). All applications
out there use openpty(), explicitly call revoke() or implement their own
PTY allocation routines. Adding the call to unlockpt() won't hurt, but
will prevent foot-shooting.

Reviewed by:	jhb, kib
Approved by:	re
MFH: r184200

	Correct a typo in Nocona core name

Approved by:	re (hrs, kib)