inmates: Clear bss during initialization

Stop relying on the Jailhouse loader to clear call memory and perform
the required bss initialization to zero on our own.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Stop clearing cell memory

The current code assumes that the first memory region in the cell
configuration is RAM when clearing it. This is fragile. But it is also
unnecessary: we can require that the cell clear its memory as needed.

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

In preparation of processing multiple jailhouse_preload_image entries
and validating their content more carefully, encapsulate the existing
logic in a separate function.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Properly select memory region for image loading

Do not simply assume that the first memory region of a cell will take
the preloaded image. Rather, walk the list of regions, picking the one
that can completely take the image. Bail out if no region is found.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Map only the window in cell RAM required for image loading

In case the cell is large, this avoids running out of virtual memory
while initializing potentially only parts of the cell memory with a
binary image.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Add support for processing multiple images

The kernel/userspace interface is already prepared for this, we just
need to loop over all provided images, loading each if them into the
cell memory.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools: Add support for loading multiple images during cell creation

Augment the power of "jailhouse cell create" by supporting to load
multiple images during cell creation. This allows, e.g., to specify cell
code and data separately.

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