MFV r261619:

4574 get_clones_stat does not call zap_count in non-debug kernel

zap_count(...) is never called in non-DEBUG kernel.
As result "count" variable is always 0, and "goto fail" is always
reached.  This means get_clones_stat function never makes up list
of clones for "clones" properties.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261620 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a counter to differentiate between VM-exits due to nested paging faults
and instruction emulation faults.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261621 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove never set flag FL_OVERWRITE. The only place where
it was checked led to lock/critnest leak.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261627 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert accidentially leaked changes in r261627.


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

Submitted by:    Jason McIntyre <jmc@kerhand.co.uk>
                 Thomas Klausner <wiz@netbsd.org>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261633 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
mdoc: minor paragraph fixes.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
init: Remove code to track line numbers in /etc/ttys.

The tracking generated warnings when the line number of an existing tty in
/etc/ttys changed, which would corrupt utmp (as it was indexed by the line
number). With utmpx, the line number no longer matters, so the tracking is
no longer needed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and
XSAVE-enabled features like AVX.
- Store a per-cpu guest xcr0 register.  When switching to the guest FPU
  state, switch to the guest xcr0 value.  Note that the guest FPU state is
  saved and restored using the host's xcr0 value and xcr0 is saved/restored
  "inside" of saving/restoring the guest FPU state.
- Handle VM exits for the xsetbv instruction by updating the guest xcr0.
- Expose the XSAVE feature to the guest only if the host has enabled XSAVE,
  and only advertise XSAVE features enabled by the host to the guest.
  This ensures that the guest will only adjust FPU state that is a subset
  of the guest FPU state saved and restored by the host.

Reviewed by:	grehan


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261638 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add drivers for:
- Enhanced Direct Memory Access Controller (eDMA)
- Direct Memory Access Multiplexer (DMAMUX)


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


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261640 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove ft_rtalloc and choose rtalloc function at compile time.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the ARM_USE_SMALL_ALLOC option and code related to it.

This was an optimization used only by a few xscale platforms.  Part of
the optimization was to create a direct map for all physical pages, and
that resulted in making multiple mappings of pages in a way that bypassed
the logic in pmap.c to handle VIVT cache aliasing.  It also just generally
made the code more complex and hard to maintain for all SoCs.

Reviewed by:	cognet


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261642 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Consolidate code related to setting up physical memory configuration into
a new physmem.c file.  The new code provides helper routines that can be
used by legacy SoCs and newer FDT-based systems.  There are routines to
add one or more regions of physically contiguous ram, and exclude one or
more physically contiguous regions of ram.  Ram can be excluded from crash
dumps, from being given over to the vm system for allocation management,
or both.  After all the included and excluded regions have been added,
arm_physmem_init_kernel_globals() processes the regions into the global
dump_avail and phys_avail arrays and realmem and physmem variables that
communicate memory configuration to the rest of the kernel.

Convert all existing SoCs to use the new helper code.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Replace compile-time constant KERNPHYSADDR with abp_physaddr (determined
at runtime) where it's trivial to do so.  Another breadcrumb on the trail
to a kernel that can be loaded at any 1MB boundary.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't call vm_fault_prefault() on zero-fill faults.  It's a waste of time.
Successful prefaults after a zero-fill fault are extremely rare.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261647 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Calculate the kernel's load address from the PC in the elf / gzip
trampoline instead of relying on KERNPHYSADDR as a compile-time constant.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
It turns out a global variable is the only straightforward way to
communicate the kernel's physical load address from where it's known in
initarm() into cpu_mp_start() which is called from non-arm code and
takes no parameters.

This adds the global variable and ensures that all the various copies
of initarm() set it.  It uses the variable in cpu_mp_start(), eliminating
the last uses of KERNPHYSADDR outside of locore.S (where we can now
calculate it instead of relying on the constant).


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261649 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fixup for r261590 (vnet sysctl handlers cleanup).

Reviewed by:	glebius


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the now unused MMU_INIT macro.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@261651 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Refer newfs and growfs users to fsck_ffs instead of
fsck, the latter does not accept the referred to "-b" flag.

This change was accidently committed directly to 9-STABLE in
r237505.

PR:		82720
Submitted by:	David D.W. Downey
MFC after:	1 week


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