tools: config-create: Initialize PCIDevice.num_caps already on construction

No need to postpone this until we know where the caps are located -
their number will stay the same.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Adjust qemu-vm regarding ACPI region size

QEMU 2.1 faced another change in the ACPI region size. Account for it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Require Q35 machine model for QEMU-based test setup

With the introduction of config-based MMCONFIG parameters, it becomes
impossible to have one QEMU config for both its PC machines. Restrict
us to the one that will soon gain VT-d support: Q35.

Update README to reflect these requirements and changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Remove Celsius H700 config

No longer in use, already started to rot.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs/tools: Describe MMCONFIG region in config files

This prepares to switch from ACPI parsing to config file based MMCONFIG
discovery.

Update the qemu-vm and h87i configs accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Obtain MMCONFIG region via system configuration

This is a step towards overcoming ACPI in the hypervisor completely.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs/tools: Describe DMAR units in config files

This prepares to switch from ACPI parsing to config file based DMAR unit
discovery. For simplicity reasons, we limit the number of supported DMAR
units to 8. Can be extended or made dynamic when needed.

Update the h87i config accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Obtain DMAR unit addresses from system configuration

This removes the last ACPI user and simplifies the hypervisor code.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core/configs/tools: Remove ACPI support from hypervisor

The is no more user of the APCI table lookup. Remove this code as well
as the config memory region in the configuration files. Update the
config generator accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Use union for MSI address & data encoding/decoding

We will work more intensively with MSIs. Encoding the address and data
word fields as a union with bit fields will simplify those tasks. For
now we can already exploit this in vtd_init_fault_nmi.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Enforce online CPUs == expected CPUs

No longer allow the hypervisor to start with less than the number of
expected CPUs. This prevents that we leave (known) CPUs under native
control after the hypervisor started.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Adjust max_cpu_id calculation in cell_init

No need to set the limit to what we can hold in the bitmap. The limit is
better defined by the cpu set size in the config file. This not only
simplifies the code but also shortens cpu set iterations.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Fold register_root_cpu into caller

Nothing to gain by keeping this in a function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Reorder root cell init and arch_init_early

The latter will depend on the former while there is no dependency the
other way around.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Privatize IOAPIC defines

They are not part of the IOAPIC subsystem interface.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Fold ioapic_root_cell_shrink into ioapic_cell_init

One IOAPIC interface less to care about.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: config-create: locate templates next to script or in given dir

When the script was called from outside the tools dir the templates
could not be found.
This patch assumes the templates are next to the script, one can also
specify a path.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: config-create: use os.path.join to construct filenames

Use os.path.join instead of + '/'. The script is Linux only but it is
still cleaner.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>