Was called inconsistently in the documentation and the code.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+------------------------------+
| Message from Cell (32 bit) |
+------------------------------+
- | Cell Status (32 bit) |
+ | Cell State (32 bit) |
+------------------------------+ - higher address
All fields use the native endianness of the system.
"Failed" (see below).
-Logical Channel "Cell Status"
+Logical Channel "Cell State"
- - - - - - - - - - - - - - -
-The cell status field provides the second logical channel. On cell startup, it
+The cell state field provides the second logical channel. On cell startup, it
is initialized by the hypervisor to the state "Running". From then on, the
field becomes conceptually read-only for the hypervisor and will just be
updated by the cell itself. The following states are defined:
static bool cell_shutdown_ok(struct cell *cell)
{
volatile u32 *reply = &cell->comm_page.comm_region.reply_from_cell;
- volatile u32 *cell_status = &cell->comm_page.comm_region.cell_status;
+ volatile u32 *cell_state = &cell->comm_page.comm_region.cell_state;
if (cell->config->flags & JAILHOUSE_CELL_UNMANAGED_EXIT)
return true;
while (*reply != JAILHOUSE_MSG_SHUTDOWN_DENIED) {
if (*reply == JAILHOUSE_MSG_SHUTDOWN_OK ||
- *cell_status == JAILHOUSE_CELL_SHUT_DOWN ||
- *cell_status == JAILHOUSE_CELL_FAILED)
+ *cell_state == JAILHOUSE_CELL_SHUT_DOWN ||
+ *cell_state == JAILHOUSE_CELL_FAILED)
return true;
cpu_relax();
}
for_each_cell(cell)
if (cell->id == id) {
- u32 status = cell->comm_page.comm_region.cell_status;
+ u32 state = cell->comm_page.comm_region.cell_state;
- switch (status) {
+ switch (state) {
case JAILHOUSE_CELL_RUNNING:
case JAILHOUSE_CELL_SHUT_DOWN:
case JAILHOUSE_CELL_FAILED:
- return status;
+ return state;
default:
return -EINVAL;
}
#define JAILHOUSE_MSG_SHUTDOWN_DENIED 1
#define JAILHOUSE_MSG_SHUTDOWN_OK 2
-/* cell status, initialized by hypervisor, updated by cell */
+/* cell state, initialized by hypervisor, updated by cell */
#define JAILHOUSE_CELL_RUNNING 0
#define JAILHOUSE_CELL_SHUT_DOWN 1 /* terminal state */
#define JAILHOUSE_CELL_FAILED 2 /* terminal state */
volatile __u32 msg_to_cell;
volatile __u32 reply_from_cell;
- volatile __u32 cell_status;
+ volatile __u32 cell_state;
/* errors etc. */
};
asm volatile("hlt");
printk("Stopped APIC demo\n");
- comm_region->cell_status = JAILHOUSE_CELL_SHUT_DOWN;
+ comm_region->cell_state = JAILHOUSE_CELL_SHUT_DOWN;
asm volatile("cli; hlt");
}