x86: Add 16/32-bit operations to input from/output to I/O port

Operations inw/outw and inl/outl are added.

Signed-off-by: Ivan Kolchin <ivan.kolchin@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Introduce jailhouse/utils.h to host ARRAY_SIZE macro

We do not bother cleaning up the config source files, their format will
change in the future anyway.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Introduce BYTE_MASK macro

This constructs a mask covering as many bytes as specified via its
parameter (up to 8).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Add handler of accesses to PCI configuration space via I/O ports

Guest attempts to access ports 0xcf8 and 0xcfc are processed. String
and REP-prefixed instructions are not supported for this space. Ownership
of a device a cell tries to access to is checked. If the cell doesn't own it,
then hypervisor returns 0xFFFFFFFF to it. All read accesses to owned device are
not restricted. Writes all 1's to specific registers such as BARs or expansion
ROM address are not currently supported.
Writes to registers are moderated by white lists.

Signed-off-by: Ivan Kolchin <ivan.kolchin@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Fix a small typo in constant's naming

Signed-off-by: Ivan Kolchin <ivan.kolchin@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs: Remove unmoderated PCI config space access

Drop ports 0xcf8 and 0xcfc (and even more) from the configs of QEMU,
H700, W420 and H87i. QEMU requires a proper PCI device list to allow
this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Permit PCI capability writes until we moderate them

9f49a9b899 blocks any write access to the PCI config space that is not
explicitly allowed. This includes capabilities which we need to properly
moderate (or even virtualize: MSI[-X]) later on. For now we need to
permit caps access again as machines will otherwise break too easily
over "Invalid PIO write".

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