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.


APIC and CR8 changes for vector priorization vs TPR
[palacios.git] / palacios / include / palacios / vmm_regs.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_REGS_H__
21 #define __VMM_REGS_H__
22
23 #ifdef __V3VEE__
24
25 #include <palacios/vmm.h>
26
27 struct v3_gprs {
28     v3_reg_t rdi;
29     v3_reg_t rsi;
30     v3_reg_t rbp;
31     v3_reg_t rsp;
32     v3_reg_t rbx;
33     v3_reg_t rdx;
34     v3_reg_t rcx;
35     v3_reg_t rax;
36
37     v3_reg_t r8;
38     v3_reg_t r9;
39     v3_reg_t r10;
40     v3_reg_t r11;
41     v3_reg_t r12;
42     v3_reg_t r13;
43     v3_reg_t r14;
44     v3_reg_t r15;
45   
46 } __attribute__((packed));
47
48
49 struct v3_ctrl_regs {
50     v3_reg_t cr0;
51     v3_reg_t cr2;
52     v3_reg_t cr3;
53     v3_reg_t cr4;
54     v3_reg_t apic_tpr;  // cr8 is (apic_tpr >> 4) & 0xf
55     v3_reg_t rflags;
56     v3_reg_t efer;
57 };
58
59
60 struct v3_msrs {
61     v3_reg_t star;
62     v3_reg_t lstar;
63     v3_reg_t sfmask;
64     v3_reg_t kern_gs_base;
65 };
66
67
68 struct v3_dbg_regs {
69     v3_reg_t dr0;
70     v3_reg_t dr1;
71     v3_reg_t dr2;
72     v3_reg_t dr3;
73     v3_reg_t dr6;
74     v3_reg_t dr7;
75 };
76
77 struct v3_segment {
78     uint16_t selector;
79     uint_t limit;
80     uint64_t base;
81     uint_t type           : 4;
82     uint_t system         : 1;
83     uint_t dpl            : 2;
84     uint_t present        : 1;
85     uint_t avail          : 1;
86     uint_t long_mode      : 1;
87     uint_t db             : 1;
88     uint_t granularity    : 1;
89     uint_t unusable       : 1;
90 } __attribute__((packed));
91
92
93 struct v3_segments {
94     struct v3_segment cs;
95     struct v3_segment ds;
96     struct v3_segment es;
97     struct v3_segment fs;
98     struct v3_segment gs;
99     struct v3_segment ss;
100     struct v3_segment ldtr;
101     struct v3_segment gdtr;
102     struct v3_segment idtr;
103     struct v3_segment tr;
104 };
105
106
107 #endif
108
109 #endif