1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
10 #include <palacios/vmm_mem.h>
11 #include <palacios/vmm_types.h>
12 #include <palacios/vmm_io.h>
13 #include <palacios/vmm_shadow_paging.h>
14 #include <palacios/vmm_intr.h>
15 #include <palacios/vmm_dev_mgr.h>
16 #include <palacios/vmm_time.h>
17 #include <palacios/vmm_emulator.h>
19 typedef ullong_t v3_reg_t;
67 uint_t granularity : 1;
78 struct v3_segment ldtr;
79 struct v3_segment gdtr;
80 struct v3_segment idtr;
84 struct shadow_page_state;
87 struct emulation_state;
91 int (*raise_irq)(struct guest_info * info, int irq);
92 int (*lower_irq)(struct guest_info * info, int irq);
98 typedef enum {SHADOW_PAGING, NESTED_PAGING} vmm_paging_mode_t;
99 typedef enum {VM_RUNNING, VM_STOPPED, VM_SUSPENDED, VM_ERROR, VM_EMULATING} vm_operating_mode_t;
102 typedef enum {REAL, /*UNREAL,*/ PROTECTED, PROTECTED_PAE, LONG, LONG_32_COMPAT, LONG_16_COMPAT} vm_cpu_mode_t;
103 typedef enum {PHYSICAL_MEM, VIRTUAL_MEM} vm_mem_mode_t;
112 struct shadow_map mem_map;
114 struct vm_time time_state;
116 vmm_paging_mode_t shdw_pg_mode;
117 struct shadow_page_state shdw_pg_state;
118 addr_t direct_map_pt;
119 // nested_paging_t nested_page_state;
122 // This structure is how we get interrupts for the guest
123 struct vm_intr intr_state;
125 struct vmm_io_map io_map;
128 struct vmm_dev_mgr dev_mgr;
130 vm_cpu_mode_t cpu_mode;
131 vm_mem_mode_t mem_mode;
134 struct v3_gprs vm_regs;
135 struct v3_ctrl_regs ctrl_regs;
136 struct v3_dbg_regs dbg_regs;
137 struct v3_segments segments;
139 struct vm_ctrl_ops vm_ops;
141 struct emulation_state emulator;
143 vm_operating_mode_t run_state;
152 vm_cpu_mode_t get_cpu_mode(struct guest_info * info);
153 vm_mem_mode_t get_mem_mode(struct guest_info * info);
156 void PrintV3Segments(struct guest_info * info);
157 void PrintV3CtrlRegs(struct guest_info * info);
158 void PrintV3GPRs(struct guest_info * info);
160 #endif // ! __V3VEE__