]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/include/jailhouse/hypercall.h
0087d661861e85db57427aca61efd9aecc559449
[jailhouse.git] / hypervisor / include / jailhouse / hypercall.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013-2015
5  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  *
12  * Alternatively, you can use or redistribute this file under the following
13  * BSD license:
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  *
19  * 1. Redistributions of source code must retain the above copyright
20  *    notice, this list of conditions and the following disclaimer.
21  *
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
36  * THE POSSIBILITY OF SUCH DAMAGE.
37  */
38
39 #ifndef _JAILHOUSE_HYPERCALL_H
40 #define _JAILHOUSE_HYPERCALL_H
41
42 #define JAILHOUSE_HC_DISABLE                    0
43 #define JAILHOUSE_HC_CELL_CREATE                1
44 #define JAILHOUSE_HC_CELL_START                 2
45 #define JAILHOUSE_HC_CELL_SET_LOADABLE          3
46 #define JAILHOUSE_HC_CELL_DESTROY               4
47 #define JAILHOUSE_HC_HYPERVISOR_GET_INFO        5
48 #define JAILHOUSE_HC_CELL_GET_STATE             6
49 #define JAILHOUSE_HC_CPU_GET_INFO               7
50
51 /* Hypervisor information type */
52 #define JAILHOUSE_INFO_MEM_POOL_SIZE            0
53 #define JAILHOUSE_INFO_MEM_POOL_USED            1
54 #define JAILHOUSE_INFO_REMAP_POOL_SIZE          2
55 #define JAILHOUSE_INFO_REMAP_POOL_USED          3
56 #define JAILHOUSE_INFO_NUM_CELLS                4
57
58 /* Hypervisor information type */
59 #define JAILHOUSE_CPU_INFO_STATE                0
60 #define JAILHOUSE_CPU_INFO_STAT_BASE            1000
61
62 /* CPU state */
63 #define JAILHOUSE_CPU_RUNNING                   0
64 #define JAILHOUSE_CPU_FAILED                    2 /* terminal state */
65
66 /* CPU statistics */
67 #define JAILHOUSE_CPU_STAT_VMEXITS_TOTAL        0
68 #define JAILHOUSE_CPU_STAT_VMEXITS_MMIO         1
69 #define JAILHOUSE_CPU_STAT_VMEXITS_MANAGEMENT   2
70 #define JAILHOUSE_CPU_STAT_VMEXITS_HYPERCALL    3
71 #define JAILHOUSE_GENERIC_CPU_STATS             4
72
73 #define JAILHOUSE_MSG_NONE                      0
74
75 /* messages to cell */
76 #define JAILHOUSE_MSG_SHUTDOWN_REQUEST          1
77 #define JAILHOUSE_MSG_RECONFIG_COMPLETED        2
78
79 /* replies from cell */
80 #define JAILHOUSE_MSG_UNKNOWN                   1
81 #define JAILHOUSE_MSG_REQUEST_DENIED            2
82 #define JAILHOUSE_MSG_REQUEST_APPROVED          3
83 #define JAILHOUSE_MSG_RECEIVED                  4
84
85 /* cell state, initialized by hypervisor, updated by cell */
86 #define JAILHOUSE_CELL_RUNNING                  0
87 #define JAILHOUSE_CELL_RUNNING_LOCKED           1
88 #define JAILHOUSE_CELL_SHUT_DOWN                2 /* terminal state */
89 #define JAILHOUSE_CELL_FAILED                   3 /* terminal state */
90
91 #define COMM_REGION_GENERIC_HEADER              \
92         volatile __u32 msg_to_cell;             \
93         volatile __u32 reply_from_cell;         \
94         volatile __u32 cell_state;              \
95         volatile __u32 padding
96
97 #include <asm/jailhouse_hypercall.h>
98
99 #endif /* !_JAILHOUSE_HYPERCALL_H */