[LIBS] rbtree: Fix compilation warnings for arm64 host

The aarch64 (or arm64) complains on usage of __always_inline (i.e.
force inline attribute) for rbtree functions (don't know why?).

To take care of the warnings, we simply replace __always_inline
with inline.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: arm64: Set TEXT_BASE to 0x10000000

Currently, we use 0x00000000 as TEXT_BASE for arm32ve and arm64
ports. This means all Xvisor virtual address (i.e. VAPOOL) for
arm32ve and arm64 will start at 0x00000000. In other words,
0x00000000 will be a valid address when TEXT_BASE is 0x00000000
hence any buggy code accessing NULL pointers will corrupt Xvisor
code.

Ideally, any NULL pointer access by buggy code should be trapped
so that we can dump register state & stack trace for debugging.

This patch sets TEXT_BASE to 0x10000000 (i.e. skipping first
256MB of virtual addresses) so that we get data abort when some
buddy code tries to access virtual address between 0x00000000 to
0x10000000.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] net: Minor bug fix in netswitch_bh_ring_port_flush()

Always check xfer pointer obtained from per-CPU xfer ring
before accessing it to avoid potential NULL pointer access.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Minor bug fix in _clk_register()

The clk->num_parents can be 0 for clocks with no parent clocks
so clk->parent_names can very well be NULL for such clocks.

We should only check clk->parent_names to be not NULL for
clk->num_parents > 0.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DOCS] Add uart initialization to boot-wrapper for early prints

This patch improves Foundation v8 boot-wraper and ARM Fast Model
boot-wapper to support defterm early prints on Model.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devtree: Allow node attributes with NULL value

Node attributes with NULL value can be very handy to represent
boolean FDT attributes. In other words, for boolean node attributes
we add attribute with NULL value to indicate that attribute is
available and we delete the attribtue to indicate that attribute
is not available.

Signed-off-by: Anup Patel <anup@brainfault.org>
[COMMANDS] devtree: Print boolean node attributes differently

Currently, boolean attribute "abc" of node "xyz" was printed
as:

xyz {
	abc = <>;
};

This patch makes devtree command print boolean attribute as:

xyz {
	abc;
};

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] libfdt: Set NULL value for boolean attributes

We don't need to alocate dummy memory for boolean attributes hence
set NULL value for boolean attributes when populating device tree
from FDT blob.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into A20
[ARM] generic: sun4i: Restructure DTS files.

Restructing DTS files to have multiple sun4i boards.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] net: phy: Fixing usage of of_get_property() in of_mdio.c

Unlike linux our of_get_property() function returns native endian value
hence there is no need to call be32_to_cpup() after of_get_property()
to convert value from Big-Endian to native one.
This patch fixes above usage in of_mdio.c file.

This patch also adds comment about above mentioned difference in
of_get_property() function.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
Merge remote-tracking branch 'upstream/master' into A20
[LIBS] Add generic buddy allocator library

This patch introduces a generic buddy allocator library which
can be used to instantiate a buddy allocator for managing
various kinds of memory such as heap, vapool, ram, etc.

The current buddy algorithm based heap implementation has
following runtime complexities:
vmm_malloc: O(log n)
vmm_free: O(n)

The generic buddy allocator library uses rbtree APIs to achieve
much better runtime complexities:
vmm_malloc: O(log n)
vmm_free: O(log n)

Shortly, we will use this new buddy allocator library wherever
possible in core code.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Use new buddy allocator library for buddy based heap

This patch simplifies curren buddy bead heap implementation by
using newly add buddy allocator library.

Signed-off-by: Anup Patel <anup@brainfault.org>
[x86] Add VMM section to the default dts.

The commit id 5c9ff8f22f1a9ef1f81cd8d2bbe37310319af99c broke
the x86 where in vmm {} section was removed from DTS. Because
of this mterm init used to fail and return leaving Xvisor
without a prompt on x86.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Increase map window for i440fx, add some locking.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Enable I/O Intercepts for i440fx.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Fix the guest shadow page table walking.

The PGDI/TI offset calculation was wrong. Now fixed.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Dump guest VCPU state during guest emergency shutdown

In case when there is abnormal behaviour from guest side which
can't be surpassed, the guest emergency shutdown is called. In
such case the guest faulting VCPU state dump can help.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[EMULATORS] Apropriate locking in emulation layer functions.

Locking was completely missing in the previous version.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>