X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvm_guest.c;h=7a10e6641551d9dd43d5afb82a00db0a5fe5218b;hb=c44555f7fa9a90c1934f5b74c8fe1dee1c09d325;hp=aa425280982ff767d29f169f5b1e7fb8c594d6b1;hpb=c31bb26014522e5678e9c9dcc9eda760eeb5907a;p=palacios.git diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index aa42528..7a10e66 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -252,14 +252,14 @@ void v3_print_ctrl_regs(struct guest_info * info) { V3_Print("32 bit Ctrl Regs:\n"); for (i = 0; reg_names[i] != NULL; i++) { - V3_Print("\t%s=0x%p\n", reg_names[i], (void *)(addr_t)reg_ptr[i]); + V3_Print("\t%s=0x%p (at %p)\n", reg_names[i], (void *)(addr_t)reg_ptr[i], &(reg_ptr[i])); } V3_Print("\tEFER=0x%p\n", (void*)(addr_t)(guest_state->efer)); } - +#if 0 static int safe_gva_to_hva(struct guest_info * info, addr_t linear_addr, addr_t * host_addr) { /* select the proper translation based on guest mode */ if (info->mem_mode == PHYSICAL_MEM) { @@ -282,6 +282,8 @@ static int v3_print_disassembly(struct guest_info * info) { /* start disassembly 64 bytes before current RIP, continue 32 bytes after */ rip = (addr_t) info->rip - 64; while ((int) (rip - info->rip) < 32) { + V3_Print("disassembly step\n"); + /* always print RIP, even if the instructions before were bad */ if (!passed_rip && rip >= info->rip) { if (rip != info->rip) { @@ -303,11 +305,13 @@ static int v3_print_disassembly(struct guest_info * info) { rip++; continue; } + } return 0; } +#endif void v3_print_guest_state(struct guest_info * info) { addr_t linear_addr = 0; @@ -334,7 +338,27 @@ void v3_print_guest_state(struct guest_info * info) { v3_print_stack(info); - v3_print_disassembly(info); + // v3_print_disassembly(info); +} + +void v3_print_guest_state_all(struct v3_vm_info * vm) { + int i = 0; + + V3_Print("VM Core states for %s\n", vm->name); + + for (i = 0; i < 80; i++) { + V3_Print("-"); + } + + for (i = 0; i < vm->num_cores; i++) { + v3_print_guest_state(&vm->cores[i]); + } + + for (i = 0; i < 80; i++) { + V3_Print("-"); + } + + V3_Print("\n"); } @@ -390,7 +414,7 @@ void v3_print_GPRs(struct guest_info * info) { V3_Print("32 bit GPRs:\n"); for (i = 0; reg_names[i] != NULL; i++) { - V3_Print("\t%s=0x%p\n", reg_names[i], (void *)(addr_t)reg_ptr[i]); + V3_Print("\t%s=0x%p (at %p)\n", reg_names[i], (void *)(addr_t)reg_ptr[i], &(reg_ptr[i])); } } @@ -408,7 +432,7 @@ void v3_print_GPRs(struct guest_info * info) { V3_Print("64 bit GPRs:\n"); for (i = 0; reg_names[i] != NULL; i++) { - V3_Print("\t%s=0x%p\n", reg_names[i], (void *)(addr_t)reg_ptr[i]); + V3_Print("\t%s=0x%p (at %p)\n", reg_names[i], (void *)(addr_t)reg_ptr[i], &(reg_ptr[i])); } } @@ -477,6 +501,7 @@ int v3_init_vm(struct v3_vm_info * vm) { v3_init_cpuid_map(vm); v3_init_host_events(vm); v3_init_intr_routers(vm); + v3_init_ext_manager(vm); // Initialize the memory map if (v3_init_mem_map(vm) == -1) { @@ -507,15 +532,15 @@ int v3_init_vm(struct v3_vm_info * vm) { #ifdef CONFIG_SVM case V3_SVM_CPU: case V3_SVM_REV3_CPU: - v3_deinit_svm_io_map(vm); - v3_deinit_svm_msr_map(vm); + v3_init_svm_io_map(vm); + v3_init_svm_msr_map(vm); break; #endif #ifdef CONFIG_VMX case V3_VMX_CPU: case V3_VMX_EPT_CPU: - v3_deinit_vmx_io_map(vm); - v3_deinit_vmx_msr_map(vm); + v3_init_vmx_io_map(vm); + v3_init_vmx_msr_map(vm); break; #endif default: @@ -537,20 +562,25 @@ int v3_free_vm_internal(struct v3_vm_info * vm) { v3_remove_hypercall(vm, GUEST_INFO_HCALL); + +#ifdef CONFIG_SYMBIOTIC + v3_deinit_symbiotic_vm(vm); +#endif + // init SVM/VMX switch (cpu_type) { #ifdef CONFIG_SVM case V3_SVM_CPU: case V3_SVM_REV3_CPU: - v3_init_svm_io_map(vm); - v3_init_svm_msr_map(vm); + v3_deinit_svm_io_map(vm); + v3_deinit_svm_msr_map(vm); break; #endif #ifdef CONFIG_VMX case V3_VMX_CPU: case V3_VMX_EPT_CPU: - v3_init_vmx_io_map(vm); - v3_init_vmx_msr_map(vm); + v3_deinit_vmx_io_map(vm); + v3_deinit_vmx_msr_map(vm); break; #endif default: @@ -558,7 +588,28 @@ int v3_free_vm_internal(struct v3_vm_info * vm) { return -1; } - + v3_deinit_dev_mgr(vm); + + v3_deinit_time_vm(vm); + + v3_deinit_mem_hooks(vm); + v3_delete_mem_map(vm); + v3_deinit_shdw_impl(vm); + + v3_deinit_intr_routers(vm); + v3_deinit_host_events(vm); + + v3_deinit_cpuid_map(vm); + v3_deinit_msr_map(vm); + v3_deinit_io_map(vm); + v3_deinit_hypercall_map(vm); + +#ifdef CONFIG_TELEMETRY + v3_deinit_telemetry(vm); +#endif + + + return 0; } @@ -626,7 +677,7 @@ int v3_free_core(struct guest_info * core) { #ifdef CONFIG_SYMBIOTIC - //v3_deinit_symbiotic_core(core); + v3_deinit_symbiotic_core(core); #endif v3_deinit_decoder(core); @@ -640,6 +691,10 @@ int v3_free_core(struct guest_info * core) { v3_free_passthrough_pts(core); +#ifdef CONFIG_TELEMETRY + v3_deinit_core_telemetry(core); +#endif + switch (cpu_type) { #ifdef CONFIG_SVM case V3_SVM_CPU: