core: Introduce arch_shutdown

Introduce an arch-specific shutdown function to be called once when the
hypervisor is disabled. Use it on x86 for invoking vtd_shutdown. This
avoids that vtd_shutdown is called multiple times, which was harmless
but conceptually incorrect.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Rename VTD_GSTS_TE -> VTD_GSTS_TES

Aligns it with the spec's notation. No functional change.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Wait for DMAR units to enable translation

Better spin on the hardware report DMA translation as active before
resuming initialization. In case the hardware is slow, this avoids
starting into isolated mode without all isolation fully active.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
config: Add graphic RAM of h87i to region list

At least the GPU requires access to its graphic RAM that is taken from
main memory.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Factor out vtd_flush_dmar_caches

This introduced a more flexible per-unit DMAR cache flush. The scope of
the flush can be specified by the caller. We will reuse it to perform a
global flush.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Flush DMAR unit caches after setting root pointer

This is required according to section 6.6 in the VT-d architecture
specification. Failing to do so can cause spurious faults after
enabling the hypervisor.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>