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.
14 #error 64-bit kernel required!
17 #define JAILHOUSE_BASE 0xfffffffff0000000
19 #define JAILHOUSE_CALL_INS "vmcall"
20 #define JAILHOUSE_CALL_RESULT "=a" (result)
21 #define JAILHOUSE_CALL_NUM "a" (num)
22 #define JAILHOUSE_CALL_ARG "D" (arg)
26 static inline __u32 jailhouse_call(__u32 num)
30 asm volatile(JAILHOUSE_CALL_INS
31 : JAILHOUSE_CALL_RESULT
37 static inline __u32 jailhouse_call_arg(__u32 num, __u32 arg)
41 asm volatile(JAILHOUSE_CALL_INS
42 : JAILHOUSE_CALL_RESULT
43 : JAILHOUSE_CALL_NUM, JAILHOUSE_CALL_ARG
49 jailhouse_send_msg_to_cell(struct jailhouse_comm_region *comm_region,
52 comm_region->reply_from_cell = JAILHOUSE_MSG_NONE;
53 /* ensure reply was cleared before sending new message */
54 asm volatile("mfence" : : : "memory");
55 comm_region->msg_to_cell = msg;
59 jailhouse_send_reply_from_cell(struct jailhouse_comm_region *comm_region,
62 comm_region->msg_to_cell = JAILHOUSE_MSG_NONE;
63 /* ensure message was cleared before sending reply */
64 asm volatile("mfence" : : : "memory");
65 comm_region->reply_from_cell = reply;
68 #endif /* !__ASSEMBLY__ */