[ARM] arm32ve: arm64: Create 1GB stage2 mappings when possible

Our stage2 fault handling for arm32ve and arm64 can easily
create 1GB mappings in stage2 TTBL if possible hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_timer: Minor improvement to vmm_timer_timestamp()

The vmm_timer_timestamp() is the most abused API of core. It can be
called even from places where vmm_timer subsystem is not yet initialized
hence this patch adds appropriate sanity check for this function.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Minor fix in linux/module.h

This patch fixes KBUILD_MODNAME macro which was broken due to
recent changes.

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] Add strspn, strcspn and strtok_r string operations.

Add 3 standard string operation for string manipulation.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[COMMANDS] Add support for execution of a batch/script file.

This patch adds a sub-command to vfs command for running
set of Xvisor commands from a batch/script file. The batch
file is a text file with set of Xvisor commands. The lines
that start with '#' are treated as comment and not executed.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[CORE] vmm_timer: Further improve sanity check in vmm_timer_timestamp()

It can happen that vmm_timer_timestamp() is called after per-cpu
timer control structure is zeroed-out but before per-cpu time counter
is initialized hence we need to ensure that per-cpu timer counter is
initialized before it is used by vmm_timer_timestamp().

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_clocksource: Improve sanity checks in vmm_timecounter_xxx() APIs

Instead of doing sanity check only for vmm_timer_timestamp() we should
have sanity checks in vmm_timecounter_xxx() APIs to avoid potential
misuse of these APIs hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_scheduler: Sample time spend in processing interrupts

Sampling time spend in processing interrupts is very important
for VCPU load balancer and IRQ balancers hence this patch improves
our existing idle time sampling to sample both idle time and
irq time.

In addition, to above this patch extends "host cpu info" command
to show percent time spend by each host CPU in processing interrupts.

Signed-off-by: Anup Patel <anup@brainfault.org>
[EMULATORS] Add Firmware Configuration Emulator

This helps in providing information like
o boot-order
o Memory layout
o ACPI Tables

to the guest.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Enable use of firmware configuration for x86 guest.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Disable guest exit at RTDSC

We are not emulating rtdsc instruction right now.
Let it default to Qemu.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Make guest memory round to 64M

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Add Coreboot/Filo Build configs.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Probe for list of BDF on PCI

VMWare and QEMU keep IDE device on different
addresses in PCI. Add supported BDF and probing.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Add batch script to create sample guest.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[EMULATORS] Enumerate all devices under "devices", Have Mutex for device list

This patch:
o Currently the PCI emulation core code doesn't enumerate
 all the devices present under node "devices." Fixes it.

o Change the spinlock to mutex for adding regions on the fly.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[EMULATORS] XPSM: Add bar emulation template.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[CORE] Add guest address space notifications

3 guest address space notification are delivered,
aspace init, aspace deinit, aspace reset.

This can come handy when emulation layers like PCI
have to delay the probing of regions like BAR etc.,
further down.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[CORE] Function to add region from a given tree node

In such cases it makes more sense, to create a region based on
the value present already in the device tree.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[ARM] Setting read-only section MMU entries as read only.

The linker script sections have been reorganized and split to set
different places for read-only and read-write sections, and the
MMU L2 entries are now set as priviledged read-write access or
priviledged read-only access.

The ".init" section is divided into two parts ".init.text" for code
and ".init.data" for data. Among this ".init.text" will be read-only
and ".init.data" will be read-write.

Uninitialized data have been set into the '.bss' sections.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand-wesolowski@openwide.fr>