[ARM] arm32: arm32ve: Move memcpy and memset implementation to separate files

This patch splits cpu_string.S into cpu_memcpy.S and cpu_memset.S.

Generally, in most OSs (Linux, FreeBSD, NetBSD, ...) the arch specific
low-level implementation of memcpy and memset are located in separate
assembly sources hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm64: Optimized memcpy and memset implementation

This patch adapts Linux low-level implementation of
memcpy and memset for Xvisor arm64 port. As a result,
of this patch the ping delay in guest Linux further
reduced by 0.035 ms on Foundation v8 model.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Extended IRQ support added.

This add extended IRQ support in Xvisor, and IRQ chaining.
The aim is to have a light and simple Linux IRQ domain like, without modifying
the existing Xvisor IRQs.

More precisely, it maps multiple IRQ on an hard IRQ.
Those extended IRQ number are defined above the upper bound of
CONFIG_HOST_IRQ_COUNT.
This helps, for example, GPIO drivers to have multiple IRQ on a single hardware
one.

In order to be used, as for IRQ domain, the driver must first add a new group,
with vmm_host_extirq_add, which return the new "vmm_host_extirq_group".
Then, IRQs of this group must be mapped, with "vmm_host_extirq_create_mapping",
returning the IRQ number.
This IRQ number, defined it the upper bound of CONFIG_HOST_IRQ_COUNT, can be
used as regular one.

When the driver HW irq is raised, the driver must call
"vmm_host_extirq_find_mapping" to retrieve the corresponding extended IRQ,
from the domain, and the group IRQ offset.
The invert function, which retrieve the extended IRQ from the domain IRQ is
"vmm_host_extirq_to_hwirq" (this is the main difference with the Linux kernel
domain IRQs, as retrieving the IRQ number is enough, but was not directly
possible in Xvisor without changing IRQ management).

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand-wesolowski@openwide.fr>
[MAKEFILE] Avoid quoting the "VMM_MODNAME" macro variable on the command line.

Since the "VMM_MODNAME" macro variable will be used for defining "modtbl" and
"nidtbl", it must not contain double quotes.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand-wesolowski@openwide.fr>
[CORE] Avoid declaring "nidtbl" and "modtbl" structures as unused and static.

As being declared as static and unused, the "nidtbl" and "modtbl" structures
are removed from the objects compiled in -O1 or more optimized level, leading
to empty ".nidtbl" and ".modtbl" sections.
The module tree tables are now named with "__modtbl__" and the module name
(the compiled file name) to avoid multiple definitions.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand-wesolowski@openwide.fr>
[DRIVERS] irqchip: Fix VMM_HOST_IRQ_INIT_DECLARE() usage in irq-versatile-fpga

The VMM_HOST_IRQ_INIT_DECLARE() macro usage in irq-versatile-fpga uses same
variable name as irq-vic for irqchip nidtbl entry hence this patch fixes it.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_modules: Ensure unique variable name for modtbl entry

Recently, we made modtbl entries global variables but this results
in "multiple declaration ..." compile errors because it quite likely
that two modtbl entry variables to have same name because their
source filenames are same.

This patch tries to make the modtbl entry variable names more
unique by appending __LINE__ pre-defined macro of GCC. In other
words, we append modtbl variable declaration line number to its name.

Signed-off-by: Anup Patel <anup@brainfault.org>
[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>