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.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
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.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #include <palacios/vmcb.h>
21 #include <palacios/vmm.h>
22 #include <palacios/vmm_util.h>
26 void v3_set_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
27 vmcb_seg->selector = seg->selector;
28 vmcb_seg->limit = seg->limit;
29 vmcb_seg->base = seg->base;
30 vmcb_seg->attrib.fields.type = seg->type;
31 vmcb_seg->attrib.fields.S = seg->system;
32 vmcb_seg->attrib.fields.dpl = seg->dpl;
33 vmcb_seg->attrib.fields.P = seg->present;
34 vmcb_seg->attrib.fields.avl = seg->avail;
35 vmcb_seg->attrib.fields.L = seg->long_mode;
36 vmcb_seg->attrib.fields.db = seg->db;
37 vmcb_seg->attrib.fields.G = seg->granularity;
41 void v3_get_vmcb_segment(struct vmcb_selector * vmcb_seg, struct v3_segment * seg) {
42 seg->selector = vmcb_seg->selector;
43 seg->limit = vmcb_seg->limit;
44 seg->base = vmcb_seg->base;
45 seg->type = vmcb_seg->attrib.fields.type;
46 seg->system = vmcb_seg->attrib.fields.S;
47 seg->dpl = vmcb_seg->attrib.fields.dpl;
48 seg->present = vmcb_seg->attrib.fields.P;
49 seg->avail = vmcb_seg->attrib.fields.avl;
50 seg->long_mode = vmcb_seg->attrib.fields.L;
51 seg->db = vmcb_seg->attrib.fields.db;
52 seg->granularity = vmcb_seg->attrib.fields.G;
56 void v3_set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
57 vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
59 v3_set_vmcb_segment(&(guest_area->cs), &(segs->cs));
60 v3_set_vmcb_segment(&(guest_area->ds), &(segs->ds));
61 v3_set_vmcb_segment(&(guest_area->es), &(segs->es));
62 v3_set_vmcb_segment(&(guest_area->fs), &(segs->fs));
63 v3_set_vmcb_segment(&(guest_area->gs), &(segs->gs));
64 v3_set_vmcb_segment(&(guest_area->ss), &(segs->ss));
65 v3_set_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
66 v3_set_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
67 v3_set_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
68 v3_set_vmcb_segment(&(guest_area->tr), &(segs->tr));
72 void v3_get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs) {
73 vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
75 v3_get_vmcb_segment(&(guest_area->cs), &(segs->cs));
76 v3_get_vmcb_segment(&(guest_area->ds), &(segs->ds));
77 v3_get_vmcb_segment(&(guest_area->es), &(segs->es));
78 v3_get_vmcb_segment(&(guest_area->fs), &(segs->fs));
79 v3_get_vmcb_segment(&(guest_area->gs), &(segs->gs));
80 v3_get_vmcb_segment(&(guest_area->ss), &(segs->ss));
81 v3_get_vmcb_segment(&(guest_area->ldtr), &(segs->ldtr));
82 v3_get_vmcb_segment(&(guest_area->gdtr), &(segs->gdtr));
83 v3_get_vmcb_segment(&(guest_area->idtr), &(segs->idtr));
84 v3_get_vmcb_segment(&(guest_area->tr), &(segs->tr));
88 void PrintDebugVMCB(vmcb_t * vmcb) {
91 vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA(vmcb);
92 vmcb_saved_state_t * guest_area = GET_VMCB_SAVE_STATE_AREA(vmcb);
94 PrintDebug(VM_NONE, VCORE_NONE, "VMCB (0x%p)\n", (void *)vmcb);
96 PrintDebug(VM_NONE, VCORE_NONE, "--Control Area--\n");
97 PrintDebug(VM_NONE, VCORE_NONE, "CR Reads: %x\n", *(ushort_t*)&(ctrl_area->cr_reads));
98 PrintDebug(VM_NONE, VCORE_NONE, "CR Writes: %x\n", *(ushort_t*)&(ctrl_area->cr_writes));
99 PrintDebug(VM_NONE, VCORE_NONE, "DR Reads: %x\n", *(ushort_t*)&(ctrl_area->dr_reads));
100 PrintDebug(VM_NONE, VCORE_NONE, "DR Writes: %x\n", *(ushort_t*)&(ctrl_area->dr_writes));
102 PrintDebug(VM_NONE, VCORE_NONE, "Exception Bitmap: %x (at 0x%p)\n", *(uint_t*)&(ctrl_area->exceptions), (void *)&(ctrl_area->exceptions));
103 PrintDebug(VM_NONE, VCORE_NONE, "\tDivide-by-Zero: %d\n", ctrl_area->exceptions.de);
104 PrintDebug(VM_NONE, VCORE_NONE, "\tDebug: %d\n", ctrl_area->exceptions.db);
105 PrintDebug(VM_NONE, VCORE_NONE, "\tNon-maskable interrupts: %d\n", ctrl_area->exceptions.nmi);
106 PrintDebug(VM_NONE, VCORE_NONE, "\tBreakpoint: %d\n", ctrl_area->exceptions.bp);
107 PrintDebug(VM_NONE, VCORE_NONE, "\tOverflow: %d\n", ctrl_area->exceptions.of);
108 PrintDebug(VM_NONE, VCORE_NONE, "\tBound-Range: %d\n", ctrl_area->exceptions.br);
109 PrintDebug(VM_NONE, VCORE_NONE, "\tInvalid Opcode: %d\n", ctrl_area->exceptions.ud);
110 PrintDebug(VM_NONE, VCORE_NONE, "\tDevice not available: %d\n", ctrl_area->exceptions.nm);
111 PrintDebug(VM_NONE, VCORE_NONE, "\tDouble Fault: %d\n", ctrl_area->exceptions.df);
112 PrintDebug(VM_NONE, VCORE_NONE, "\tInvalid TSS: %d\n", ctrl_area->exceptions.ts);
113 PrintDebug(VM_NONE, VCORE_NONE, "\tSegment not present: %d\n", ctrl_area->exceptions.np);
114 PrintDebug(VM_NONE, VCORE_NONE, "\tStack: %d\n", ctrl_area->exceptions.ss);
115 PrintDebug(VM_NONE, VCORE_NONE, "\tGPF: %d\n", ctrl_area->exceptions.gp);
116 PrintDebug(VM_NONE, VCORE_NONE, "\tPage Fault: %d\n", ctrl_area->exceptions.pf);
117 PrintDebug(VM_NONE, VCORE_NONE, "\tFloating Point: %d\n", ctrl_area->exceptions.mf);
118 PrintDebug(VM_NONE, VCORE_NONE, "\tAlignment Check: %d\n", ctrl_area->exceptions.ac);
119 PrintDebug(VM_NONE, VCORE_NONE, "\tMachine Check: %d\n", ctrl_area->exceptions.mc);
120 PrintDebug(VM_NONE, VCORE_NONE, "\tSIMD floating point: %d\n", ctrl_area->exceptions.xf);
121 PrintDebug(VM_NONE, VCORE_NONE, "\tSecurity: %d\n", ctrl_area->exceptions.sx);
123 PrintDebug(VM_NONE, VCORE_NONE, "Instructions bitmap: %.8x (at 0x%p)\n", *(uint_t*)&(ctrl_area->instrs), &(ctrl_area->instrs));
124 PrintDebug(VM_NONE, VCORE_NONE, "\tINTR: %d\n", ctrl_area->instrs.INTR);
125 PrintDebug(VM_NONE, VCORE_NONE, "\tNMI: %d\n", ctrl_area->instrs.NMI);
126 PrintDebug(VM_NONE, VCORE_NONE, "\tSMI: %d\n", ctrl_area->instrs.SMI);
127 PrintDebug(VM_NONE, VCORE_NONE, "\tINIT: %d\n", ctrl_area->instrs.INIT);
128 PrintDebug(VM_NONE, VCORE_NONE, "\tVINTR: %d\n", ctrl_area->instrs.VINTR);
129 PrintDebug(VM_NONE, VCORE_NONE, "\tCR0: %d\n", ctrl_area->instrs.CR0);
130 PrintDebug(VM_NONE, VCORE_NONE, "\tRD_IDTR: %d\n", ctrl_area->instrs.RD_IDTR);
131 PrintDebug(VM_NONE, VCORE_NONE, "\tRD_GDTR: %d\n", ctrl_area->instrs.RD_GDTR);
132 PrintDebug(VM_NONE, VCORE_NONE, "\tRD_LDTR: %d\n", ctrl_area->instrs.RD_LDTR);
133 PrintDebug(VM_NONE, VCORE_NONE, "\tRD_TR: %d\n", ctrl_area->instrs.RD_TR);
134 PrintDebug(VM_NONE, VCORE_NONE, "\tWR_IDTR: %d\n", ctrl_area->instrs.WR_IDTR);
135 PrintDebug(VM_NONE, VCORE_NONE, "\tWR_GDTR: %d\n", ctrl_area->instrs.WR_GDTR);
136 PrintDebug(VM_NONE, VCORE_NONE, "\tWR_LDTR: %d\n", ctrl_area->instrs.WR_LDTR);
137 PrintDebug(VM_NONE, VCORE_NONE, "\tWR_TR: %d\n", ctrl_area->instrs.WR_TR);
138 PrintDebug(VM_NONE, VCORE_NONE, "\tRDTSC: %d\n", ctrl_area->instrs.RDTSC);
139 PrintDebug(VM_NONE, VCORE_NONE, "\tRDPMC: %d\n", ctrl_area->instrs.RDPMC);
140 PrintDebug(VM_NONE, VCORE_NONE, "\tPUSHF: %d\n", ctrl_area->instrs.PUSHF);
141 PrintDebug(VM_NONE, VCORE_NONE, "\tPOPF: %d\n", ctrl_area->instrs.POPF);
142 PrintDebug(VM_NONE, VCORE_NONE, "\tCPUID: %d\n", ctrl_area->instrs.CPUID);
143 PrintDebug(VM_NONE, VCORE_NONE, "\tRSM: %d\n", ctrl_area->instrs.RSM);
144 PrintDebug(VM_NONE, VCORE_NONE, "\tIRET: %d\n", ctrl_area->instrs.IRET);
145 PrintDebug(VM_NONE, VCORE_NONE, "\tINTn: %d\n", ctrl_area->instrs.INTn);
146 PrintDebug(VM_NONE, VCORE_NONE, "\tINVD: %d\n", ctrl_area->instrs.INVD);
147 PrintDebug(VM_NONE, VCORE_NONE, "\tPAUSE: %d\n", ctrl_area->instrs.PAUSE);
148 PrintDebug(VM_NONE, VCORE_NONE, "\tHLT: %d\n", ctrl_area->instrs.HLT);
149 PrintDebug(VM_NONE, VCORE_NONE, "\tINVLPG: %d\n", ctrl_area->instrs.INVLPG);
150 PrintDebug(VM_NONE, VCORE_NONE, "\tINVLPGA: %d\n", ctrl_area->instrs.INVLPGA);
151 PrintDebug(VM_NONE, VCORE_NONE, "\tIOIO_PROT: %d\n", ctrl_area->instrs.IOIO_PROT);
152 PrintDebug(VM_NONE, VCORE_NONE, "\tMSR_PROT: %d\n", ctrl_area->instrs.MSR_PROT);
153 PrintDebug(VM_NONE, VCORE_NONE, "\ttask_switch: %d\n", ctrl_area->instrs.task_switch);
154 PrintDebug(VM_NONE, VCORE_NONE, "\tFERR_FREEZE: %d\n", ctrl_area->instrs.FERR_FREEZE);
155 PrintDebug(VM_NONE, VCORE_NONE, "\tshutdown_evts: %d\n", ctrl_area->instrs.shutdown_evts);
157 PrintDebug(VM_NONE, VCORE_NONE, "SVM Instruction Bitmap: %x (at 0x%p)\n", *(uint_t*)&(ctrl_area->svm_instrs), &(ctrl_area->svm_instrs));
158 PrintDebug(VM_NONE, VCORE_NONE, "\tVMRUN: %d\n", ctrl_area->svm_instrs.VMRUN);
159 PrintDebug(VM_NONE, VCORE_NONE, "\tVMMCALL: %d\n", ctrl_area->svm_instrs.VMMCALL);
160 PrintDebug(VM_NONE, VCORE_NONE, "\tVMLOAD: %d\n", ctrl_area->svm_instrs.VMLOAD);
161 PrintDebug(VM_NONE, VCORE_NONE, "\tVMSAVE: %d\n", ctrl_area->svm_instrs.VMSAVE);
162 PrintDebug(VM_NONE, VCORE_NONE, "\tSTGI: %d\n", ctrl_area->svm_instrs.STGI);
163 PrintDebug(VM_NONE, VCORE_NONE, "\tCLGI: %d\n", ctrl_area->svm_instrs.CLGI);
164 PrintDebug(VM_NONE, VCORE_NONE, "\tSKINIT: %d\n", ctrl_area->svm_instrs.SKINIT);
165 PrintDebug(VM_NONE, VCORE_NONE, "\tRDTSCP: %d\n", ctrl_area->svm_instrs.RDTSCP);
166 PrintDebug(VM_NONE, VCORE_NONE, "\tICEBP: %d\n", ctrl_area->svm_instrs.ICEBP);
167 PrintDebug(VM_NONE, VCORE_NONE, "\tWBINVD: %d\n", ctrl_area->svm_instrs.WBINVD);
168 PrintDebug(VM_NONE, VCORE_NONE, "\tMONITOR: %d\n", ctrl_area->svm_instrs.MONITOR);
169 PrintDebug(VM_NONE, VCORE_NONE, "\tMWAIT_always: %d\n", ctrl_area->svm_instrs.MWAIT_always);
170 PrintDebug(VM_NONE, VCORE_NONE, "\tMWAIT_if_armed: %d\n", ctrl_area->svm_instrs.MWAIT_if_armed);
174 tmp_reg.r_reg = ctrl_area->IOPM_BASE_PA;
175 PrintDebug(VM_NONE, VCORE_NONE, "IOPM_BASE_PA: lo: 0x%x, hi: 0x%x\n", tmp_reg.e_reg.low, tmp_reg.e_reg.high);
176 tmp_reg.r_reg = ctrl_area->MSRPM_BASE_PA;
177 PrintDebug(VM_NONE, VCORE_NONE, "MSRPM_BASE_PA: lo: 0x%x, hi: 0x%x\n", tmp_reg.e_reg.low, tmp_reg.e_reg.high);
178 tmp_reg.r_reg = ctrl_area->TSC_OFFSET;
179 PrintDebug(VM_NONE, VCORE_NONE, "TSC_OFFSET: lo: 0x%x, hi: 0x%x\n", tmp_reg.e_reg.low, tmp_reg.e_reg.high);
181 PrintDebug(VM_NONE, VCORE_NONE, "guest_ASID: %d\n", ctrl_area->guest_ASID);
182 PrintDebug(VM_NONE, VCORE_NONE, "TLB_CONTROL: %d\n", ctrl_area->TLB_CONTROL);
185 PrintDebug(VM_NONE, VCORE_NONE, "Guest Control Bitmap: %x (at 0x%p)\n", *(uint_t*)&(ctrl_area->guest_ctrl), &(ctrl_area->guest_ctrl));
186 PrintDebug(VM_NONE, VCORE_NONE, "\tV_TPR: %d\n", ctrl_area->guest_ctrl.V_TPR);
187 PrintDebug(VM_NONE, VCORE_NONE, "\tV_IRQ: %d\n", ctrl_area->guest_ctrl.V_IRQ);
188 PrintDebug(VM_NONE, VCORE_NONE, "\tV_INTR_PRIO: %d\n", ctrl_area->guest_ctrl.V_INTR_PRIO);
189 PrintDebug(VM_NONE, VCORE_NONE, "\tV_IGN_TPR: %d\n", ctrl_area->guest_ctrl.V_IGN_TPR);
190 PrintDebug(VM_NONE, VCORE_NONE, "\tV_INTR_MASKING: %d\n", ctrl_area->guest_ctrl.V_INTR_MASKING);
191 PrintDebug(VM_NONE, VCORE_NONE, "\tV_INTR_VECTOR: %d\n", ctrl_area->guest_ctrl.V_INTR_VECTOR);
193 PrintDebug(VM_NONE, VCORE_NONE, "Interrupt_shadow: %d\n", ctrl_area->interrupt_shadow);
196 tmp_reg.r_reg = ctrl_area->exit_code;
197 PrintDebug(VM_NONE, VCORE_NONE, "exit_code: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
198 tmp_reg.r_reg = ctrl_area->exit_info1;
199 PrintDebug(VM_NONE, VCORE_NONE, "exit_info1: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
200 tmp_reg.r_reg = ctrl_area->exit_info2;
201 PrintDebug(VM_NONE, VCORE_NONE, "exit_info2: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
204 PrintDebug(VM_NONE, VCORE_NONE, "Exit Int Info: (at 0x%p)\n", &(ctrl_area->exit_int_info));
205 PrintDebug(VM_NONE, VCORE_NONE, "Vector: %d\n", ctrl_area->exit_int_info.vector);
206 PrintDebug(VM_NONE, VCORE_NONE, "(type=%d) (ev=%d) (valid=%d)\n", ctrl_area->exit_int_info.type,
207 ctrl_area->exit_int_info.ev, ctrl_area->exit_int_info.valid);
208 PrintDebug(VM_NONE, VCORE_NONE, "Error Code: %d\n", ctrl_area->exit_int_info.error_code);
211 tmp_reg.r_reg = ctrl_area->NP_ENABLE;
212 PrintDebug(VM_NONE, VCORE_NONE, "NP_ENABLE: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
214 PrintDebug(VM_NONE, VCORE_NONE, "Event Injection: (at 0x%p)\n", &(ctrl_area->EVENTINJ));
215 PrintDebug(VM_NONE, VCORE_NONE, "Vector: %d\n", ctrl_area->EVENTINJ.vector);
216 PrintDebug(VM_NONE, VCORE_NONE, "(type=%d) (ev=%d) (valid=%d)\n", ctrl_area->EVENTINJ.type,
217 ctrl_area->EVENTINJ.ev, ctrl_area->EVENTINJ.valid);
218 PrintDebug(VM_NONE, VCORE_NONE, "Error Code: %d\n", ctrl_area->EVENTINJ.error_code);
221 tmp_reg.r_reg = ctrl_area->N_CR3;
222 PrintDebug(VM_NONE, VCORE_NONE, "N_CR3: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
224 PrintDebug(VM_NONE, VCORE_NONE, "LBR_VIRTUALIZATION_ENABLE: %d\n", ctrl_area->LBR_VIRTUALIZATION_ENABLE);
227 PrintDebug(VM_NONE, VCORE_NONE, "\n--Guest Saved State--\n");
229 PrintDebug(VM_NONE, VCORE_NONE, "es Selector (at 0x%p): \n", &(guest_area->es));
230 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->es.selector);
231 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
232 guest_area->es.attrib.fields.type, guest_area->es.attrib.fields.S,
233 guest_area->es.attrib.fields.dpl, guest_area->es.attrib.fields.P,
234 guest_area->es.attrib.fields.avl, guest_area->es.attrib.fields.L,
235 guest_area->es.attrib.fields.db, guest_area->es.attrib.fields.G);
236 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->es.limit);
237 tmp_reg.r_reg = guest_area->es.base;
238 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
241 PrintDebug(VM_NONE, VCORE_NONE, "cs Selector (at 0x%p): \n", &(guest_area->cs));
242 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->cs.selector);
243 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
244 guest_area->cs.attrib.fields.type, guest_area->cs.attrib.fields.S,
245 guest_area->cs.attrib.fields.dpl, guest_area->cs.attrib.fields.P,
246 guest_area->cs.attrib.fields.avl, guest_area->cs.attrib.fields.L,
247 guest_area->cs.attrib.fields.db, guest_area->cs.attrib.fields.G);
248 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->cs.limit);
249 tmp_reg.r_reg = guest_area->cs.base;
250 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
253 PrintDebug(VM_NONE, VCORE_NONE, "ss Selector (at 0x%p): \n", &(guest_area->ss));
254 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->ss.selector);
255 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
256 guest_area->ss.attrib.fields.type, guest_area->ss.attrib.fields.S,
257 guest_area->ss.attrib.fields.dpl, guest_area->ss.attrib.fields.P,
258 guest_area->ss.attrib.fields.avl, guest_area->ss.attrib.fields.L,
259 guest_area->ss.attrib.fields.db, guest_area->ss.attrib.fields.G);
260 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->ss.limit);
261 tmp_reg.r_reg = guest_area->ss.base;
262 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
265 PrintDebug(VM_NONE, VCORE_NONE, "ds Selector (at 0x%p): \n", &(guest_area->ds));
266 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->ds.selector);
267 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
268 guest_area->ds.attrib.fields.type, guest_area->ds.attrib.fields.S,
269 guest_area->ds.attrib.fields.dpl, guest_area->ds.attrib.fields.P,
270 guest_area->ds.attrib.fields.avl, guest_area->ds.attrib.fields.L,
271 guest_area->ds.attrib.fields.db, guest_area->ds.attrib.fields.G);
272 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->ds.limit);
273 tmp_reg.r_reg = guest_area->ds.base;
274 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
277 PrintDebug(VM_NONE, VCORE_NONE, "fs Selector (at 0x%p): \n", &(guest_area->fs));
278 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->fs.selector);
279 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
280 guest_area->fs.attrib.fields.type, guest_area->fs.attrib.fields.S,
281 guest_area->fs.attrib.fields.dpl, guest_area->fs.attrib.fields.P,
282 guest_area->fs.attrib.fields.avl, guest_area->fs.attrib.fields.L,
283 guest_area->fs.attrib.fields.db, guest_area->fs.attrib.fields.G);
284 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->fs.limit);
285 tmp_reg.r_reg = guest_area->fs.base;
286 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
289 PrintDebug(VM_NONE, VCORE_NONE, "gs Selector (at 0x%p): \n", &(guest_area->gs));
290 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->gs.selector);
291 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
292 guest_area->gs.attrib.fields.type, guest_area->gs.attrib.fields.S,
293 guest_area->gs.attrib.fields.dpl, guest_area->gs.attrib.fields.P,
294 guest_area->gs.attrib.fields.avl, guest_area->gs.attrib.fields.L,
295 guest_area->gs.attrib.fields.db, guest_area->gs.attrib.fields.G);
296 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->gs.limit);
297 tmp_reg.r_reg = guest_area->gs.base;
298 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
301 PrintDebug(VM_NONE, VCORE_NONE, "gdtr Selector (at 0x%p): \n", &(guest_area->gdtr));
302 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->gdtr.selector);
303 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
304 guest_area->gdtr.attrib.fields.type, guest_area->gdtr.attrib.fields.S,
305 guest_area->gdtr.attrib.fields.dpl, guest_area->gdtr.attrib.fields.P,
306 guest_area->gdtr.attrib.fields.avl, guest_area->gdtr.attrib.fields.L,
307 guest_area->gdtr.attrib.fields.db, guest_area->gdtr.attrib.fields.G);
308 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->gdtr.limit);
309 tmp_reg.r_reg = guest_area->gdtr.base;
310 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%.8x, lo: 0x%.8x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
313 PrintDebug(VM_NONE, VCORE_NONE, "ldtr Selector (at 0x%p): \n", &(guest_area->ldtr));
314 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->ldtr.selector);
315 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
316 guest_area->ldtr.attrib.fields.type, guest_area->ldtr.attrib.fields.S,
317 guest_area->ldtr.attrib.fields.dpl, guest_area->ldtr.attrib.fields.P,
318 guest_area->ldtr.attrib.fields.avl, guest_area->ldtr.attrib.fields.L,
319 guest_area->ldtr.attrib.fields.db, guest_area->ldtr.attrib.fields.G);
320 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->ldtr.limit);
321 tmp_reg.r_reg = guest_area->ldtr.base;
322 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%.8x, lo: 0x%.8x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
325 PrintDebug(VM_NONE, VCORE_NONE, "idtr Selector (at 0x%p): \n", &(guest_area->idtr));
326 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->idtr.selector);
327 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
328 guest_area->idtr.attrib.fields.type, guest_area->idtr.attrib.fields.S,
329 guest_area->idtr.attrib.fields.dpl, guest_area->idtr.attrib.fields.P,
330 guest_area->idtr.attrib.fields.avl, guest_area->idtr.attrib.fields.L,
331 guest_area->idtr.attrib.fields.db, guest_area->idtr.attrib.fields.G);
332 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->idtr.limit);
333 tmp_reg.r_reg = guest_area->idtr.base;
334 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
337 PrintDebug(VM_NONE, VCORE_NONE, "tr Selector (at 0x%p): \n", &(guest_area->tr));
338 PrintDebug(VM_NONE, VCORE_NONE, "\tSelector: %d\n", guest_area->tr.selector);
339 PrintDebug(VM_NONE, VCORE_NONE, "\t(type=%x), (S=%d), (dpl=%d), (P=%d), (avl=%d), (L=%d), (db=%d), (G=%d)\n",
340 guest_area->tr.attrib.fields.type, guest_area->tr.attrib.fields.S,
341 guest_area->tr.attrib.fields.dpl, guest_area->tr.attrib.fields.P,
342 guest_area->tr.attrib.fields.avl, guest_area->tr.attrib.fields.L,
343 guest_area->tr.attrib.fields.db, guest_area->tr.attrib.fields.G);
344 PrintDebug(VM_NONE, VCORE_NONE, "\tlimit: %u\n", guest_area->tr.limit);
345 tmp_reg.r_reg = guest_area->tr.base;
346 PrintDebug(VM_NONE, VCORE_NONE, "\tBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
349 PrintDebug(VM_NONE, VCORE_NONE, "cpl: %d\n", guest_area->cpl);
352 tmp_reg.r_reg = guest_area->efer;
353 PrintDebug(VM_NONE, VCORE_NONE, "EFER: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
355 tmp_reg.r_reg = guest_area->cr4;
356 PrintDebug(VM_NONE, VCORE_NONE, "CR4: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
357 tmp_reg.r_reg = guest_area->cr3;
358 PrintDebug(VM_NONE, VCORE_NONE, "CR3: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
359 tmp_reg.r_reg = guest_area->cr0;
360 PrintDebug(VM_NONE, VCORE_NONE, "CR0: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
361 tmp_reg.r_reg = guest_area->dr7;
362 PrintDebug(VM_NONE, VCORE_NONE, "DR7: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
363 tmp_reg.r_reg = guest_area->dr6;
364 PrintDebug(VM_NONE, VCORE_NONE, "DR6: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
365 tmp_reg.r_reg = guest_area->rflags;
366 PrintDebug(VM_NONE, VCORE_NONE, "RFLAGS: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
367 tmp_reg.r_reg = guest_area->rip;
368 PrintDebug(VM_NONE, VCORE_NONE, "RIP: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
371 tmp_reg.r_reg = guest_area->rsp;
372 PrintDebug(VM_NONE, VCORE_NONE, "RSP: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
375 tmp_reg.r_reg = guest_area->rax;
376 PrintDebug(VM_NONE, VCORE_NONE, "RAX: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
377 tmp_reg.r_reg = guest_area->star;
378 PrintDebug(VM_NONE, VCORE_NONE, "STAR: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
379 tmp_reg.r_reg = guest_area->lstar;
380 PrintDebug(VM_NONE, VCORE_NONE, "LSTAR: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
381 tmp_reg.r_reg = guest_area->cstar;
382 PrintDebug(VM_NONE, VCORE_NONE, "CSTAR: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
383 tmp_reg.r_reg = guest_area->sfmask;
384 PrintDebug(VM_NONE, VCORE_NONE, "SFMASK: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
385 tmp_reg.r_reg = guest_area->KernelGsBase;
386 PrintDebug(VM_NONE, VCORE_NONE, "KernelGsBase: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
387 tmp_reg.r_reg = guest_area->sysenter_cs;
388 PrintDebug(VM_NONE, VCORE_NONE, "sysenter_cs: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
389 tmp_reg.r_reg = guest_area->sysenter_esp;
390 PrintDebug(VM_NONE, VCORE_NONE, "sysenter_esp: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
391 tmp_reg.r_reg = guest_area->sysenter_eip;
392 PrintDebug(VM_NONE, VCORE_NONE, "sysenter_eip: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
393 tmp_reg.r_reg = guest_area->cr2;
394 PrintDebug(VM_NONE, VCORE_NONE, "CR2: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
396 tmp_reg.r_reg = guest_area->g_pat;
397 PrintDebug(VM_NONE, VCORE_NONE, "g_pat: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
398 tmp_reg.r_reg = guest_area->dbgctl;
399 PrintDebug(VM_NONE, VCORE_NONE, "dbgctl: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
400 tmp_reg.r_reg = guest_area->br_from;
401 PrintDebug(VM_NONE, VCORE_NONE, "br_from: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
402 tmp_reg.r_reg = guest_area->br_to;
403 PrintDebug(VM_NONE, VCORE_NONE, "br_to: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
404 tmp_reg.r_reg = guest_area->lastexcpfrom;
405 PrintDebug(VM_NONE, VCORE_NONE, "lastexcpfrom: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);
406 tmp_reg.r_reg = guest_area->lastexcpto;
407 PrintDebug(VM_NONE, VCORE_NONE, "lastexcpto: hi: 0x%x, lo: 0x%x\n", tmp_reg.e_reg.high, tmp_reg.e_reg.low);