2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #ifndef _JAILHOUSE_HYPERCALL_H
14 #define _JAILHOUSE_HYPERCALL_H
16 #define JAILHOUSE_HC_DISABLE 0
17 #define JAILHOUSE_HC_CELL_CREATE 1
18 #define JAILHOUSE_HC_CELL_START 2
19 #define JAILHOUSE_HC_CELL_SET_LOADABLE 3
20 #define JAILHOUSE_HC_CELL_DESTROY 4
21 #define JAILHOUSE_HC_HYPERVISOR_GET_INFO 5
22 #define JAILHOUSE_HC_CELL_GET_STATE 6
23 #define JAILHOUSE_HC_CPU_GET_INFO 7
25 /* Hypervisor information type */
26 #define JAILHOUSE_INFO_MEM_POOL_SIZE 0
27 #define JAILHOUSE_INFO_MEM_POOL_USED 1
28 #define JAILHOUSE_INFO_REMAP_POOL_SIZE 2
29 #define JAILHOUSE_INFO_REMAP_POOL_USED 3
30 #define JAILHOUSE_INFO_NUM_CELLS 4
32 /* Hypervisor information type */
33 #define JAILHOUSE_CPU_INFO_STATE 0
34 #define JAILHOUSE_CPU_INFO_STAT_BASE 1000
37 #define JAILHOUSE_CPU_RUNNING 0
38 #define JAILHOUSE_CPU_FAILED 2 /* terminal state */
41 #define JAILHOUSE_CPU_STAT_VMEXITS_TOTAL 0
42 #define JAILHOUSE_CPU_STAT_VMEXITS_MMIO 1
43 #define JAILHOUSE_CPU_STAT_VMEXITS_MANAGEMENT 2
44 #define JAILHOUSE_CPU_STAT_VMEXITS_HYPERCALL 3
45 #define JAILHOUSE_GENERIC_CPU_STATS 4
47 #define JAILHOUSE_MSG_NONE 0
49 /* messages to cell */
50 #define JAILHOUSE_MSG_SHUTDOWN_REQUEST 1
51 #define JAILHOUSE_MSG_RECONFIG_COMPLETED 2
53 /* replies from cell */
54 #define JAILHOUSE_MSG_UNKNOWN 1
55 #define JAILHOUSE_MSG_REQUEST_DENIED 2
56 #define JAILHOUSE_MSG_REQUEST_APPROVED 3
57 #define JAILHOUSE_MSG_RECEIVED 4
59 /* cell state, initialized by hypervisor, updated by cell */
60 #define JAILHOUSE_CELL_RUNNING 0
61 #define JAILHOUSE_CELL_RUNNING_LOCKED 1
62 #define JAILHOUSE_CELL_SHUT_DOWN 2 /* terminal state */
63 #define JAILHOUSE_CELL_FAILED 3 /* terminal state */
67 struct jailhouse_comm_region {
68 volatile __u32 msg_to_cell;
69 volatile __u32 reply_from_cell;
71 volatile __u32 cell_state;
76 #endif /* !__ASSEMBLY__ */
78 #include <asm/jailhouse_hypercall.h>
80 #endif /* !_JAILHOUSE_HYPERCALL_H */