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.


Merge branch 'devel' of ssh://newskysaw.cs.northwestern.edu//home/palacios/palacios...
[palacios.git] / palacios / src / palacios / vmm_mtrr.c
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) 2011, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2011, 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 #include <palacios/vmm_mtrr.h>
21 #include <palacios/vmm_extensions.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vm_guest.h>
24 #include <palacios/vmm_msr.h>
25
26
27 #define MTRR_CAP_MSR       0x00fe
28 #define MTRR_PHYS_BASE_0   0x0200
29 #define MTRR_PHYS_BASE_1   0x0202
30 #define MTRR_PHYS_BASE_2   0x0204
31 #define MTRR_PHYS_BASE_3   0x0206
32 #define MTRR_PHYS_BASE_4   0x0208
33 #define MTRR_PHYS_BASE_5   0x020a
34 #define MTRR_PHYS_BASE_6   0x020c
35 #define MTRR_PHYS_BASE_7   0x020e
36 #define MTRR_PHYS_MASK_0   0x0201
37 #define MTRR_PHYS_MASK_1   0x0203
38 #define MTRR_PHYS_MASK_2   0x0205
39 #define MTRR_PHYS_MASK_3   0x0207
40 #define MTRR_PHYS_MASK_4   0x0209
41 #define MTRR_PHYS_MASK_5   0x020b
42 #define MTRR_PHYS_MASK_6   0x020d
43 #define MTRR_PHYS_MASK_7   0x020f
44 #define MTRR_FIX_64K_00000 0x0250
45 #define MTRR_FIX_16K_80000 0x0258
46 #define MTRR_FIX_16K_A0000 0x0259
47 #define MTRR_FIX_4K_C0000  0x0268
48 #define MTRR_FIX_4K_C8000  0x0269
49 #define MTRR_FIX_4K_D0000  0x026a
50 #define MTRR_FIX_4K_D8000  0x026b
51 #define MTRR_FIX_4K_E0000  0x026c
52 #define MTRR_FIX_4K_E8000  0x026d
53 #define MTRR_FIX_4K_F0000  0x026e
54 #define MTRR_FIX_4K_F8000  0x026f
55
56
57 struct mtrr_cap {
58
59
60 };
61
62
63 struct mtrr_state {
64     struct mtrr_cap cap;
65     
66 };
67
68
69 static int mtrr_cap_read(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data) {
70     return 0;
71 }
72
73 static int mtrr_cap_write(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data) {
74
75     return 0;
76 }
77
78
79
80 static int init_mtrrs(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_data) {
81
82
83     V3_Print("Intializing MTRR extension\n");
84
85     v3_hook_msr(vm, MTRR_CAP_MSR, mtrr_cap_read, mtrr_cap_write, NULL);
86         
87
88     return 0;
89 }
90
91
92 static struct v3_extension_impl mtrr_ext = {
93     .name = "MTRRS",
94     .init = init_mtrrs,
95     .deinit = NULL,
96     .core_init = NULL,
97     .core_deinit = NULL
98 };
99
100
101
102 register_extension(&mtrr_ext);