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.


00e1425a2fcffdd41c7088e2c95770707f9aab51
[palacios.git] / palacios / include / palacios / vmm_msr.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_MSR_H__
21 #define __VMM_MSR_H__
22
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vmm_types.h>
27 #include <palacios/vmm_list.h>
28
29 struct guest_info;
30
31 struct v3_msr {
32
33     union {
34         ullong_t value;
35
36         struct {
37             uint_t lo;
38             uint_t hi;
39         } __attribute__((packed));
40     } __attribute__((packed));
41 } __attribute__((packed));
42
43
44
45 typedef struct v3_msr v3_msr_t;
46
47 struct v3_msr_hook {
48     uint_t msr;
49   
50     int (*read)(uint_t msr, struct v3_msr * dst, void * priv_data);
51     int (*write)(uint_t msr, struct v3_msr src, void * priv_data);
52
53     void * priv_data;
54
55     struct list_head link;
56 };
57
58
59
60 struct v3_msr_hook;
61
62 struct v3_msr_map {
63     uint_t num_hooks;
64     struct list_head hook_list;
65 };
66
67
68 void v3_init_msr_map(struct guest_info * info);
69
70 int v3_unhook_msr(struct guest_info * info, uint_t msr);
71
72 int v3_hook_msr(struct guest_info * info, uint_t msr,
73                 int (*read)(uint_t msr, struct v3_msr * dst, void * priv_data),
74                 int (*write)(uint_t msr, struct v3_msr src, void * priv_data), 
75                 void * priv_data);
76
77
78 struct v3_msr_hook * v3_get_msr_hook(struct guest_info * info, uint_t msr);
79
80 void v3_print_msr_map(struct guest_info * info);
81
82
83
84 #endif // ! __V3VEE__
85
86 #endif