From: Jan Kiszka Date: Tue, 4 Mar 2014 18:43:24 +0000 (+0100) Subject: core/inmates: Rename cell "status" to "state" X-Git-Url: https://rtime.felk.cvut.cz/gitweb/jailhouse.git/commitdiff_plain/46d3ef45e8650b6f198be83b7b7d8f2fe51067ea core/inmates: Rename cell "status" to "state" Was called inconsistently in the documentation and the code. Signed-off-by: Jan Kiszka --- diff --git a/Documentation/hypervisor-interfaces.txt b/Documentation/hypervisor-interfaces.txt index 02d8f21..bd91ec1 100644 --- a/Documentation/hypervisor-interfaces.txt +++ b/Documentation/hypervisor-interfaces.txt @@ -179,7 +179,7 @@ Communication region layout +------------------------------+ | Message from Cell (32 bit) | +------------------------------+ - | Cell Status (32 bit) | + | Cell State (32 bit) | +------------------------------+ - higher address All fields use the native endianness of the system. @@ -227,10 +227,10 @@ Note: The hypervisor does not request shutdown permission from a cell if that "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: diff --git a/hypervisor/control.c b/hypervisor/control.c index 1619abf..cea0b15 100644 --- a/hypervisor/control.c +++ b/hypervisor/control.c @@ -249,7 +249,7 @@ err_resume: 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; @@ -259,8 +259,8 @@ static bool cell_shutdown_ok(struct cell *cell) 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(); } @@ -384,13 +384,13 @@ int cell_get_state(struct per_cpu *cpu_data, unsigned long id) 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; } diff --git a/hypervisor/include/jailhouse/hypercall.h b/hypervisor/include/jailhouse/hypercall.h index 8a5d9d4..ac225a5 100644 --- a/hypervisor/include/jailhouse/hypercall.h +++ b/hypervisor/include/jailhouse/hypercall.h @@ -27,7 +27,7 @@ #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 */ @@ -36,7 +36,7 @@ struct jailhouse_comm_region { volatile __u32 msg_to_cell; volatile __u32 reply_from_cell; - volatile __u32 cell_status; + volatile __u32 cell_state; /* errors etc. */ }; diff --git a/inmates/apic-demo.c b/inmates/apic-demo.c index 67413fb..e75a1b0 100644 --- a/inmates/apic-demo.c +++ b/inmates/apic-demo.c @@ -144,7 +144,7 @@ void inmate_main(void) 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"); }