[LIBS] vscreen: Improve escape keys detection

Currently, escape keys were detected when pressed in sequence
and released.

Instead of above the correct method of detecting is when all
escape keys are pressed simulatenously (just like QEMU and other
hypervisors) hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20
[CORE] vmm_manager: Improve use of locks in guest create and destroy

The vmm_manager_guest_create() and vmm_manager_guest_destroy() APIs
depend upon vmm_guest_apace_xxx() APIs which in-turn use sleepable
locks hence we should not call vmm_guest_aspace_xxx() APIs with
"mngr.lock" spinlock held.

This patch fixes above described use of "mngr.lock" in guest create
and destroy APIs.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Ensure that irqs are not disabled when acquiring sleepable lock

This improves sanity checks of APIs acquiring sleepable lock so that
we don't accidentally acquire sleepable lock with irqs disabled.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Handle emulated device endianness via device emulation framework

Currently, each device emulator was taking care for endianness of device
to show to guest. This is not wrong but leads to lot of duplicate code
accross device emulators hence this patch makes device endianness as
an attribute of "struct vmm_emulator" and device emulation framework
does appropriate endianness conversion as required.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20
[LIBS] vtemu: Erase everything on display for new instance

When new VTEMU instance is created, the framebuffer screen may
contain unknown/garbage data hence for sanity we erase everything
on framebuffer.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Save/restore MMU context for long descriptor format

In case of long descriptor format (i.e. MMU LPAE), the TTBR0/1 registers
are 64bit and PRRR/NMRR are treated as MAIR0/1 registers.

This patch ensures that we save/restore MMU context for both short &
long descriptor formats.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Use video memory for CLCD framebuffer when possible

ARM boards typically have dedicated video memory for CLCD hence
use this video memory for screen data when possible.

For now only VExpress-A9 and VExpress-A15 have dedicated video
memory.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20
[ARM] arm32: Don't need to save restore TPIDPRW

The TPIDRW registers always traps when accessed from user mode
for ARMv6 and ARMv7 hence no need to save/restore it.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DOCS] Fix boot cpu check for ARMv7 and ARMv8 boot-wrapper

The MPIDR register of ARMv7 and ARMv8 contains more than 8 bits for
multiple affinity levels hence this patch fixes boot cpu checks in
reference boot-wrapper for ARM fast model and ARM foundation v8 model.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Improve arch_smp_id() to handle multiple affinity levels

Currently, arch_smp_id() implementation for arm32, arm32ve, and arm64
only considers one affinity level when computing logical SMP ID from
MPIDR register.

Recently, there has been quite a few ARM CPUs with multiple affinitly
levels (e.g. ARM big.Little and X-Gene) hence it becomes important for
our arch_smp_id() implementation to consider CPU specific affinity levels.

To handle this, at boot time we do CPU specific computation of logical
SMP ID from MPIDR and save it in special register that is only accessible
to Xvisor. The arch_smp_id() only reads the special register where we have
saved logical SMP ID. The special register for arm32 is TPIDPRW, arm32ve is
HTPIDRW, and arm64 is TPIDRW_EL2.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARCH] ARM: Update Sun7i defconfig

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[ARCH) ARM: Add early debug for Sun7i

This breaks other arm32ve platforms

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Merge remote-tracking branch 'upstream/master' into A20

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>

Conflicts:
	arch/arm/cpu/openconf.cfg