[x86] Add guest copy of control registers

o Add control registers for guest.
o Update the guest copy on CRn r/w.
o Update CPU registers accordingly.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Auto-creation of guest in DTS.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Switch the debug and regular interrupt stack.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Fix guest virtual to physical and add other sibling

o Fixes the guest virtual to physical function.
o Add guest physical to host physical address.
o Some documentation around it.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Use the new guest virtual to physical family of functions.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Reload TSS after VMExit

On vmexit, CPU doesn't reload the host TR back.
It is required because in LM mode its required and
in addition to that we use it for multiple interrupt
stacks.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[DRIVERS] video: Remove unnecessary #ifdef from amba-clcd driver

We don't require any #ifdef for Versatile CLCD (i.e. modified PL110)
in amba-clcd driver instead we can use device tree compatible string
to distinguish Versatile CLCD.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Rename versatile_clcd_setup() to versatile_clcd_setup_dma()

We will be soon having CLCD support for Versatile platform which
would require us to define separate versatile_clcd_setup() for
Versatile platform.

This patch rename versatile_clcd_setup() to versatile_clcd_setup_dma()
so that it is easy for us to define separate versatile_clcd_setup()
for Versatile platform.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Add dummy clocks for Versatile platform

The CLCD driver requires oscillator based clock on Versatile platform
hence this patch adds dummy clocks for Versatile platform.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Add CLCD support for Versatile platform

This patch add CLCD platform data for Versatile platform.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge x86-next from https://github.com/hschauhan/xvisor-x86_64
[ARM] generic: Add DTS file for two VExpress-A15 guests on VExpress-A15 host

There is lot of interest in having more than one instance of VExpress-A15
guests hence this patch adds an example DTS for having two pre-configured
VExpress-A15 guests on VExpress-A15 host.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Fix HTCR and VTCR programing

Currently, we did not explicitly clear crucial fields of HTCR
and VTCR before re-programing new values in them.

This patch improves and fixes HTCR and VTCR programing. We also
update HTCR and VTCR programing to ensure cacheable + write-back
translation table walks for hypervisor stage1 and stage2.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] include: Fixing ioreadxx and iowritexx functions.

Making ioreadxx and iowritexx functions behave as a linux like functions.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] New driver support for GPIO And Pinctrl devices.

This patch has:
- Initial version of GPIO and Pin control device driver support.
- Ported from linux's code inside drivers/gpio and drivers/pinctrl
- GPIO base layer code farely completely ported from linux.
- Pinctrl will need more code porting from linux.
- This is an experimental code and will get improved over time.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[CORE] vmm_heap: Adding allocation size retrival functions.

This patch adds:

vmm_alloc_size() and vmm_dma_alloc_size() functions to retrive allocation
size of alloced memory when required later.

This patch also adds linux like api of ksize() using vmm_alloc_size().
ksize() assumes that you are asking a size of a normal memory
and not dma memory which was allocated.
For dma memory one can directly call vmm_dma_alloc_size()

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[ARM] arm64: Cleanup TCR_EL2 and VTCR_EL2 programming

This patch makes TCR_EL2 and VTCR_EL2 programming less cryptic
(i.e. more readable) by introducing more #define for field values.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Add more DTS files for Foundation-v8 model

This patch add more example DTS files for Foundation-v8 model to have
multiple pre-configured guests.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DOCS] Update arm docs to reflect DTB based booting for Xvisor

We have moved to DTB based booting for almost all arm32, arm32ve,
and arm64 boards hence this patch updates all relevant arm docs
which did not reflect this.

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] buddy: Fix potential race in buddy_mem_free() & buddy_mem_partial_free()

Both buddy_mem_free() and buddy_mem_partial_free() first find a
buddy_area from alloc tree and then delete it from alloc tree.
On a SMP host, buddy_mem_free() and buddy_mem_partial_free() can
be called simultaneously from different host CPUs hence find and
delete of buddy_area has to be single operation protected by lock.

This patch makes find & delete buddy_area in buddy_mem_free() and
buddy_mem_partial_free() as single operation protected by alloc_lock.

Signed-off-by: Anup Patel <anup@brainfault.org>