tools: Prepare further command line tool extensions

Allow to add more extension scripts to the command line tool. We define
a structure that describes an extension by command / subcommand and
provides help to be displayed by the tool. The extension script itself
has to be called jailhouse-<command>-<subcommand>. We look for it in
$PATH, extended by the tool's directory and /usr/lib/jailhouse.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: Add cell statistics viewer

Add a tool extension to view cell statistics via a basic curses-based
user interface.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Fix vtd constants

Regressions of 9104461829: off-by-one for the CCMD context, and the
IOTLB_IIRG accidentally became the IAIG.

Found by Le Tan via his VT-d emulation prototype for QEMU.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Enable RDTSCP for the cells

If the CPU support RDTSCP, we must enable this feature for cell usage or
they will receive unexpected #UD.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Drop redundant vmx_invept

No need to call invept also on vmx_cell_init. We already perform this
for all cpus involved in a cell creation (root and new cell cpus) via
arch_config_commit.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Allow to specify the PM timer address via the system configuration

This enables the hypervisor to forward the information to non-root cells
and to permit access to the resource. We could also parse the ACPI table
in the hypervisor, but this approach is much simpler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Specify PM timer addresses

Specify the location of the PM timer. For QEMU VMs, we already use the
address of upcoming release 2.1.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Provide PM timer access to all cells

Export the PM timer address via the Communication Region to non-root
cells and allow access to that port for all cells. This is safe as the
PM timer hardware is specified to be read-only.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/configs: Pick up PM timer address from Comm Region

Instead of probing it, use the information that is now provided via the
Communication Region. This requires to map the region also into the
tiny-demo cell.

We can now drop all explicit port permissions from the inmate's cell
configurations as this is now done automatically by the hypervisor.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Add Q35 machine support to QEMU VM

Add required PCI devices to the QEMU config so that it both works with
the default i440FX and the newer Q35 machine. This is transitional until
Q35 gains VT-d support, then we will drop i440FX bits.

Open the whole 0xC0xx port range for PCI devices to be more tolerant
regarding ordering or other changes.

At this chance, drop the unneeded permission to talk to the first legacy
PIC.

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

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Drop Celsius W420

No machine of this type in reach, so we cannot update to recent config
extensions. Also, we will soon focus on auto-generated configs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: Add configuration generator

Adding a helper script to generate a configuration for the root cell.
The script can also generate another script to collect all the necessary
files on a remote machine.
Both scripts can be accessed through the jailhouse command.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: config-create: include PM timer in root cell config

Add the PM timer to configurations created with jailhouse config create.

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