x86: Choose a hypercall instruction in run-time

VMX and SVM use different instructions to make a hypercall (vmcall and
vmmcall, respectively). Jailhouse abstracts hypercall instructions with
inlined functions in jailhouse_hypercall.h, and these need to be able to
differentiate between VMX and SVM. As these functions are never called on
a CPU without VM extensions (the driver checks if Jailhouse is enabled
before issuing a hypercall, and inmates are not run outside cells), it is
safe to assume that the CPU without VMX support is an SVM one.
driver: Fix signedness in stats_show()

A variable that store hypercall result in stats_show() function
was incorrectly declared as unsigned, hence the error check always
succeeded.
x86: Misc fixes for vcpu_reset() in svm.c

Guest CR3 register wasn't cleared on virtual CPU reset due to the typo,
and guest's EFER was incorrectly set to zero with SVME bit cleared. The
last bug resulted in misbehavior when Jailhouse runs on real hardware.
x86: Fix SVM_CR0_CLEARED_BITS value

See the comment inside for the motivation. Having CD bit in
SVM_CR0_CLEARED_BITS breaks Linux's prepare_set() function,
which is called as a part of the bootstrap sequence and
explicitly disables caching on the CPU.
x86: Fix GIF handling

GIF must be cleared when a CPU leaves Jailhouse. This happens in
vcpu_deactivate_vmm() and vcpu_exit(). Previously, stgi was absent
from the latter, causing CPU to stall when Jailhouse was disabled
with a running non-root cell.
x86: Better vcpu_handle_exit() in svm.c

A CPU is parked now if it failed to proceed under SVM, and MMIO
access to APIC registers is trapped regardless presence of the AVIC,
which makes the logic more straightforward.
x86: Enable APIC reads pass-through

Do not VM exit on APIC MMIO registers read anymore. This is known
not to work under KVM, and x2APIC mode is recommeded for nested
SVM setup, as described in qemu-vm config.
x86: Fixed a comment

This commit is here to preserve the history, and it will
vanish with the next rebase.
x86: Prevent unnecessary rebuilds in Makefile

Previously, both built-in-amd.o and built-in-intel.o where linked
from objects of the same names, and as each make invocation builds
both variants, this inevitably led to rebuild of the arch-specific
part, regardless if there were changes in the sources or not.

New Makefile use separate object files for Intel and AMD, and doesn't
break dependency tracking anymore. This way, only changed parts of
Jailhouse are recompiled and relinked at the each subsequent build.
configs: Make configs adjustable with config.h

As the number of cell configs grows, it becomes harder and harder
to make them generic enough to run on every supported hardware
configuration due to resource confilcts.

Attempt to workaroud this with introducing config.h to cell configs.
With this in place, some parts of cell configs (eg. I/O ranges) can
be compiled out on each particular system, removing the need for manual
changes in the configs.
configs: Only map OXPCIe952 if it is available

Only map OXPCIe952 I/O ports to non-root cells if the hardware is
available on this particular system, as determined by local config.h.
configs: Map ACPI PM1a_* to ioapic-demo cell

Extend the range of I/O ports mapped to ioapic-demo cell,
as it may be referenced on some AMD-based G-Series boards.
inmates: Account for 32-bit PM timers

Some systems may use 32-bit PM timer (as defined by TMR_VAL_EXT feature
flag in FADT), however pm_timer_read() assumes it is always 24-bit. Where
this assumption is wrong, return value becomes incorrect, and the error
grows over time leading to obscure bugs, including lockups in the hypervisor.

Make timer width configurable at compile time to avoid parsing ACPI tables
in the inmates framework.
configs: Add IMB-A180 G-Series board

Add a configuration for AMD-based ASRock IMB-A180 G-series board.
configs: Remove QEMU VM 2.0 config

AMD-V port can now safely run on QEMU 2.1 with Q35 emulation
(i.e. in the same environment Jailhouse for Intel runs), so there
is no need to maintain a separate config for the legacy VM.
Update TODO list