| Message from Cell (32 bit) |
+------------------------------+
| Cell State (32 bit) |
+ +------------------------------+
+ | Reserved (32 bit) |
+ +------------------------------+
+ : Platform Information :
+------------------------------+ - higher address
-All fields use the native endianness of the system.
+All fields use the native endianness of the system. The format is of the
+Platform Information part is architecture-specific. Its content is filled by
+the hypervisor during cell creation and shall be considered read-only until
+cell destruction.
Logical Channel "Message"
to "Running".
+Platform Information for x86
+- - - - - - - - - - - - - - -
+
+ +------------------------------+ - begin of communication region
+ : generic part, see above : (lower address)
+ +------------------------------+
+ | PM Timer Address (16 bit) |
+ +------------------------------+ - higher address
+
+
References
----------
#ifndef __ASSEMBLY__
+struct jailhouse_comm_region {
+ COMM_REGION_GENERIC_HEADER;
+};
+
static inline __u32 jailhouse_call(__u32 num)
{
register __u32 num_result asm(JAILHOUSE_CALL_NUM_RESULT) = num;
ioapic_cell_init(cell);
ioapic_root_cell_shrink(cell->config);
+ cell->comm_page.comm_region.pm_timer_address =
+ system_config->platform_info.x86.pm_timer_address;
+
return 0;
}
#ifndef __ASSEMBLY__
+struct jailhouse_comm_region {
+ COMM_REGION_GENERIC_HEADER;
+
+ __u16 pm_timer_address;
+};
+
static inline __u32 jailhouse_call(__u32 num)
{
__u32 result;
{
const u8 *pio_bitmap = jailhouse_cell_pio_bitmap(cell->config);
u32 pio_bitmap_size = cell->config->pio_bitmap_size;
- int n, err;
+ unsigned int n, pm_timer_addr;
u32 size;
+ int err;
u8 *b;
+ /* PM timer has to be provided */
+ if (system_config->platform_info.x86.pm_timer_address == 0)
+ return -EINVAL;
+
/* build root EPT of cell */
cell->vmx.ept_structs.root_paging = ept_paging;
cell->vmx.ept_structs.root_table = page_alloc(&mem_pool, 1);
*b |= ~*pio_bitmap;
}
+ /* permit access to the PM timer */
+ pm_timer_addr = system_config->platform_info.x86.pm_timer_address;
+ for (n = 0; n < 4; n++, pm_timer_addr++) {
+ b = cell->vmx.io_bitmap;
+ b[pm_timer_addr / 8] &= ~(1 << (pm_timer_addr % 8));
+ }
+
return 0;
}
#define JAILHOUSE_CELL_SHUT_DOWN 2 /* terminal state */
#define JAILHOUSE_CELL_FAILED 3 /* terminal state */
-#ifndef __ASSEMBLY__
-
-struct jailhouse_comm_region {
- volatile __u32 msg_to_cell;
- volatile __u32 reply_from_cell;
-
- volatile __u32 cell_state;
-
- /* errors etc. */
-};
-
-#endif /* !__ASSEMBLY__ */
+#define COMM_REGION_GENERIC_HEADER \
+ volatile __u32 msg_to_cell; \
+ volatile __u32 reply_from_cell; \
+ volatile __u32 cell_state; \
+ volatile __u32 padding
#include <asm/jailhouse_hypercall.h>