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".
21 #include <palacios/svm_handler.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vm_guest_mem.h>
24 #include <palacios/vmm_decoder.h>
25 #include <palacios/vmm_ctrl_regs.h>
26 #include <palacios/svm_io.h>
27 #include <palacios/vmm_halt.h>
28 #include <palacios/svm_pause.h>
29 #include <palacios/svm_wbinvd.h>
30 #include <palacios/vmm_intr.h>
31 #include <palacios/vmm_emulator.h>
32 #include <palacios/svm_msr.h>
33 #include <palacios/vmm_hypercall.h>
34 #include <palacios/vmm_cpuid.h>
35 #include <palacios/vmm_direct_paging.h>
37 #ifndef V3_CONFIG_DEBUG_SVM
39 #define PrintDebug(fmt, args...)
42 #ifdef V3_CONFIG_TELEMETRY
43 #include <palacios/vmm_telemetry.h>
46 #ifdef V3_CONFIG_EXT_SW_INTERRUPTS
47 #include <interfaces/sw_intr.h>
50 int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_info1, addr_t exit_info2) {
52 #ifdef V3_CONFIG_TELEMETRY
53 if (info->vm_info->enable_telemetry) {
54 v3_telemetry_start_exit(info);
59 //PrintDebug("SVM Returned: Exit Code: %x\n",exit_code);
63 struct svm_io_info * io_info = (struct svm_io_info *)&(exit_info1);
65 if (io_info->type == 0) {
68 if (v3_handle_svm_io_outs(info, io_info) == -1 ) {
72 if (v3_handle_svm_io_out(info, io_info) == -1) {
80 if (v3_handle_svm_io_ins(info, io_info) == -1) {
84 if (v3_handle_svm_io_in(info, io_info) == -1) {
90 info->rip = exit_info2;
96 if (exit_info1 == 0) {
97 if (v3_handle_msr_read(info) == -1) {
100 } else if (exit_info1 == 1) {
101 if (v3_handle_msr_write(info) == -1) {
105 PrintError("Invalid MSR Operation\n");
112 if (v3_handle_cpuid(info) == -1) {
113 PrintError("Error handling CPUID\n");
118 case VMEXIT_CR0_WRITE:
119 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
120 PrintDebug("CR0 Write\n");
122 if (v3_handle_cr0_write(info) == -1) {
126 case VMEXIT_CR0_READ:
127 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
128 PrintDebug("CR0 Read\n");
130 if (v3_handle_cr0_read(info) == -1) {
134 case VMEXIT_CR3_WRITE:
135 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
136 PrintDebug("CR3 Write\n");
138 if (v3_handle_cr3_write(info) == -1) {
143 case VMEXIT_CR3_READ:
144 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
145 PrintDebug("CR3 Read\n");
147 if (v3_handle_cr3_read(info) == -1) {
151 case VMEXIT_CR4_WRITE:
152 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
153 PrintDebug("CR4 Write\n");
155 if (v3_handle_cr4_write(info) == -1) {
159 case VMEXIT_CR4_READ:
160 #ifdef V3_CONFIG_DEBUG_CTRL_REGS
161 PrintDebug("CR4 Read\n");
163 if (v3_handle_cr4_read(info) == -1) {
167 case VMEXIT_EXCP14: {
168 addr_t fault_addr = exit_info2;
169 pf_error_t * error_code = (pf_error_t *)&(exit_info1);
170 #ifdef V3_CONFIG_DEBUG_SHADOW_PAGING
171 PrintDebug("PageFault at %p (error=%d)\n",
172 (void *)fault_addr, *(uint_t *)error_code);
174 if (info->shdw_pg_mode == SHADOW_PAGING) {
175 if (v3_handle_shadow_pagefault(info, fault_addr, *error_code) == -1) {
179 PrintError("Page fault in un implemented paging mode\n");
185 addr_t fault_addr = exit_info2;
186 pf_error_t * error_code = (pf_error_t *)&(exit_info1);
188 if (info->shdw_pg_mode == NESTED_PAGING) {
189 if (v3_handle_nested_pagefault(info, fault_addr, *error_code) == -1) {
193 PrintError("Currently unhandled Nested Page Fault\n");
199 if (info->shdw_pg_mode == SHADOW_PAGING) {
200 #ifdef V3_CONFIG_DEBUG_SHADOW_PAGING
201 PrintDebug("Invlpg\n");
203 if (v3_handle_shadow_invlpg(info) == -1) {
213 // VMMCALL is a 3 byte op
214 // We do this early because some hypercalls can change the rip...
217 if (v3_handle_hypercall(info) == -1) {
218 PrintError("Error handling Hypercall\n");
224 // handled by interrupt dispatcher
227 // handled by interrupt dispatch earlier
230 // handle_svm_smi(info); // ignored for now
233 #ifdef V3_CONFIG_DEBUG_HALT
234 PrintDebug("Guest halted\n");
236 if (v3_handle_halt(info) == -1) {
241 // PrintDebug("Guest paused\n");
242 if (v3_handle_svm_pause(info) == -1) {
247 #ifdef V3_CONFIG_DEBUG_EMULATOR
248 PrintDebug("WBINVD\n");
250 if (v3_handle_svm_wbinvd(info) == -1) {
255 #ifdef V3_CONFIG_DEBUG_TIME
256 PrintDebug("RDTSC/RDTSCP\n");
258 if (v3_handle_rdtsc(info) == -1) {
259 PrintError("Error Handling RDTSC instruction\n");
264 #ifdef V3_CONFIG_DEBUG_TIME
265 PrintDebug("RDTSCP\n");
267 if (v3_handle_rdtscp(info) == -1) {
268 PrintError("Error Handling RDTSCP instruction\n");
272 case VMEXIT_SHUTDOWN:
273 PrintDebug("Guest-initiated shutdown\n");
275 info->vm_info->run_state = VM_STOPPED;
277 // Force exit on other cores
280 #ifdef V3_CONFIG_EXT_SW_INTERRUPTS
282 #ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS
283 PrintDebug("Intercepted a software interrupt\n");
285 if (v3_handle_swintr(info) == -1) {
286 PrintError("Error handling software interrupt\n");
293 /* Exits Following this line are NOT HANDLED */
294 /*=======================================================================*/
300 PrintError("Unhandled SVM Exit: %s\n", vmexit_code_to_str(exit_code));
302 rip_addr = get_addr_linear(info, info->rip, &(info->segments.cs));
305 PrintError("SVM Returned:(VMCB=%p)\n", (void *)(info->vmm_data));
306 PrintError("RIP: %p\n", (void *)(addr_t)(info->rip));
307 PrintError("RIP Linear: %p\n", (void *)(addr_t)(rip_addr));
309 PrintError("SVM Returned: Exit Code: %p\n", (void *)(addr_t)exit_code);
311 PrintError("io_info1 low = 0x%.8x\n", *(uint_t*)&(exit_info1));
312 PrintError("io_info1 high = 0x%.8x\n", *(uint_t *)(((uchar_t *)&(exit_info1)) + 4));
314 PrintError("io_info2 low = 0x%.8x\n", *(uint_t*)&(exit_info2));
315 PrintError("io_info2 high = 0x%.8x\n", *(uint_t *)(((uchar_t *)&(exit_info2)) + 4));
318 if (info->shdw_pg_mode == SHADOW_PAGING) {
319 // PrintHostPageTables(info, info->ctrl_regs.cr3);
320 //PrintGuestPageTables(info, info->shdw_pg_state.guest_cr3);
326 // END OF SWITCH (EXIT_CODE)
328 #ifdef V3_CONFIG_TELEMETRY
329 if (info->vm_info->enable_telemetry) {
330 v3_telemetry_end_exit(info, exit_code);
335 if (exit_code == VMEXIT_INTR) {
336 //PrintDebug("INTR ret IP = %x\n", guest_state->rip);
343 static const char VMEXIT_CR0_READ_STR[] = "VMEXIT_CR0_READ";
344 static const char VMEXIT_CR1_READ_STR[] = "VMEXIT_CR1_READ";
345 static const char VMEXIT_CR2_READ_STR[] = "VMEXIT_CR2_READ";
346 static const char VMEXIT_CR3_READ_STR[] = "VMEXIT_CR3_READ";
347 static const char VMEXIT_CR4_READ_STR[] = "VMEXIT_CR4_READ";
348 static const char VMEXIT_CR5_READ_STR[] = "VMEXIT_CR5_READ";
349 static const char VMEXIT_CR6_READ_STR[] = "VMEXIT_CR6_READ";
350 static const char VMEXIT_CR7_READ_STR[] = "VMEXIT_CR7_READ";
351 static const char VMEXIT_CR8_READ_STR[] = "VMEXIT_CR8_READ";
352 static const char VMEXIT_CR9_READ_STR[] = "VMEXIT_CR9_READ";
353 static const char VMEXIT_CR10_READ_STR[] = "VMEXIT_CR10_READ";
354 static const char VMEXIT_CR11_READ_STR[] = "VMEXIT_CR11_READ";
355 static const char VMEXIT_CR12_READ_STR[] = "VMEXIT_CR12_READ";
356 static const char VMEXIT_CR13_READ_STR[] = "VMEXIT_CR13_READ";
357 static const char VMEXIT_CR14_READ_STR[] = "VMEXIT_CR14_READ";
358 static const char VMEXIT_CR15_READ_STR[] = "VMEXIT_CR15_READ";
359 static const char VMEXIT_CR0_WRITE_STR[] = "VMEXIT_CR0_WRITE";
360 static const char VMEXIT_CR1_WRITE_STR[] = "VMEXIT_CR1_WRITE";
361 static const char VMEXIT_CR2_WRITE_STR[] = "VMEXIT_CR2_WRITE";
362 static const char VMEXIT_CR3_WRITE_STR[] = "VMEXIT_CR3_WRITE";
363 static const char VMEXIT_CR4_WRITE_STR[] = "VMEXIT_CR4_WRITE";
364 static const char VMEXIT_CR5_WRITE_STR[] = "VMEXIT_CR5_WRITE";
365 static const char VMEXIT_CR6_WRITE_STR[] = "VMEXIT_CR6_WRITE";
366 static const char VMEXIT_CR7_WRITE_STR[] = "VMEXIT_CR7_WRITE";
367 static const char VMEXIT_CR8_WRITE_STR[] = "VMEXIT_CR8_WRITE";
368 static const char VMEXIT_CR9_WRITE_STR[] = "VMEXIT_CR9_WRITE";
369 static const char VMEXIT_CR10_WRITE_STR[] = "VMEXIT_CR10_WRITE";
370 static const char VMEXIT_CR11_WRITE_STR[] = "VMEXIT_CR11_WRITE";
371 static const char VMEXIT_CR12_WRITE_STR[] = "VMEXIT_CR12_WRITE";
372 static const char VMEXIT_CR13_WRITE_STR[] = "VMEXIT_CR13_WRITE";
373 static const char VMEXIT_CR14_WRITE_STR[] = "VMEXIT_CR14_WRITE";
374 static const char VMEXIT_CR15_WRITE_STR[] = "VMEXIT_CR15_WRITE";
375 static const char VMEXIT_DR0_READ_STR[] = "VMEXIT_DR0_READ";
376 static const char VMEXIT_DR1_READ_STR[] = "VMEXIT_DR1_READ";
377 static const char VMEXIT_DR2_READ_STR[] = "VMEXIT_DR2_READ";
378 static const char VMEXIT_DR3_READ_STR[] = "VMEXIT_DR3_READ";
379 static const char VMEXIT_DR4_READ_STR[] = "VMEXIT_DR4_READ";
380 static const char VMEXIT_DR5_READ_STR[] = "VMEXIT_DR5_READ";
381 static const char VMEXIT_DR6_READ_STR[] = "VMEXIT_DR6_READ";
382 static const char VMEXIT_DR7_READ_STR[] = "VMEXIT_DR7_READ";
383 static const char VMEXIT_DR8_READ_STR[] = "VMEXIT_DR8_READ";
384 static const char VMEXIT_DR9_READ_STR[] = "VMEXIT_DR9_READ";
385 static const char VMEXIT_DR10_READ_STR[] = "VMEXIT_DR10_READ";
386 static const char VMEXIT_DR11_READ_STR[] = "VMEXIT_DR11_READ";
387 static const char VMEXIT_DR12_READ_STR[] = "VMEXIT_DR12_READ";
388 static const char VMEXIT_DR13_READ_STR[] = "VMEXIT_DR13_READ";
389 static const char VMEXIT_DR14_READ_STR[] = "VMEXIT_DR14_READ";
390 static const char VMEXIT_DR15_READ_STR[] = "VMEXIT_DR15_READ";
391 static const char VMEXIT_DR0_WRITE_STR[] = "VMEXIT_DR0_WRITE";
392 static const char VMEXIT_DR1_WRITE_STR[] = "VMEXIT_DR1_WRITE";
393 static const char VMEXIT_DR2_WRITE_STR[] = "VMEXIT_DR2_WRITE";
394 static const char VMEXIT_DR3_WRITE_STR[] = "VMEXIT_DR3_WRITE";
395 static const char VMEXIT_DR4_WRITE_STR[] = "VMEXIT_DR4_WRITE";
396 static const char VMEXIT_DR5_WRITE_STR[] = "VMEXIT_DR5_WRITE";
397 static const char VMEXIT_DR6_WRITE_STR[] = "VMEXIT_DR6_WRITE";
398 static const char VMEXIT_DR7_WRITE_STR[] = "VMEXIT_DR7_WRITE";
399 static const char VMEXIT_DR8_WRITE_STR[] = "VMEXIT_DR8_WRITE";
400 static const char VMEXIT_DR9_WRITE_STR[] = "VMEXIT_DR9_WRITE";
401 static const char VMEXIT_DR10_WRITE_STR[] = "VMEXIT_DR10_WRITE";
402 static const char VMEXIT_DR11_WRITE_STR[] = "VMEXIT_DR11_WRITE";
403 static const char VMEXIT_DR12_WRITE_STR[] = "VMEXIT_DR12_WRITE";
404 static const char VMEXIT_DR13_WRITE_STR[] = "VMEXIT_DR13_WRITE";
405 static const char VMEXIT_DR14_WRITE_STR[] = "VMEXIT_DR14_WRITE";
406 static const char VMEXIT_DR15_WRITE_STR[] = "VMEXIT_DR15_WRITE";
407 static const char VMEXIT_EXCP0_STR[] = "VMEXIT_EXCP0";
408 static const char VMEXIT_EXCP1_STR[] = "VMEXIT_EXCP1";
409 static const char VMEXIT_EXCP2_STR[] = "VMEXIT_EXCP2";
410 static const char VMEXIT_EXCP3_STR[] = "VMEXIT_EXCP3";
411 static const char VMEXIT_EXCP4_STR[] = "VMEXIT_EXCP4";
412 static const char VMEXIT_EXCP5_STR[] = "VMEXIT_EXCP5";
413 static const char VMEXIT_EXCP6_STR[] = "VMEXIT_EXCP6";
414 static const char VMEXIT_EXCP7_STR[] = "VMEXIT_EXCP7";
415 static const char VMEXIT_EXCP8_STR[] = "VMEXIT_EXCP8";
416 static const char VMEXIT_EXCP9_STR[] = "VMEXIT_EXCP9";
417 static const char VMEXIT_EXCP10_STR[] = "VMEXIT_EXCP10";
418 static const char VMEXIT_EXCP11_STR[] = "VMEXIT_EXCP11";
419 static const char VMEXIT_EXCP12_STR[] = "VMEXIT_EXCP12";
420 static const char VMEXIT_EXCP13_STR[] = "VMEXIT_EXCP13";
421 static const char VMEXIT_EXCP14_STR[] = "VMEXIT_EXCP14";
422 static const char VMEXIT_EXCP15_STR[] = "VMEXIT_EXCP15";
423 static const char VMEXIT_EXCP16_STR[] = "VMEXIT_EXCP16";
424 static const char VMEXIT_EXCP17_STR[] = "VMEXIT_EXCP17";
425 static const char VMEXIT_EXCP18_STR[] = "VMEXIT_EXCP18";
426 static const char VMEXIT_EXCP19_STR[] = "VMEXIT_EXCP19";
427 static const char VMEXIT_EXCP20_STR[] = "VMEXIT_EXCP20";
428 static const char VMEXIT_EXCP21_STR[] = "VMEXIT_EXCP21";
429 static const char VMEXIT_EXCP22_STR[] = "VMEXIT_EXCP22";
430 static const char VMEXIT_EXCP23_STR[] = "VMEXIT_EXCP23";
431 static const char VMEXIT_EXCP24_STR[] = "VMEXIT_EXCP24";
432 static const char VMEXIT_EXCP25_STR[] = "VMEXIT_EXCP25";
433 static const char VMEXIT_EXCP26_STR[] = "VMEXIT_EXCP26";
434 static const char VMEXIT_EXCP27_STR[] = "VMEXIT_EXCP27";
435 static const char VMEXIT_EXCP28_STR[] = "VMEXIT_EXCP28";
436 static const char VMEXIT_EXCP29_STR[] = "VMEXIT_EXCP29";
437 static const char VMEXIT_EXCP30_STR[] = "VMEXIT_EXCP30";
438 static const char VMEXIT_EXCP31_STR[] = "VMEXIT_EXCP31";
439 static const char VMEXIT_INTR_STR[] = "VMEXIT_INTR";
440 static const char VMEXIT_NMI_STR[] = "VMEXIT_NMI";
441 static const char VMEXIT_SMI_STR[] = "VMEXIT_SMI";
442 static const char VMEXIT_INIT_STR[] = "VMEXIT_INIT";
443 static const char VMEXIT_VINITR_STR[] = "VMEXIT_VINITR";
444 static const char VMEXIT_CR0_SEL_WRITE_STR[] = "VMEXIT_CR0_SEL_WRITE";
445 static const char VMEXIT_IDTR_READ_STR[] = "VMEXIT_IDTR_READ";
446 static const char VMEXIT_GDTR_READ_STR[] = "VMEXIT_GDTR_READ";
447 static const char VMEXIT_LDTR_READ_STR[] = "VMEXIT_LDTR_READ";
448 static const char VMEXIT_TR_READ_STR[] = "VMEXIT_TR_READ";
449 static const char VMEXIT_IDTR_WRITE_STR[] = "VMEXIT_IDTR_WRITE";
450 static const char VMEXIT_GDTR_WRITE_STR[] = "VMEXIT_GDTR_WRITE";
451 static const char VMEXIT_LDTR_WRITE_STR[] = "VMEXIT_LDTR_WRITE";
452 static const char VMEXIT_TR_WRITE_STR[] = "VMEXIT_TR_WRITE";
453 static const char VMEXIT_RDTSC_STR[] = "VMEXIT_RDTSC";
454 static const char VMEXIT_RDPMC_STR[] = "VMEXIT_RDPMC";
455 static const char VMEXIT_PUSHF_STR[] = "VMEXIT_PUSHF";
456 static const char VMEXIT_POPF_STR[] = "VMEXIT_POPF";
457 static const char VMEXIT_CPUID_STR[] = "VMEXIT_CPUID";
458 static const char VMEXIT_RSM_STR[] = "VMEXIT_RSM";
459 static const char VMEXIT_IRET_STR[] = "VMEXIT_IRET";
460 static const char VMEXIT_SWINT_STR[] = "VMEXIT_SWINT";
461 static const char VMEXIT_INVD_STR[] = "VMEXIT_INVD";
462 static const char VMEXIT_PAUSE_STR[] = "VMEXIT_PAUSE";
463 static const char VMEXIT_HLT_STR[] = "VMEXIT_HLT";
464 static const char VMEXIT_INVLPG_STR[] = "VMEXIT_INVLPG";
465 static const char VMEXIT_INVLPGA_STR[] = "VMEXIT_INVLPGA";
466 static const char VMEXIT_IOIO_STR[] = "VMEXIT_IOIO";
467 static const char VMEXIT_MSR_STR[] = "VMEXIT_MSR";
468 static const char VMEXIT_TASK_SWITCH_STR[] = "VMEXIT_TASK_SWITCH";
469 static const char VMEXIT_FERR_FREEZE_STR[] = "VMEXIT_FERR_FREEZE";
470 static const char VMEXIT_SHUTDOWN_STR[] = "VMEXIT_SHUTDOWN";
471 static const char VMEXIT_VMRUN_STR[] = "VMEXIT_VMRUN";
472 static const char VMEXIT_VMMCALL_STR[] = "VMEXIT_VMMCALL";
473 static const char VMEXIT_VMLOAD_STR[] = "VMEXIT_VMLOAD";
474 static const char VMEXIT_VMSAVE_STR[] = "VMEXIT_VMSAVE";
475 static const char VMEXIT_STGI_STR[] = "VMEXIT_STGI";
476 static const char VMEXIT_CLGI_STR[] = "VMEXIT_CLGI";
477 static const char VMEXIT_SKINIT_STR[] = "VMEXIT_SKINIT";
478 static const char VMEXIT_RDTSCP_STR[] = "VMEXIT_RDTSCP";
479 static const char VMEXIT_ICEBP_STR[] = "VMEXIT_ICEBP";
480 static const char VMEXIT_WBINVD_STR[] = "VMEXIT_WBINVD";
481 static const char VMEXIT_MONITOR_STR[] = "VMEXIT_MONITOR";
482 static const char VMEXIT_MWAIT_STR[] = "VMEXIT_MWAIT";
483 static const char VMEXIT_MWAIT_CONDITIONAL_STR[] = "VMEXIT_MWAIT_CONDITIONAL";
484 static const char VMEXIT_NPF_STR[] = "VMEXIT_NPF";
485 static const char VMEXIT_INVALID_VMCB_STR[] = "VMEXIT_INVALID_VMCB";
489 const char * vmexit_code_to_str(uint_t exit_code) {
491 case VMEXIT_CR0_READ:
492 return VMEXIT_CR0_READ_STR;
493 case VMEXIT_CR1_READ:
494 return VMEXIT_CR1_READ_STR;
495 case VMEXIT_CR2_READ:
496 return VMEXIT_CR2_READ_STR;
497 case VMEXIT_CR3_READ:
498 return VMEXIT_CR3_READ_STR;
499 case VMEXIT_CR4_READ:
500 return VMEXIT_CR4_READ_STR;
501 case VMEXIT_CR5_READ:
502 return VMEXIT_CR5_READ_STR;
503 case VMEXIT_CR6_READ:
504 return VMEXIT_CR6_READ_STR;
505 case VMEXIT_CR7_READ:
506 return VMEXIT_CR7_READ_STR;
507 case VMEXIT_CR8_READ:
508 return VMEXIT_CR8_READ_STR;
509 case VMEXIT_CR9_READ:
510 return VMEXIT_CR9_READ_STR;
511 case VMEXIT_CR10_READ:
512 return VMEXIT_CR10_READ_STR;
513 case VMEXIT_CR11_READ:
514 return VMEXIT_CR11_READ_STR;
515 case VMEXIT_CR12_READ:
516 return VMEXIT_CR12_READ_STR;
517 case VMEXIT_CR13_READ:
518 return VMEXIT_CR13_READ_STR;
519 case VMEXIT_CR14_READ:
520 return VMEXIT_CR14_READ_STR;
521 case VMEXIT_CR15_READ:
522 return VMEXIT_CR15_READ_STR;
523 case VMEXIT_CR0_WRITE:
524 return VMEXIT_CR0_WRITE_STR;
525 case VMEXIT_CR1_WRITE:
526 return VMEXIT_CR1_WRITE_STR;
527 case VMEXIT_CR2_WRITE:
528 return VMEXIT_CR2_WRITE_STR;
529 case VMEXIT_CR3_WRITE:
530 return VMEXIT_CR3_WRITE_STR;
531 case VMEXIT_CR4_WRITE:
532 return VMEXIT_CR4_WRITE_STR;
533 case VMEXIT_CR5_WRITE:
534 return VMEXIT_CR5_WRITE_STR;
535 case VMEXIT_CR6_WRITE:
536 return VMEXIT_CR6_WRITE_STR;
537 case VMEXIT_CR7_WRITE:
538 return VMEXIT_CR7_WRITE_STR;
539 case VMEXIT_CR8_WRITE:
540 return VMEXIT_CR8_WRITE_STR;
541 case VMEXIT_CR9_WRITE:
542 return VMEXIT_CR9_WRITE_STR;
543 case VMEXIT_CR10_WRITE:
544 return VMEXIT_CR10_WRITE_STR;
545 case VMEXIT_CR11_WRITE:
546 return VMEXIT_CR11_WRITE_STR;
547 case VMEXIT_CR12_WRITE:
548 return VMEXIT_CR12_WRITE_STR;
549 case VMEXIT_CR13_WRITE:
550 return VMEXIT_CR13_WRITE_STR;
551 case VMEXIT_CR14_WRITE:
552 return VMEXIT_CR14_WRITE_STR;
553 case VMEXIT_CR15_WRITE:
554 return VMEXIT_CR15_WRITE_STR;
555 case VMEXIT_DR0_READ:
556 return VMEXIT_DR0_READ_STR;
557 case VMEXIT_DR1_READ:
558 return VMEXIT_DR1_READ_STR;
559 case VMEXIT_DR2_READ:
560 return VMEXIT_DR2_READ_STR;
561 case VMEXIT_DR3_READ:
562 return VMEXIT_DR3_READ_STR;
563 case VMEXIT_DR4_READ:
564 return VMEXIT_DR4_READ_STR;
565 case VMEXIT_DR5_READ:
566 return VMEXIT_DR5_READ_STR;
567 case VMEXIT_DR6_READ:
568 return VMEXIT_DR6_READ_STR;
569 case VMEXIT_DR7_READ:
570 return VMEXIT_DR7_READ_STR;
571 case VMEXIT_DR8_READ:
572 return VMEXIT_DR8_READ_STR;
573 case VMEXIT_DR9_READ:
574 return VMEXIT_DR9_READ_STR;
575 case VMEXIT_DR10_READ:
576 return VMEXIT_DR10_READ_STR;
577 case VMEXIT_DR11_READ:
578 return VMEXIT_DR11_READ_STR;
579 case VMEXIT_DR12_READ:
580 return VMEXIT_DR12_READ_STR;
581 case VMEXIT_DR13_READ:
582 return VMEXIT_DR13_READ_STR;
583 case VMEXIT_DR14_READ:
584 return VMEXIT_DR14_READ_STR;
585 case VMEXIT_DR15_READ:
586 return VMEXIT_DR15_READ_STR;
587 case VMEXIT_DR0_WRITE:
588 return VMEXIT_DR0_WRITE_STR;
589 case VMEXIT_DR1_WRITE:
590 return VMEXIT_DR1_WRITE_STR;
591 case VMEXIT_DR2_WRITE:
592 return VMEXIT_DR2_WRITE_STR;
593 case VMEXIT_DR3_WRITE:
594 return VMEXIT_DR3_WRITE_STR;
595 case VMEXIT_DR4_WRITE:
596 return VMEXIT_DR4_WRITE_STR;
597 case VMEXIT_DR5_WRITE:
598 return VMEXIT_DR5_WRITE_STR;
599 case VMEXIT_DR6_WRITE:
600 return VMEXIT_DR6_WRITE_STR;
601 case VMEXIT_DR7_WRITE:
602 return VMEXIT_DR7_WRITE_STR;
603 case VMEXIT_DR8_WRITE:
604 return VMEXIT_DR8_WRITE_STR;
605 case VMEXIT_DR9_WRITE:
606 return VMEXIT_DR9_WRITE_STR;
607 case VMEXIT_DR10_WRITE:
608 return VMEXIT_DR10_WRITE_STR;
609 case VMEXIT_DR11_WRITE:
610 return VMEXIT_DR11_WRITE_STR;
611 case VMEXIT_DR12_WRITE:
612 return VMEXIT_DR12_WRITE_STR;
613 case VMEXIT_DR13_WRITE:
614 return VMEXIT_DR13_WRITE_STR;
615 case VMEXIT_DR14_WRITE:
616 return VMEXIT_DR14_WRITE_STR;
617 case VMEXIT_DR15_WRITE:
618 return VMEXIT_DR15_WRITE_STR;
620 return VMEXIT_EXCP0_STR;
622 return VMEXIT_EXCP1_STR;
624 return VMEXIT_EXCP2_STR;
626 return VMEXIT_EXCP3_STR;
628 return VMEXIT_EXCP4_STR;
630 return VMEXIT_EXCP5_STR;
632 return VMEXIT_EXCP6_STR;
634 return VMEXIT_EXCP7_STR;
636 return VMEXIT_EXCP8_STR;
638 return VMEXIT_EXCP9_STR;
640 return VMEXIT_EXCP10_STR;
642 return VMEXIT_EXCP11_STR;
644 return VMEXIT_EXCP12_STR;
646 return VMEXIT_EXCP13_STR;
648 return VMEXIT_EXCP14_STR;
650 return VMEXIT_EXCP15_STR;
652 return VMEXIT_EXCP16_STR;
654 return VMEXIT_EXCP17_STR;
656 return VMEXIT_EXCP18_STR;
658 return VMEXIT_EXCP19_STR;
660 return VMEXIT_EXCP20_STR;
662 return VMEXIT_EXCP21_STR;
664 return VMEXIT_EXCP22_STR;
666 return VMEXIT_EXCP23_STR;
668 return VMEXIT_EXCP24_STR;
670 return VMEXIT_EXCP25_STR;
672 return VMEXIT_EXCP26_STR;
674 return VMEXIT_EXCP27_STR;
676 return VMEXIT_EXCP28_STR;
678 return VMEXIT_EXCP29_STR;
680 return VMEXIT_EXCP30_STR;
682 return VMEXIT_EXCP31_STR;
684 return VMEXIT_INTR_STR;
686 return VMEXIT_NMI_STR;
688 return VMEXIT_SMI_STR;
690 return VMEXIT_INIT_STR;
692 return VMEXIT_VINITR_STR;
693 case VMEXIT_CR0_SEL_WRITE:
694 return VMEXIT_CR0_SEL_WRITE_STR;
695 case VMEXIT_IDTR_READ:
696 return VMEXIT_IDTR_READ_STR;
697 case VMEXIT_GDTR_READ:
698 return VMEXIT_GDTR_READ_STR;
699 case VMEXIT_LDTR_READ:
700 return VMEXIT_LDTR_READ_STR;
702 return VMEXIT_TR_READ_STR;
703 case VMEXIT_IDTR_WRITE:
704 return VMEXIT_IDTR_WRITE_STR;
705 case VMEXIT_GDTR_WRITE:
706 return VMEXIT_GDTR_WRITE_STR;
707 case VMEXIT_LDTR_WRITE:
708 return VMEXIT_LDTR_WRITE_STR;
709 case VMEXIT_TR_WRITE:
710 return VMEXIT_TR_WRITE_STR;
712 return VMEXIT_RDTSC_STR;
714 return VMEXIT_RDPMC_STR;
716 return VMEXIT_PUSHF_STR;
718 return VMEXIT_POPF_STR;
720 return VMEXIT_CPUID_STR;
722 return VMEXIT_RSM_STR;
724 return VMEXIT_IRET_STR;
726 return VMEXIT_SWINT_STR;
728 return VMEXIT_INVD_STR;
730 return VMEXIT_PAUSE_STR;
732 return VMEXIT_HLT_STR;
734 return VMEXIT_INVLPG_STR;
736 return VMEXIT_INVLPGA_STR;
738 return VMEXIT_IOIO_STR;
740 return VMEXIT_MSR_STR;
741 case VMEXIT_TASK_SWITCH:
742 return VMEXIT_TASK_SWITCH_STR;
743 case VMEXIT_FERR_FREEZE:
744 return VMEXIT_FERR_FREEZE_STR;
745 case VMEXIT_SHUTDOWN:
746 return VMEXIT_SHUTDOWN_STR;
748 return VMEXIT_VMRUN_STR;
750 return VMEXIT_VMMCALL_STR;
752 return VMEXIT_VMLOAD_STR;
754 return VMEXIT_VMSAVE_STR;
756 return VMEXIT_STGI_STR;
758 return VMEXIT_CLGI_STR;
760 return VMEXIT_SKINIT_STR;
762 return VMEXIT_RDTSCP_STR;
764 return VMEXIT_ICEBP_STR;
766 return VMEXIT_WBINVD_STR;
768 return VMEXIT_MONITOR_STR;
770 return VMEXIT_MWAIT_STR;
771 case VMEXIT_MWAIT_CONDITIONAL:
772 return VMEXIT_MWAIT_CONDITIONAL_STR;
774 return VMEXIT_NPF_STR;
775 case VMEXIT_INVALID_VMCB:
776 return VMEXIT_INVALID_VMCB_STR;