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.


Fix for option processing
[palacios.git] / palacios / include / palacios / vmm_exits.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) 2012, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2012, 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_EXITS_H__
21 #define __VMM_EXITS_H__
22
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vmm_types.h>
27
28
29
30 struct guest_info;
31 struct v3_vm_info;
32
33 typedef enum { V3_EXIT_RDTSC,
34                V3_EXIT_RDTSCP,
35                V3_EXIT_SWINTR,    
36                V3_EXIT_INVALID } v3_exit_type_t;
37
38
39
40
41 struct v3_exit_hook {
42
43     int (*enable)(struct guest_info * core, v3_exit_type_t exit_type);
44     int (*disable)(struct guest_info * core, v3_exit_type_t exit_type);
45
46     struct {
47         union {
48             uint32_t flags;
49             struct {
50                 uint32_t hooked      : 1;
51                 uint32_t registered  : 1;
52                 uint32_t rsvd        : 30;
53             } __attribute__((packed));
54         } __attribute__((packed));
55         
56     } __attribute__((packed));
57
58
59
60     int (*handler)(struct guest_info * core, v3_exit_type_t exit_type, 
61                 void * priv_data, void * exit_data);
62     void * priv_data;
63
64 };
65
66
67 struct v3_exit_map {
68     
69     struct v3_exit_hook * exits; 
70 };
71
72
73
74
75 int v3_init_exit_hooks(struct v3_vm_info * vm);
76 int v3_deinit_exit_hooks(struct v3_vm_info * vm);
77
78 int v3_init_exit_hooks_core(struct guest_info * core);
79
80
81
82 int v3_register_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type,
83                      int (*enable)(struct guest_info * core, v3_exit_type_t exit_type),
84                      int (*disable)(struct guest_info * core, v3_exit_type_t exit_type));
85                      
86
87
88 int v3_dispatch_exit_hook(struct guest_info * core, v3_exit_type_t exit_type, void * exit_data);
89
90
91
92
93
94
95 int v3_hook_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type,
96                  int (*handler)(struct guest_info * core, v3_exit_type_t exit_type, 
97                              void * priv_data, void * exit_data),
98                  void * priv_data, 
99                  struct guest_info * current_core);
100
101 int v3_unhook_exit(struct v3_vm_info * vm, v3_exit_type_t exit_type, struct guest_info * current_core);
102                    
103
104 #endif
105
106 #endif