struct {
struct jailhouse_cell_desc ALIGN cell;
__u64 ALIGN cpus[1];
- struct jailhouse_memory ALIGN mem_regions[1];
+ struct jailhouse_memory ALIGN mem_regions[2];
__u8 ALIGN pio_bitmap[0x2000];
} ALIGN config = {
.cell = {
.name = "APIC Demo",
- .flags = JAILHOUSE_CELL_UNMANAGED_EXIT,
.cpu_set_size = sizeof(config.cpus),
.num_memory_regions = ARRAY_SIZE(config.mem_regions),
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
+ /* communication region */ {
+ .virt_start = 0x00100000,
+ .size = 0x00001000,
+ .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+ JAILHOUSE_MEM_COMM_REGION,
+ },
},
.pio_bitmap = {
KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \
-Wmissing-declarations -Wmissing-prototypes \
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
- -fno-common -fno-stack-protector -I.
+ -fno-common -fno-stack-protector -I. \
+ -I$(src)/../hypervisor/arch/$(SRCARCH)/include \
+ -I$(src)/../hypervisor/include
ifneq ($(wildcard $(src)/../hypervisor/include/jailhouse/config.h),)
KBUILD_CFLAGS += -include $(src)/../hypervisor/include/jailhouse/config.h
endif
*/
#include <inmate.h>
+#include <jailhouse/hypercall.h>
#ifdef CONFIG_UART_OXPCIE952
#define UART_BASE 0xe010
static unsigned long expected_time;
static unsigned long min = -1, max;
+static struct jailhouse_comm_region *comm_region =
+ (struct jailhouse_comm_region *)0x100000UL;
+
struct desc_table_reg {
u16 limit;
u64 base;
if (init_pm_timer())
init_apic();
- while (1) {
+ while (comm_region->msg_to_cell != JAILHOUSE_MSG_SHUTDOWN_REQUESTED)
asm volatile("hlt");
- }
+
+ printk("Rejecting first shutdown - try again!\n");
+ jailhouse_send_reply_from_cell(comm_region,
+ JAILHOUSE_MSG_SHUTDOWN_DENIED);
+
+ while (comm_region->msg_to_cell != JAILHOUSE_MSG_SHUTDOWN_REQUESTED)
+ asm volatile("hlt");
+
+ printk("Stopped APIC demo\n");
+ jailhouse_send_reply_from_cell(comm_region, JAILHOUSE_MSG_SHUTDOWN_OK);
+ asm volatile("cli; hlt");
}
typedef signed long s64;
typedef unsigned long u64;
+typedef s8 __s8;
+typedef u8 __u8;
+
+typedef s16 __s16;
+typedef u16 __u16;
+
+typedef s32 __s32;
+typedef u32 __u32;
+
+typedef s64 __s64;
+typedef u64 __u64;
+
typedef enum { true=1, false=0 } bool;
static inline void cpu_relax(void)