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.


Added shadow page handling, IO and MSR bitmap allocation, and started
[palacios.git] / palacios / src / palacios / vmx_msr.c
1
2 #include <palacios/vmm.h>
3 #include <palacios/vm_guest.h>
4
5 /* Same as SVM */
6 static int update_map(struct guest_info * info, uint_t msr, int hook_reads, int hook_writes)
7 {
8
9 #if 0
10     int index = get_bitmap_index(msr);
11     uint_t major = index / 4;
12     uint_t minor = (index % 4) * 2;
13     uchar_t val = 0;
14     uchar_t mask = 0x3;
15     uint8_t * bitmap = (uint8_t *)(info->msr_map.arch_data);
16
17     if (hook_reads) {
18         val |= 0x1;
19     } 
20     
21     if (hook_writes) {
22         val |= 0x2;
23     }
24
25     *(bitmap + major) &= ~(mask << minor);
26     *(bitmap + major) |= (val << minor);
27 #endif
28     
29     return 0;
30 }
31
32 int v3_init_vmx_msr_map(struct guest_info * info)
33 {
34    struct v3_msr_map * msr_map = &(info->msr_map);
35
36    msr_map->update_map = update_map;
37    
38    msr_map->arch_data = V3_VAddr(V3_AllocPages(1));
39    memset(msr_map->arch_data, 0, PAGE_SIZE_4KB);
40
41    return 0;
42 }