From: Jack Lange Date: Wed, 22 Oct 2008 02:13:14 +0000 (-0500) Subject: fixed ins/outs and moved the gs.base save/restore point X-Git-Tag: 1.0^2~22 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=a1e2f463ccac3d46ae9410156ae0679bbeb1ce09 fixed ins/outs and moved the gs.base save/restore point --- diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 4913513..b9f4a9f 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -307,44 +307,22 @@ static int start_svm_guest(struct guest_info *info) { v3_enable_ints(); v3_clgi(); - { - - v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low); - - PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); - /* - v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low); - - PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); - */ - - } PrintDebug("SVM Entry to rip=%x...\n", info->rip); + v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low); + rdtscll(info->time_state.cached_host_tsc); + guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc; v3_svm_launch((vmcb_t*)V3_PAddr(info->vmm_data), &(info->vm_regs)); - rdtscll(tmp_tsc); - PrintDebug("SVM Returned\n"); - - - { - - v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low); - PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); - - /* - v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low); + v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low); + PrintDebug("SVM Returned\n"); - PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); - */ - } - { uint_t x = 0; PrintDebug("RSP=%p\n", &x); diff --git a/palacios/src/palacios/svm_io.c b/palacios/src/palacios/svm_io.c index cad3fbe..c46d45a 100644 --- a/palacios/src/palacios/svm_io.c +++ b/palacios/src/palacios/svm_io.c @@ -114,7 +114,7 @@ int v3_handle_svm_io_ins(struct guest_info * info) { addr_t inst_ptr; - if (guest_va_to_host_pa(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) { + if (guest_va_to_host_va(info, get_addr_linear(info, info->rip, &(info->segments.cs)), &inst_ptr) == -1) { PrintError("Can't access instruction\n"); return -1; } @@ -325,7 +325,7 @@ int v3_handle_svm_io_outs(struct guest_info * info) { addr_t inst_ptr; - if (guest_va_to_host_pa(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) { + if (guest_va_to_host_va(info,get_addr_linear(info,info->rip,&(info->segments.cs)),&inst_ptr)==-1) { PrintError("Can't access instruction\n"); return -1; }