[x86] Initial implemenation of VM framework.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Enable log levels in VM prints

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] MMU Initialization for guest.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Initialize VCPU capabilities for guest for AMD Proc.

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

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Added bootcmd for loading guest0

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Added generic exception handlers for unhandled exceptions

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Removed opcode macros for vmxxx instructions

Since GCC 4.x supports these opcodes directly, there is
no need to define the opcodes. Use the instructions
directly.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Guest VCPU trampoline code to boot in guest.

Guest VCPU cannot run at the PC specified in DTS. The
VCPU has to first populate VMCB correctly can call
vmload/vmrun subsequently to switch to guest mode. For
all this it needs to run VMM code.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Minor fix in VM_LOG macro.

The print was stringifying the format string
again to pring double quotes in output. Now fixed.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Minor compilation warning fix.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Fixed the svm run function

Assembler used to clobber the rAX register
as part of calling svm_launch. Now passing
VMCB as part of argument to svm_launch (in rdi).
svm_launch loads rAX with value in rdi before
calling vmload/vmrun.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Fix the offsets of segments in VMCB.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Add handle for triple fault in guest.

o As part of triple fault handling in a vcpu,
  the guest related to vcpu is halted.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Removed unused vmdb file and its references.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Add intercept types and enable them

o Added all the intercept type definitions.
o Enabled almost all of them for now to verify the
  custom firmware.
o With this the paged real mode page faults are
  being correctly intercepted and given to VMM.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Point VM reset vector to base of BIOS area.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[ARM] arm64: Minor improvments to VFP context switching

This patch does following improvements to VCPU context
switching in arm64:
1. We only need array of 64x 64bit variable to store all
32x 128bit VFP data registers
2. We don't need to check everytime whether underlying
host HW supports FPU or not.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Implement context switching for VFPv3

This patch adds support for switching VFPv3 context in arm32ve
port. This VFPv3 context switching will only work if underlying
host hardware has support for VFPv3 or higher. If underlying
hardware has VFPv2 or lower then all floating point accesses
from VCPU will be trapped and VCPU will be halted.

In future, it is highly unlikely that CPU vendors will come-up
with a ARMv7 CPU with virtualization extension but VFPv2 or lower.

Signed-off-by: Anup Patel <anup@brainfault.org>
[TESTS] Enable VFP and additional drivers for VExpress-A15 guest linux

We have VFP context switching available in both arm32ve and arm64 ports
hence, we can now happily use VFP from VExpress-A15 guest linux.

The patch also enables Ext3, EXt4, AMBAKMI, and MMCI drivers for
VExpress-A15 guest linux.

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