driver: Fix error exit path on cell destruction

Avoid leaking config memory on interrupted mutex waiting.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Cleanup of enabled check in jailhouse_disable

Align with the pattern in other functions.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Export "hypervisor enabled" state via sysfs

This starts sysfs support for Jailhouse by exporting the enabled state
via the management device's sysfs directory (/sys/devices/jailhouse).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Avoid local variable name "cell"

Rename local variables cell to cell_params. We are about to call some
other object "cell". No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Reorder error path of jailhouse_cell_create

We will add more rollback code that is executed errors. This step avoids
that all the rollback calls need to be guarded by "if (err)".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver: Track all active cells

Create a kobject for every existing cell, including the root cell, and
add it to sysfs. This will allow to export state information etc. about
active cells later on and to maintain additional data over the lifetime
of a cell in the driver.

Moreover, we can now avoid trying to create a cell twice. This only
triggers a memory access violation when writing to the reserved memory
of the existing cell, effectively offlining the Linux CPU that tries it.

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