From c374da57ffd92414640d3b6be1e6539d247d25c6 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sun, 6 Apr 2014 08:00:15 +0200 Subject: [PATCH] core: Add reconfiguration completion notification Send an information message to all non-root cells after a cell reconfiguration is completed. This allows non-root cells to react on this event, e.g. by freezing the configuration after the expected set of cells was created. Signed-off-by: Jan Kiszka --- Documentation/hypervisor-interfaces.txt | 12 ++++++++++++ hypervisor/control.c | 13 +++++++++++++ hypervisor/include/jailhouse/hypercall.h | 1 + 3 files changed, 26 insertions(+) diff --git a/Documentation/hypervisor-interfaces.txt b/Documentation/hypervisor-interfaces.txt index 2413496..a03f44a 100644 --- a/Documentation/hypervisor-interfaces.txt +++ b/Documentation/hypervisor-interfaces.txt @@ -242,6 +242,18 @@ The following messages and corresponding replies are defined: configuration (see also [2]) or if the cell state is set to "Shut Down" or "Failed" (see below). + - Reconfiguration Completed (code 2): + A cell configuration was changed. This message is for information only + but has to be confirmed on reception nevertheless. + + Possible replies: + 4 - Message received + + Note: The hypervisor does not expect reception confirmation from a cell if + that cell has the "Passive Communication Region" flag set in its + configuration (see also [2]) or if the cell state is set to "Shut + Down" or "Failed" (see below). + Logical Channel "Cell State" - - - - - - - - - - - - - - - diff --git a/hypervisor/control.c b/hypervisor/control.c index ab10ef4..ab4073f 100644 --- a/hypervisor/control.c +++ b/hypervisor/control.c @@ -117,6 +117,15 @@ static bool cell_reconfig_ok(struct cell *excluded_cell) return true; } +static void cell_reconfig_completed(void) +{ + struct cell *cell; + + for_each_non_root_cell(cell) + cell_send_message(cell, JAILHOUSE_MSG_RECONFIG_COMPLETED, + MSG_INFORMATION); +} + static unsigned int get_free_cell_id(void) { unsigned int id = 0; @@ -361,6 +370,8 @@ static int cell_create(struct per_cpu *cpu_data, unsigned long config_address) arch_park_cpu(cpu); } + cell_reconfig_completed(); + printk("Created cell \"%s\"\n", cell->config->name); page_map_dump_stats("after cell creation"); @@ -497,6 +508,8 @@ static int cell_destroy(struct per_cpu *cpu_data, unsigned long id) page_free(&mem_pool, cell, cell->data_pages); page_map_dump_stats("after cell destruction"); + cell_reconfig_completed(); + cell_resume(cpu_data); return 0; diff --git a/hypervisor/include/jailhouse/hypercall.h b/hypervisor/include/jailhouse/hypercall.h index d2036c4..cfb6820 100644 --- a/hypervisor/include/jailhouse/hypercall.h +++ b/hypervisor/include/jailhouse/hypercall.h @@ -36,6 +36,7 @@ /* messages to cell */ #define JAILHOUSE_MSG_SHUTDOWN_REQUEST 1 +#define JAILHOUSE_MSG_RECONFIG_COMPLETED 2 /* replies from cell */ #define JAILHOUSE_MSG_UNKNOWN 1 -- 2.39.2