Tighten default restrictions for ntpd(8) server and provide a link
to NTP access restriction documentation.

The new default restrictions would allow only time queries from a
remote system and will KoD all other requests, but still allow
localhost to do make all requests.

These restrictions are also recommended for all Internet-facing
public NTP servers.

This changeset is intended for an instant MFC to stable/10 and
releng/10.0.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259973 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Modify handling of writes to the vlapic LVT registers.

The handler is now called after the register value is updated in the virtual
APIC page. This will make it easier to handle APIC-write VM-exits with APIC
register virtualization turned on.

This also implies that we need to keep a snapshot of the last value written
to a LVT register. We can no longer rely on the LVT registers in the APIC
page to be "clean" because the guest can write anything to it before the
hypervisor has had a chance to sanitize it.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259978 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct the description of the V state, which indicates that the process'
parent is suspended, not the process itself.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259995 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use pthread_once() to replace a static integer initted flag.

Reviewed by:	neel


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259997 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Extend the ACPI power management support to wire a virtual power button up
to SIGTERM when ACPI is enabled.  Sending SIGTERM to the hypervisor when an
ACPI-aware OS is running will now trigger a soft-off allowing for a graceful
shutdown of the guest.
- Move constants for ACPI-related registers to acpi.h.
- Implement an SMI_CMD register with commands to enable and disable ACPI.
  Currently the only change when ACPI is enabled is to enable the virtual
  power button via SIGTERM.
- Implement a fixed-feature power button when ACPI is enabled by asserting
  PWRBTN_STS in PM1_EVT when SIGTERM is received.
- Add support for EVFILT_SIGNAL events to mevent.
- Implement support for the ACPI system command interrupt (SCI) and assert
  it when needed based on the values in PM1_EVT.  Mark the SCI as active-low
  and level triggered in the MADT and MP Table.
- Mark PCI interrupts in the MP Table as active-low in addition to level
  triggered.

Reviewed by:	neel


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259998 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFp4 alc_popmap
  Change the way that reservations keep track of which pages are in use.
  Instead of using the page's PG_CACHED and PG_FREE flags, maintain a bit
  vector within the reservation.  This approach has a couple benefits.
  First, it makes breaking reservations much cheaper because there are
  fewer cache misses to identify the unused pages.  Second, it is a pre-
  requisite for supporting two or more reservation sizes.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@259999 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the Intel 6150 support.

This chip doesn't require the temperature sensor offset, either v1 or
v2.  Doing so causes the initial calibration test to fail.

Tested:

* Intel Centrino 6150


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260001 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In libiconv_modules, surround unused static _citrus_XXX_pack_state() and
_citrus_XXX_unpack_state() functions with #if 0, for now.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260003 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a virt_foreach() that does the same as what phys_foreach() does and
change virt_size(), virt_dumphdrs() and virt_dumpdata() into its callback
functions.
In virt_foreach() we iterate over all the virtual memory regions that we
want in the minidump. For now, just start with the PBVM (= kernel text
and data plus preloaded modules). The core file this produces can already
be used to work out the libkvm changes that need to be made to support it.
In parallel, we can flesh out the in-kernel bits to dump more of what we
need in a minidump without changing the core file structure.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260009 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bump __FreeBSD_version for r259951 - Don't coalesce entries in
vm_map_stack().


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
gcc: Add support for label attributes and "unavailable" attribute.

Apple GCC has extensions to support for both label attributes and
an "unavailable" attribute. These are critical for objc but are
also useful in regular C/C++.

Apparently at least the label attributes might have found their way to
upstream GCC but the code doesn't seem available on the GPLv2 tree so
we are taking the code directly from Apple. To make this clearer we
are preserving the annoying "APPLE LOCAL" tags and the ChangeLogs
when they are available.

Obtained from:	Apple GCC 4.2 - 5531
MFC after:	3 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260014 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by
adding a __libcpp prefix to the applicable identifiers.

Upstream is still debating about this, but we need it now, to be able to
import clang 3.4.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260015 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove superfluous old-style rcsid[] from if_sk.c.  There is already an
__FBSDID() at the top of the file.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Mark unused static inline functions defined by the PCTRIE_DEFINE() macro
as __unused, so warnings about them are avoided.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
For some files under sys/dev/drm2/i915, turn off warnings about unused
functions and variables, since they are contributed code.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260019 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
For sys/dev/drm2/radeon, only use -fms-extensions with gcc.  This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do.  For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260020 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix cross-compilation of ia64 target code with clang.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260021 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow building a cross libkvm by setting TARGET_ARCH. The library so
produced will be called libkvm-${ARCH} instead of libkvm. This allows
installing it alongside the native version.
For symbol lookups, use ps_pglobal_lookup() instead of __fdnlist()
when building a cross libkvm. It is assumed that the cross tool that
uses the cross libkvm also provides an implementation for this
proc_services function.

Note that this commit does not change any of the architecture-specific
code for cross-compilation.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260022 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow building a cross libkvm for ia64.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Disable warning about unused functions for ar9300_reset.c for now.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@260025 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f