[TESTS] Don't specify timer clock frequency in Guest Linux DTS

Latest Linux kernel looks at clock frequency register when
generic timer frequency is not available in DTS.

For Guest, we should always get generic timer clock freqency
from clock frequency register hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] vgic: Minor improvement to __vgic_xxx() functions

The __vgic_queue_irq() and __vgic_sync_hwstate_vcpu() are very
crucial part of VGIC emulation and called quiet frequently
hence this patch marks few local variables of these function
to be registers.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Low-level context switching of VFP registers

As a performance improvement we do low-level context switching
of VFP registers.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Fix strex inline asm compiling error.

Signed-off-by: CoryXie <cory.xie@gmail.com>
Merge remote-tracking branch 'upstream/master' into imx6
[CORE] vmm_devtree: Minor bug fix in vmm_devtree_delattr()

Only freeup attr->value if it is non-NULL.

We might have binary attributes with attr-value = NULL.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_clocksource: Introduce vmm_clocksource_delta2nsecs() API

Converting delta cycles of cycle counter to nanosecs can be very
useful in other part of Xvisor hence export this as macro based API.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic_timer: Don't compute WFI timeout based on generic timer

It is not necessary that Guest VCPU will only wait for timer interrupt
when doing WFI. It might also wait for an IPI or some other interrupt.

This patch removes dependency of WFI timeout on generic timer state
by introducing timer events to keep track of physical timer and virtual
timer when Guest VCPU is not running.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6
[ARM] arm32: Add separate VTLB zone for high exception vectors

To make Guest exception handling faster we introduce a dedicated
VTLB zone containing 16 enteries for high exception vectors.

This new VTLB zone improves Guest Linux booting time by 2-3 seconds
and DMIPS when running on QEMU or ARM Fast Models.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic_timer: Minor improvement to interrupt delivery latency

It can quite often happen that we wakeup VCPU due someother reason
other than timer expiry. When this happens we should check whether
Phys/Virt timer was active and if so then inject phys/virt irq.

This small improvement reduces virt timer interrupt latency by
10 microsecs (approx.) in basic firmware and improves linux
boot-time for Virt-v7x2 guest on host with 1CPU by 0.01 secs.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6
[ARM] arm32: Remove unwanted VTLB flush upon SCTLR write from Guest

Currently, we flush entire VTLB when some MMU related bit is changed
in SCTLR register and we flush non-global pages from VTLB when
non-MMU related bits are changed. We really don't need to flush
non-global pages from VTLB when non-MMU bits are changes. In fact,
doing so is adding lot of penalty when Guest linux kernel is
compiled with CONFIG_ALIGNMENT_TRAP=y.

This patch removes flushing on non-global pages from VCPU upon
SCTLR write by Guest and also fixes domain fault handling for
Guest which breaks due to this improvment.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Add separate VTLB zone for low exception vectors

To make Guest exception handling faster we introduce a dedicated
VTLB zone containing 16 enteries for low exception vectors.

This new VTLB zone improves performance for Guest OSes that use
low exception vectors for exception handling.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Faster map/unmap pages for VTLB emulation

The VTLB emulation is very crucial for Guest performance
on arm32 port. This patch introduces cpu_mmu_get_l2tbl()
and cpu_mmu_unmap_l2tbl_page() APIs in arm32 MMU for
faster map/unmap of pages from VTLB emulation.

This patch reduces guest linux boot time by 1-2 seconds
and also improves dhrystone DMIPS from guest linux.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Introduce optional arch_cpu_aspace_memory_rwinit() for arch code

If arch code implements arch_cpu_aspace_memory_read/write() then having
arch_cpu_aspace_memory_rwinit() which is called on each host CPU can
be very useful for optimizing arch_cpu_aspace_memory_read/write().

This patch introduces arch_cpu_aspace_memory_rwinit() and implements
it for arm32 port.

Signed-off-by: Anup Patel <anup@brainfault.org>
[TOP] Improve dependency generation in Makefile

Currently, we generate and merge all built-in and module object
dependency files into one huge dependency file and then include
this huge dependency file.

The most important problem with the current approach is that
when someone accidently add object file for non-existent source
file then Make only complains that it was not able to generate
the huge dependency file. Instead of this Make should explicitly
tell us which object file was missing.

This patch removes the need of one huge dependency file and
re-organizes inclusion of dependency .dep files so that Make
shows correct complain when it is not able to compile some
object file.

With this improvements in Makefile the build process is also
much more faster now.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6
[LIBS] libfdt: Update license header for libfdt.h

The FDT structures used by our FDT parser are taken from DTC
source code which is dual-licensed hence we need to explicitly
acknowledge original authors for using this FDT structures.

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