xen: Relocate mem_access and mem_event into common.

In preparation to add support for ARM LPAE mem_event, relocate mem_access
and mem_event into common Xen code. This patch makes no functional changes
to the X86 side, for ARM mem_event and mem_access functions are just
placeholder stubs.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/mem_event: Clean out superflous white-spaces

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/arm: Enable the compilation of mem_access and mem_event on ARM.

This patch sets up the infrastructure to support mem_access and mem_event
 on ARM and turns on compilation. We define the required XSM functions,
handling of domctl copyback, and the required p2m types and stub-functions
in this patch.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
tools/libxc: Allocate magic page for mem access on ARM

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/arm: Data abort exception (R/W) mem_events.

This patch replaces the stub p2m functions with the actual ones required to
store, set, check and deliver LPAE R/W mem_events. As the LPAE PTE lacks
available bits to store the p2m_access_t bits, we use a separate radix
tree (mem_access_settings) to store the permissions with the key being the
gfn.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/arm: Instruction prefetch abort (X) mem_event handling

Add missing structure definition for iabt and update the trap handling
mechanism to only inject the exception if the mem_access checker
decides to do so.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
tools/tests: Enable xen-access on ARM

On ARM the guest memory doesn't start from 0, thus we include the
required headers and define GUEST_RAM_BASE_PFN in both architecture
to be passed to mem_access as the starting pfn.
We also define the ARM specific test_and_set_bit function.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
debug