Set CR4.OSFXSR before probing the mxcsr mask

This fixes Bug #2691

Reported-By: Antonio Huete Jiménez <tuxillo@quantumachine.net>
build - Add additional CFLAGS

* Add additional CFLAGS that are expected to be needed in later revs
  of the compiler.  These are not needed at the moment.
kernel - Move CPUMASK_LOCK out of the cpumask_t

* Add cpulock_t (a 32-bit integer on all platforms) and implement
  CPULOCK_EXCL as well as space for a counter.

* Break-out CPUMASK_LOCK, add a new field to the pmap (pm_active_lock)
  and do the process vmm (p_vmm_cpulock) and implement the mmu interlock
  there.

  The VMM subsystem uses additional bits in cpulock_t as a mask counter
  for implementing its interlock.

  The PMAP subsystem just uses the CPULOCK_EXCL bit in pm_active_lock for
  its own interlock.

* Max cpus on 64-bit systems is now 64 instead of 63.

* cpumask_t is now just a pure cpu mask and no longer requires all-or-none
  atomic ops, just normal bit-for-bit atomic ops.  This will allow us to
  hopefully extend it past the 64-cpu limit soon.
kernel/acpica: Add tunables for editing the _OSI string list.

ACPICA has a built-in list of supported _OSI strings. A query on any of
those strings returns TRUE. It is meant to help the ASL code determine
which OS it is dealing with. See AcpiDefaultSupportedInterfaces[] in
utosi.c for the full list.

This commit adds two tunables, hw.acpi.{install,remove}_interface,
for adding to and removing from that list. Their contents are comma
separated and leading white space is ignored.

Examples:

# Add "FreeBSD" to the list of supported _OSI strings,
# i.e. _OSI("FreeBSD") from ASL will return TRUE.
#
hw.acpi.install_interface="FreeBSD"

# Remove "Windows 2000" and "Windows 2001" from the list
# of supported _OSI strings, i.e. _OSI("Windows 2000") and
# _OSI("Windows 2001") from ASL will return FALSE.
#
hw.acpi.remove_interface="Windows 2000, Windows 2001"

Taken-from: FreeBSD
kernel/acpi: Stop installing default address space handlers explicitly.

Since ACPICA 20040427 this is no longer necessary since it is part of
AcpiEnableSubsystem(). It is not supported and has led to problems.

See http://svnweb.freebsd.org/base?view=revision&revision=212993
libc - change SEM_VALUE_MAX

sem_getvalue(3) requires a signed int count so change SEM_VALUE_MAX to INT_MAX.

Reviewed-by: joris@giovannangeli.fr
libc - bail out on invalid sem_open(3) flags

Preventing now callers from passing invalid flags prevents compatibility
issue should new flags be added to sem_open(3) in future standard
revisions.

Reviewed-by: joris@giovannangeli.fr
add posix semaphore test suite

Port FreeBSD test suite, remove tests specific to FreeBSD
implementation, and modify tests that do not comply with the standard.

A next step could be to integrate this test in dfregress(8).

Obtained-from:   FreeBSD
Reviewed-by: joris@giovannangeli.fr
kernel - Fix bug in cdev_pager_allocate() that was messing up gem/ttm

* cdev_pager_allocate() was assuming that the passed vm_object handle
  was a cdev_t and populating a field in it, but that is not always the case.
  Fix the case.

* This solves RBTREE corruption in drm/ttm.

Reported-by: Joris Giovannangeli
inet: Make ip fragments reassemble queue per-cpu and lockless MPSAFE
kernel/acpi: Use device_printf() in a few places.
kernel: make pktinfo and cpuid native to ip_input()

In order to remove ether_input_pkt(), switch the prototype
of if_input() and adjust all callers.  While there, consolidate
the style of the invoke.

Suggested and reviewed by: sephe
kernel: switch newer drivers back to if_input()

Restore the if_input() invoke.  This is needed to reenable
tapping into if_input through drivers like netmap(4).

Reviewed by: sephe
kernel - Fix several taskqueue livelocks

* Taskqueue was trying to issue callout_*() operations with a spin-lock
  held on callouts associated with other cpus.  This can livelock the
  system.

* Unlock the taskqueue spinlock when messing with callout_*() operations.

* Fixes an indefinite spin lock panic from drm/ttm.
dmesg - Add -ff feature

* Add a feature whereby if -f is specified twice (-ff), dmesg will
  not sleep() in its monitoring loop and will instead live loop.
  This feature is intended only to help debug crashing kernel situations
  and should not be used for normal dmesg monitoring.
kernel - add vm_contig_avail_pages() API

* Add a function which DRM can query to determine how much more-easily-DMAd
  memory is available from our contiguous memmory pool, instead of assuming
  that it can gobble all 4GB of 'low' memory before it tries to swap.

* This memory is typically set in /boot/loader.conf, like this:

  vm.dma_reserved=256m

  The default is ~16MB at the moment so users will generally want to increase
  it.
kernel: remove layer of indirection for ether_input()

Mop up after the recent changes by pulling the old switcheroo
on ether_input_pkt(), effectively renaming the function to
ether_input().  Also updates comments accordingly.
kernel - Fix PF tables (SMP work)

* SMP work broke pf_table.c to some degree due to the use of globals
  to store temporary data.  The concurrency could cause table lookups
  to return an incorrect match or mismatch.

* Change pfr_sin, pfr_sin6, and pfr_mask to local variables.
kernel: Fix some -Wundef warnings.
drm/ttm: convert rb_tree back to tree(3) and fix a few races

 * remove the linux compat rbtree for now and use tree(3)

 * change a few locks not converted from freebsd porting

 * check that the refcount is still 0 before destroying the object after
   acquiring the lock, because we might have raced another ref.