Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Have unregistered hypercalls fail to guest
[palacios.git] / palacios / include / palacios / vmm_symcall.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VMM_SYMCALL_H__
21 #define __VMM_SYMCALL_H__
22
23 #ifdef __V3VEE__
24
25
26 #include <palacios/vmm_regs.h>
27
28
29
30 struct v3_sym_cpu_context {
31     struct v3_gprs vm_regs;
32     struct v3_segment cs;
33     struct v3_segment ss;
34     uint64_t gs_base;
35     uint64_t fs_base;
36     uint64_t rip;
37     uint64_t flags;
38     uint8_t cpl;
39 };
40
41 struct v3_symcall_state {
42     struct {
43         uint_t sym_call_active         : 1;
44         uint_t sym_call_returned       : 1;
45         uint_t sym_call_error          : 1;
46     } __attribute__((packed));
47
48     struct v3_sym_cpu_context old_ctx;
49
50     int sym_call_errno;
51
52     uint64_t sym_call_rip;
53     uint64_t sym_call_cs;
54     uint64_t sym_call_rsp;
55     uint64_t sym_call_gs;
56     uint64_t sym_call_fs;
57 };
58
59
60 typedef uint64_t sym_arg_t;
61
62 #define v3_sym_call0(info, call_num)            \
63     v3_sym_call(info, call_num, 0, 0, 0, 0, 0)
64 #define v3_sym_call1(info, call_num, arg1)              \
65     v3_sym_call(info, call_num, arg1, 0, 0, 0, 0)
66 #define v3_sym_call2(info, call_num, arg1, arg2)        \
67     v3_sym_call(info, call_num, arg1, arg2, 0, 0, 0)
68 #define v3_sym_call3(info, call_num, arg1, arg2, arg3)  \
69     v3_sym_call(info, call_num, arg1, arg2, arg3, 0, 0)
70 #define v3_sym_call4(info, call_num, arg1, arg2, arg3, arg4)    \
71     v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, 0)
72 #define v3_sym_call5(info, call_num, arg1, arg2, arg3, arg4, arg5)      \
73     v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, arg5)
74
75
76
77
78 /* Symcall numbers */
79 #define SYMCALL_TEST 1
80 #define SYMCALL_MEM_LOOKUP 10
81 /* ** */
82
83 int v3_sym_call(struct guest_info * info, 
84                 uint64_t call_num, sym_arg_t * arg0, 
85                 sym_arg_t * arg1, sym_arg_t * arg2,
86                 sym_arg_t * arg3, sym_arg_t * arg4);
87
88
89
90 int v3_init_symcall_vm(struct v3_vm_info * vm);
91
92 #endif
93
94 #endif