xen/mem_event: Cleanup of mem_event structures

The public mem_event structures used to communicate with helper applications via
shared rings have been are used in different settings. However, the variable names
within this structure have not reflected this fact, resulting in the reuse of
variables to mean different things under different scenarios.

This patch remedies the issue by clearly defining the structure members based on
the actual context within which the structure is used.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/mem_event: Rename the mem_event ring from 'access' to 'monitor'

The name of the ring still implies it is used only for memory accesses,
which is no longer the case. It is also used to deliver variuos HVM events,
thus the name "monitor" is more appropriate in this setting.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/mem_paging: Convert mem_event_op to mem_paging_op

The only use-case of the mem_event_op structure had been in mem_paging,
thus renaming the structure mem_paging_op and relocating its associated
functions clarifies its actual usage.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
x86/hvm: rename hvm_memory_event_* functions to hvm_event_*

The function names currently imply that these events are to be delivered via
the memory_event subsystem. However, the naming is confusing as these events
have nothing to do with actual memory events. Simply naming these functions
hvm_event_* more accurately describe their usage.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/mem_event: Rename mem_event to vm_event

The mem_event system has originally been used to deliver memory event
related information to helper programs located in a domain. However,
the usage of this sub-system have since been expanded to include non-memory
related events as well, such as register changes, debugging and singlestepping.
Therefore, renaming the system "vm_event" more accurately describes the actual
usage of the subsystem.

In this patch I also clear up the ambiguities that resulted from the interchanged
mem_event and mem_access terminology.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
tools/tests: Remove superfluous and incomplete spinlock from xen-access

The spin-lock implementation in the xen-access test program is been implemented
in a fashion that is actually incomplete. The x86 assembly that guarantees that
the lock is held by only one thread lacks the "lock;" instruction.

However, the spin-lock is not actually necessary in xen-access as it is not
multithreaded. The presence of the faulty implementation of the lock in a non-
mulithreaded environment is very confusing for developers who are trying to
follow this code as a guide in implementing their own applications. Thus,
removing it from the code improves the clarity on the behavior of the system.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
xen/vm_event: Decouple vm_event and mem_access.

The vm_event subsystem has been artifically tied to the presence of mem_access.
While mem_access does depend on vm_event, vm_event is an entirely independent
subsystem that can be used for arbitrary function-offloading to helper apps in
domains. This patch removes the dependency that mem_access needs to be supported
in order to enable vm_event.

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