EHCI's shutdown code was killing the chipset without first killing the
interrupt, and it was also handing EHCI back to the BIOS without first
waiting for the shutdown reset to complete. Either can lock the machine

EHCI's shutdown code was killing the chipset without first killing the
interrupt, and it was also handing EHCI back to the BIOS without first
waiting for the shutdown reset to complete. Either can lock the machine
up on shutdown/reboot.

If the DOS slice field is found to be maxed out (0xFFFFFFFFU), use the
actual media size for calculations instead of ds_size. This allows
disks > 2TB to have a conventional slice table and still contain a
disklabel64 which covers the actual size of the media.

The original code extracts logical_cpus directly from the output of
cpuid(eax=1), however,
According to Intel's #253668, section 7.7
"(CPUID.1:EBX[23:16]) -- Indicates the maximum number of addressable
ID for logical processors in a physical package."
According to AMD's #25481 CPUID Fn0000_0001_EBX
"LogicalProcessorCount is the number of threads per CPU core times the
number of CPU cores per processor."

So what we originally saved in logical_cpus is actually the upper limit
of the logical CPUs per phyical CPU package. It may work correctly if
there is only one logical CPU per physical CPU package detected in MP
table. But if more than one logical CPUs per phyical CPU package are
detected in the MP table, then the missing logical CPUs will not be
detected later, since the code assumed that logical_cpus is the number
of logical CPUs missed between two detected logical CPUs.

We try to fix the problem by calculating the distances between two nearest
APIC IDs. If all such distances for all detect logical CPUs are same,
then the logical_cpus is set the calculated distance. The value extracted
from cpuid(eax=1) just serves as the upper limit of the logical_cpus now.

* The -D option with one number now means use the normal background color.
* Don't change permissions on history file if it is not a regular file.
* Fix non-ANSI-compliant code that caused problems with some compilers.
* Fix binary file detection in UTF-8 mode.
* Fix display problems with long lines on "ignaw" terminals.
* Fix problem interrupting the line number calculation for initial prompt.
* Fix SGR emulation when dealing with multiple attributes (eg.
bold+underline).
* Fix highlight bug when searching for underlined/overstruck text.
* New "&" command allows filtering of lines based on a pattern.
* Status column now displays a search match, even if the matched string is
scrolled off screen because -S is in effect.
* Improve behavior of -F option.
* Allow CSI character (0x9B) to work in UTF-8 mode.
* Output carriage return at startup in case terminal doesn't default to
column 1.
* Fix bug in '' (quote, quote) command after G command.

* Change the syscall stub branch orders so that the static branch
prediction will assume that syscalls will succeed rather than fail.

* Add error handling for PSEUDO syscalls.

* Add END() macros for Assembler code. This causes the symbol
table to include the size of the function.

* ldexp: Fix a typo in the !__GNUC__ case and remove an obsolete
comment.

* setjmp/longjmp changes:
-Save and restore the control part of the MXCSR in addition to the
i387 control word to ensure that the two are consistent.
-Don't clobber the FPU exception flags in longjmp. C99 requires them
to remain unchanged.

Change hammer_create_inode() and hammer_alloc_objid() to take the upper
10 bits of the filename hash and attempt to use them as the lower 10 bits
of the inode number.

hammer_alloc_objid() now utilizes a small two-level 1024-bit bitmap to
assign the low 10 bits of the inode number, on a per-directory basis.
If a collision occurs a nearby value is used instead.

The idea is for inode numbers to have approximately the same linearity
as the directory read scan order, so programs such as cpio, tar, cpdup,
find, and ls which do recursive scans of the directory tree get much
better locality of reference for stat() and other related system calls.

cpdup - Do not create a .tmp file and rename if the target does not exist.

* When copying if the target does not exist use the target's actual name
instead of the name of a temporary file.

This helps filesystems (aka HAMMER) which use hashed directories. Inode
numbers can be selected by the FS on the basis of the file-name in
order to maintain directory-order linearity. If the copy program creates
the target file with one name and then renames it to the real name,
however, the feature is lost and we get one big scramble again.

* This release changes the default cipher order to prefer the AES CTR
modes and the revised "arcfour256" mode to CBC mode ciphers that are
susceptible to CPNI-957037 "Plaintext Recovery Attack Against SSH".

* This release also adds countermeasures to mitigate CPNI-957037-style
attacks against the SSH protocol's use of CBC-mode ciphers. Upon
detection of an invalid packet length or Message Authentication
Code, ssh/sshd will continue reading up to the maximum supported
packet length rather than immediately terminating the connection.
This eliminates most of the known differences in behaviour that
leaked information about the plaintext of injected data which formed
the basis of this attack. We believe that these attacks are rendered
infeasible by these changes.

New features:

* Added a -y option to ssh(1) to force logging to syslog rather than
stderr, which is useful when running daemonised (ssh -f)

* The sshd_config(5) ForceCommand directive now accepts commandline
arguments for the internal-sftp server.

* Repair a ssh(1) crash introduced in openssh-5.1 when the client is
sent a zero-length banner (bz#1496)

* Due to interoperability problems with certain
broken SSH implementations, the eow@openssh.com and
no-more-sessions@openssh.com protocol extensions are now only sent
to peers that identify themselves as OpenSSH.

* Make ssh(1) send the correct channel number for
SSH2_MSG_CHANNEL_SUCCESS and SSH2_MSG_CHANNEL_FAILURE messages to
avoid triggering 'Non-public channel' error messages on sshd(8) in
openssh-5.1.

* Avoid printing 'Non-public channel' warnings in sshd(8), since the
ssh(1) has sent incorrect channel numbers since ~2004 (this reverts
a behaviour introduced in openssh-5.1).

* HAMMER now calls a new kernel function, lwkt_user_yield(), in its
ioctl-based loops (such as the reblocker).

* Add a new LWKT function called lwkt_user_yield(). This function
causes a kernel thread to yield at user priority (instead of kernel
priority).

This function also deals with a nasty issue related to the MP lock.
A cpu-bound kernel thread holding the MP lock can prevent other
cpus from serving interrupt threads which also need the MP lock.
Detect the condition and release the MP lock for 10uS to give the
other cpus a chance to pick it up. This is a bad hack but it
actually does work.

* Move passive_release() from MD code to kern/lwkt_thread.c and add
an inline for the passive release recovery function. Adjust all
platforms to use the new API instead of rolling the same code for
each platform.