arm: Rearrange brackets in the fault cause detection

Place the brackets correctly in order to see course of the conditions
instantaneously.
arm: Port main functionality of the new PV entry allocator from amd64/i386/mips

PV entries are now roughly half the size.
Instead of using a shared UMA zone for 28 byte pv entries (two 8-byte tailq
nodes, a 4 byte pointer, a 4 byte address and 4 byte flags), we allocate a page
at a time per process. This provides 252 pv entries per process (actually, per
pmap address space) and eliminates one of the 8-byte tailq entries since
we now can track per-process pv entries implicitly.
The pointer to the pmap can be eliminated by doing address arithmetic to find
the metadata on the page headers to find a single pointer shared by all 252
entries. There is an 11-int bitmap for the freelist of those 252 entries.

Currently page reclamation is not yet supported. This means that once vm_page
for a new pv_chunk is allocated and wired in pmap_get_pv_entry() it will remain
resident in kernel map for good. In a serious low memory condition, when there
will be no spare pages for the new pv_chunks, kernel will not recover.
arm: Add pv_entry/pv_chunk related statistics to pmap

Access pv_entry/pv_chunk statistics via sysctl vm.pmap
arm: Port PTE freelist of KVA allocation and maintenance from i386

Using an idea from Stephan Uphoff, use the empty pte's that correspond
to the unused kva in the pv memory block to thread a freelist through.
This allows us to free pages that used to be used for pv entry chunks
since we can now track holes in the kva memory block.

Idea from:  ups
arm: Reclaim pv_entry when we are in a serious low memory condition.

Free some pages so that allocation of another pv_chunk could be possible.
arm: Apply post review fixes to the PV entry allocator.

Fix issues pointed out by Alan Cox:

- Change pc_map type to uint32_t, use optimized for ARM ffs() instead of ffsl()
  function.
- Remove redundant entries from pc_map in order to avoid unnecessary
  iterations in some of the pv allocator functions. Add pc_dummy array instead
  to round pv_chunk size to PAGE_SIZE.
- Remove redundant PTE_SYNCs in ptelist - related functions.
- Print message about approaching the limit of pv_entries unconditionally
- Style improvements
arm: Avoid redundant clearing of the PGA_WRITABLE flag after pmap_nuke_pv()

On pv_entry removal in pmap_nuke_pv(), all corresponding  pv_entries related to
specified vm_page are being checked for write permission and PGA_WRITABLE flag
is cleared if there are no writable mappings or no pv_entries left.
Hence, additional PGA_WRITABLE flag clearing is not necessary.
arm: Use pmap_find_pv if needed instead of multiplying its code throughout pmap.
arm: Switch to AP[2:1] access permissions model. Store "referenced" bit in PTE.

Enable Access Flag in CPU control. With AF enabled each valid mapping needs to
have referenced bit in PTE set in order to be able to cache it in the TLB.

AP[0] bit is to be used as reference flag.
All access permissions are encoded by AP[2:1] wherein AP[1] is in fact
"user enable" and AP[2](APX) is "write disable".

All mappings are always set to be valid. Reference emulation is performed by
setting/clearing reference flag in PTE.

md.pvh_attrs are no longer necessary however pv_flags are still being used for
now.

Marking vm_page as "dirty" or "referenced" is being performed on:
- page or flag fault servicing in pmap_fault_fixup(), basing on the fault type
- vm_fault servicing in pmap_enter() according to the desired protections
  and faulty access type
Redundant page marking has been removed as on ARM we know exactly when the
particular page is referenced or is going to be written.
arm: Unify naming in pmap-v6.c and improve style

Use naming common for whole pmap and compatible with other pmaps:
pm   -> pmap
pg   -> m
opg  -> om
*pt  -> *ptep
*pte -> *ptep
*pde -> *pdep

Improve style where possible.
arm: Get rid of VERBOSE_INIT_ARM option

This "NetBSDism" won't actually work on FreeBSD as the console is being
initialized after pmap preliminary setup.
On the other hand, drivers that were using VERBOSE_INIT_ARM for debug purposes
are not part of or are not called in initarm() so the option is misused.
In such cases exchange VERBOSE_INIT_ARM to debug printf (DPRINTF) and delete
all other useless VERBOSE_INIT_ARM ifdefs.
arm: Avoid possible NULL pointer dereference in pmap_enter_locked()

When trying to get m->md.pv_memattr, make sure that m != NULL,
in particular that vector_page is set to be NULL.
arm: Do not set PGA_REFERENCED flag in pmap_enter_pv()

On ARM any new page reference will result in either entering the new mapping by
calling pmap_enter, etc. or fixing-up the existing mapping in
pmap_fault_fixup().
Therefore we set PGA_REFERENCED flag in the earlier mentioned cases and
setting it later in pmap_enter_pv() is just waste of cycles.
arm: Stop using PVF_MOD, PVF_REF & PVF_EXEC flags in pv_entry. Use PTE instead.

Using PVF_MOD, PVF_REF and PVF_EXEC is redundant as we can get the proper info
from PTE bits.
When the mapping is marked as executable and has been referenced we assume that
is has been executed. Similarly, when the mapping is set to be writable and is
referenced, it must have been due to write access to it.
PVF_MOD and PVF_REF flags are kept just for pmap_clearbit() usage, to pass the
information about which bit should be cleared.
arm: Rework and organize pmap_enter_locked() function.

pmap_enter_locked() implementation was very ambiguous and confuzing.
Rearrange it so that each part of the mapping creation is separated.
Avoid walking through the redundant conditions.
Extract vecor_page specific PTE setup from normal PTE setting.
arm: Fix pmap compilation for ARMv < 6

As both ARM pmap.c and pmap-v6.c use the same header and pv_entry, pmap and
md_page structures are different, it was needed to separate code designed for
ARMv6/7 from the one for other ARMs.
arm: Delete unused pm_pdir pointer from the pmap structure.