Improve README

As suggest by josh-at-knoesis in issue #2, clarify the difference to
full-featured hypervisors.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Catch and document the requirement for a x86-64 kernel

We don't support 32-bit x86 Linux kernels now and likely not any time
soon. Catch this early during the build and also document it more
clearly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Allow Linux to access PIT and PC speaker in QEMU systems

Required to trigger a beep. However, port 0x61 has more power, at least
on real hardware. So this is another quick hack.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Preserve all segment registers across hypervisor enabling/disabling

If our userland tool runs in 32-bit mode, we need to be more careful
with segment registers and their hidden state if those are not reloaded
before returning to userspace.

This is a simplistic approach which needs some generalization and
consolidation.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Implement compat IOCTL callback in loader module

Our ABI is 32/64-bit-safe, so we just need to declare that we support
32-bit userland.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Move struct desc_table_reg definition to processor.h

Fits better into this file than the generic types.h.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Introduce and use struct segment

This structure encapsulates both a segment selector and the descriptor
it references. Will help to make segment save/restore more regular.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Generalize and fix read_descriptor

The current code used some improper bitmasks and still assumed to read a
task state segment. This rework allows to use it also for code and data
segments we will face when starting the hypervisor.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Rework segment save/restore across hypervisor enable/disable

Factor out and use vmx_set_guest_segment to load a segment structure
into the VMCS. Use this to transfer the real values of ES..GS on
hypervisor activation. Makes the code more both generic and regular.

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