[CORE] Allocate per-VCPU stack from heap instead of allocating pages

The arm32 port makes normal VCPU page tables are clones of master (or hypervisor) page table.
Due to this a normal VCPU page table does not contain stack pages of other normal VCPUs.
This in-turn makes context switching from one normal VCPU to another normal VCPU unstable.

For safety and stability of arm32 port we always allocate per-VCPU stack from heap and not as pages.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Further optimized PUSH_REGS() and PULL_REGS() macros for low-level exception handler

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Cleanup pointer arguments to functions and remove unwanted typdefs

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Fix type in error code VMM_EUNKOWN name

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] vfs: Completed all required features for Ext2 file system

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] vfs: Fix prototype of vfs_rename()

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Added VMM_EEXIST error code.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] unify all ARM options in a single sub-menu.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Check guest->arch_priv before dereferencing

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Prevent false matching of compatible sub-string

If a previous compat-string in compatibility list is a sub-string of a later compat-string, then there will be false matching with the earlier compat-string.

Signed-off-by: Anup Patel <anup@brainfault.org>
[EMULATORS] gic: Add basic support for vexpress,gicv2

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] blockdev: Fix write access in vmm_blockdev_rw()

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] vfs: Fixed vfs_rename(), vfs_rmdir(), vfs_mkdir(), and vfs_unlink() APIs

Signed-off-by: Anup Patel <anup@brainfault.org>
[COMMANDS] Added mv, rm, rmdir, and mkdir sub-commands to vfs command.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] SMP: Introduce hcpu field in struct vmm_vcpu and display the same in 'vcpu' command

Signed-off-by: Anup Patel <anup@brainfault.org>
[TESTS] Reduce arm32 test binary and relocation sizes

We reduce the arm32-test binary size by adjusting the sections so that all non-allocated sections go at the end.
To reduce the amount of data to be copied while relocation, we only copy the allocated regions of the binary.
As a result of the above two, we need to manually zero-out bss section as it no longer is part of the binary.

In addition, we also zero-out heap section to ensure we always get zeroed memory from basic test heap.

The end result is:-
1) Smaller binary (in current case size reducing by more than half)
 - Faster static patching
 - Faster flashing/copy of binary to boot source (Flash/SD-card)
2) Faster relocation

Also, the new relocation code takes care of overlapping regions (in memmove style)

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Use either -march or -mcpu compiler option but not both.

The latest GCC for ARM (i.e. GCC 4.7 or higher) throws warnings when we use -march and -mcpu simultaneously.

The reason being -mcpu option internally selects appropriate ARM architecture.

For better compiler support, we will mostly use -march option just like Linux ARM.

The only special case would be arm32ve where, we use -mcpu=cortex-a15 for enabling new instructions added in ARMv7 + Virtualization Extensions.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] blockdev: Add flags per block device for specifying capablities such as RDONLY or RW.

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] vfs: Check block device capabilities in vfs_mount()

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] vfs: Make sure appropriate S_IFxxx flag is set in v_mode by filesystem callbacks

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