[TESTS] Improve guest image loading in basic firmware

It might happen that we are running Basic firmware after a reboot
from guest Linux in which case both I-Cache and D-Cache will have
stale contents. We need to cleanup these stale contents while loading
guest images so that guest Linux sees correct contents in guest RAM
even after MMU ON. To handle this issue, we clean & invalidate portion
of guest RAM where we are going to load a guest image before copying
guest image to guest RAM.

Further, Linux ARM/ARM64 kernel expects us to boot from 0x8000 (or
0x80000 aligned address, perferrably RAM start + 0x8000 (or 0x80000)
address. The 0x8000 (or 0x80000) bytes above kernel start address is
used by Linux ARM/ARM64 kernel to setup boot page tables. If we are
running Basic firmware after a reboot from guest Linux then both
I-Cache and D-Cache will have stale contents. If we don't cleanup
these stale contents then Linux kernel will not see correct contents
of boot page tables after MMU ON. To take care of this issue, we nuke
the area where guest Linux will setup boot page tables before jumping
into guest Linux kernel.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20
[LIBS] Add red black tree APIs

Balanced binary tree (or Red Black tree) can be very useful in
implementing O(log n) in all parts of Xvisor where we can represent
data as binary search tree.
(Refer, http://en.wikipedia.org/wiki/Rbtree)

This patch ports linux red black tree APIs to libs/common.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Add device_type functionality in vmm_device

This patch adds the device_type functionality. This is required by
framework like USB etc. The patch also does some cleanup in device-tree
framework.

Signed-off-by: Ankit Jindal <thatsjindal@gmail.com>
[DRIVERS] Define the device_type to vmm_device_type

This patch defines  device_type to vmm_device_type for compatibility
with linux.

Signed-off-by: Ankit Jindal <thatsjindal@gmail.com>
Merge remote-tracking branch 'upstream/master' into A20
[LIBS] Add list_is_first() to list APIs

Its quite common to check whether given list node is first or last.

We already have list_is_last() API but we don't have list_is_first().

This patch adds list_is_first() to list APIs.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20