X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvm_guest.c;h=8a2e4d486f028a4075756c41c094642bb54b1eed;hb=afffedf9ab57494864f0710a2530958fa9e216cc;hp=c846415f8e721dac0ec1505da963bd52aea8c314;hpb=6dee811714540921f73487de80e069decb80c602;p=palacios-OLD.git diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index c846415..8a2e4d4 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -183,7 +184,7 @@ void v3_print_ctrl_regs(struct guest_info * info) { char * reg_names[] = {"CR0", "CR2", "CR3", "CR4", "CR8", "FLAGS", NULL}; vmcb_saved_state_t * guest_state = GET_VMCB_SAVE_STATE_AREA(info->vmm_data); - reg_ptr= (v3_reg_t *)regs; + reg_ptr = (v3_reg_t *)regs; PrintDebug("32 bit Ctrl Regs:\n"); @@ -196,7 +197,29 @@ void v3_print_ctrl_regs(struct guest_info * info) { } +void v3_print_guest_state(struct guest_info * info) { + addr_t linear_addr = 0; + + PrintDebug("RIP: %p\n", (void *)(addr_t)(info->rip)); + linear_addr = get_addr_linear(info, info->rip, &(info->segments.cs)); + PrintDebug("RIP Linear: %p\n", (void *)linear_addr); + + v3_print_segments(info); + v3_print_ctrl_regs(info); + + if (info->shdw_pg_mode == SHADOW_PAGING) { + PrintDebug("Shadow Paging Guest Registers:\n"); + PrintDebug("\tGuest CR0=%p\n", (void *)(addr_t)(info->shdw_pg_state.guest_cr0)); + PrintDebug("\tGuest CR3=%p\n", (void *)(addr_t)(info->shdw_pg_state.guest_cr3)); + PrintDebug("\tGuest EFER=%p\n", (void *)(addr_t)(info->shdw_pg_state.guest_efer.value)); + // CR4 + } + v3_print_GPRs(info); +} + + #ifdef __V3_32BIT__ + void v3_print_GPRs(struct guest_info * info) { struct v3_gprs * regs = &(info->vm_regs); int i = 0; @@ -211,7 +234,9 @@ void v3_print_GPRs(struct guest_info * info) { PrintDebug("\t%s=0x%p\n", reg_names[i], (void *)(addr_t)reg_ptr[i]); } } + #elif __V3_64BIT__ + void v3_print_GPRs(struct guest_info * info) { struct v3_gprs * regs = &(info->vm_regs); int i = 0; @@ -228,6 +253,4 @@ void v3_print_GPRs(struct guest_info * info) { } } - - #endif