2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013-2015
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.
12 * Alternatively, you can use or redistribute this file under the following
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
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.
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.
39 #ifndef _JAILHOUSE_HYPERCALL_H
40 #define _JAILHOUSE_HYPERCALL_H
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
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
58 /* Hypervisor information type */
59 #define JAILHOUSE_CPU_INFO_STATE 0
60 #define JAILHOUSE_CPU_INFO_STAT_BASE 1000
63 #define JAILHOUSE_CPU_RUNNING 0
64 #define JAILHOUSE_CPU_FAILED 2 /* terminal state */
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
73 #define JAILHOUSE_MSG_NONE 0
75 /* messages to cell */
76 #define JAILHOUSE_MSG_SHUTDOWN_REQUEST 1
77 #define JAILHOUSE_MSG_RECONFIG_COMPLETED 2
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
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 */
91 #define COMM_REGION_GENERIC_HEADER \
92 /** Message code sent from hypervisor to cell. */ \
93 volatile __u32 msg_to_cell; \
94 /** Reply code sent from cell to hypervisor. */ \
95 volatile __u32 reply_from_cell; \
96 /** Cell state, initialized by hypervisor, updated by cell. */ \
97 volatile __u32 cell_state; \
98 /** \privatesection */ \
99 volatile __u32 padding; \
100 /** \publicsection */
102 #include <asm/jailhouse_hypercall.h>
104 #endif /* !_JAILHOUSE_HYPERCALL_H */