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.


More init checks to allow graceful fail out when VM cannot be created
[palacios.git] / palacios / include / palacios / vmm_mem_hook.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
21 #ifndef __VMM_MEM_HOOK_H
22 #define __VMM_MEM_HOOK_H
23
24
25 #ifdef __V3VEE__ 
26
27 struct hashtable;
28
29
30 struct v3_mem_hooks {
31
32     /* Scratch memory pages for full hooks (1 per core) */
33     void * hook_hvas_1; 
34
35     /* A second set of scratch memory pages */
36     /* The ONLY reason this exists is because of 'rep cmps'... */
37     void * hook_hvas_2; 
38
39
40     struct list_head hook_list;
41
42     /* We track memory hooks via a hash table */
43     /* keyed to the memory region pointer */
44     struct hashtable * reg_table; 
45
46     int inited; // structure needs to be deinited
47 };
48
49
50 int v3_init_mem_hooks(struct v3_vm_info * vm);
51 int v3_deinit_mem_hooks(struct v3_vm_info * vm);
52
53 int v3_hook_full_mem(struct v3_vm_info * vm, uint16_t core_id,
54                      addr_t guest_addr_start, addr_t guest_addr_end,
55                      int (*read)(struct guest_info * core, addr_t guest_addr, void * dst, uint_t length, void * priv_data),
56                      int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
57                      void * priv_data);
58
59 int v3_hook_access_mem(struct v3_vm_info * vm, uint16_t core_id,
60                        addr_t guest_addr_start, addr_t guest_addr_end,
61                        int (*access)(struct guest_info * core, 
62                                      addr_t guest_va, 
63                                      addr_t guest_pa, 
64                                      struct v3_mem_region *reg, 
65                                      pf_error_t access_info, 
66                                      void *priv_data),
67                        void * priv_data);
68
69 int v3_hook_write_mem(struct v3_vm_info * vm, uint16_t core_id, 
70                       addr_t guest_addr_start, addr_t guest_addr_end, addr_t host_addr,
71                       int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
72                       void * priv_data);
73
74
75 int v3_unhook_mem(struct v3_vm_info * vm, uint16_t core_id, addr_t guest_addr_start);
76
77
78                      
79
80
81 #endif /* ! __V3VEE__ */
82
83
84 #endif