7 #include <palacios/vmm_mem.h>
8 #include <palacios/vmm_types.h>
9 #include <palacios/vmm_io.h>
10 #include <palacios/vmm_shadow_paging.h>
11 #include <palacios/vmm_intr.h>
12 #include <palacios/vmm_dev_mgr.h>
13 #include <palacios/vmm_time.h>
14 #include <palacios/vmm_emulator.h>
16 typedef ullong_t v3_reg_t;
64 uint_t granularity : 1;
75 struct v3_segment ldtr;
76 struct v3_segment gdtr;
77 struct v3_segment idtr;
81 struct shadow_page_state;
84 struct emulation_state;
88 int (*raise_irq)(struct guest_info * info, int irq);
95 typedef enum {SHADOW_PAGING, NESTED_PAGING} vmm_paging_mode_t;
96 typedef enum {VM_RUNNING, VM_STOPPED, VM_SUSPENDED, VM_ERROR, VM_EMULATING} vm_operating_mode_t;
99 typedef enum {REAL, /*UNREAL,*/ PROTECTED, PROTECTED_PAE, LONG, LONG_32_COMPAT, LONG_16_COMPAT} vm_cpu_mode_t;
100 typedef enum {PHYSICAL_MEM, VIRTUAL_MEM} vm_mem_mode_t;
109 struct shadow_map mem_map;
111 struct vm_time time_state;
113 vmm_paging_mode_t shdw_pg_mode;
114 struct shadow_page_state shdw_pg_state;
115 addr_t direct_map_pt;
116 // nested_paging_t nested_page_state;
119 // This structure is how we get interrupts for the guest
120 struct vm_intr intr_state;
122 struct vmm_io_map io_map;
125 struct vmm_dev_mgr dev_mgr;
127 vm_cpu_mode_t cpu_mode;
128 vm_mem_mode_t mem_mode;
131 struct v3_gprs vm_regs;
132 struct v3_ctrl_regs ctrl_regs;
133 struct v3_dbg_regs dbg_regs;
134 struct v3_segments segments;
136 struct vm_ctrl_ops vm_ops;
138 struct emulation_state emulator;
140 vm_operating_mode_t run_state;
145 vm_cpu_mode_t get_cpu_mode(struct guest_info * info);
146 vm_mem_mode_t get_mem_mode(struct guest_info * info);
149 void PrintV3Segments(struct guest_info * info);
150 void PrintV3CtrlRegs(struct guest_info * info);
151 void PrintV3GPRs(struct guest_info * info);