X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=d533c9276b64c3ce15a1b666627be2a3af133d4a;hb=32694d99c15e00731a240e0fccea252e08bf5ada;hp=86629d31fe06d425fa6165b5d8681ed940695bb0;hpb=0c1919011d9ce503de86b4f9f334cbddda1be182;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 86629d3..d533c92 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -38,10 +38,6 @@ -extern uint_t Get_CR3(); - - - extern void v3_stgi(); extern void v3_clgi(); extern int v3_svm_launch(vmcb_t * vmcb, struct v3_gprs * vm_regs); @@ -79,6 +75,7 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { /* Set up the efer to enable 64 bit page tables */ + /* { struct efer_64 * efer = (struct efer_64 *)&(guest_state->efer); struct cr4_32 * cr4 = (struct cr4_32 *)&(guest_state->cr4); @@ -87,6 +84,7 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { cr4->pae = 1; } + */ guest_state->efer |= EFER_MSR_svm_enable; @@ -213,7 +211,13 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { if (vm_info->shdw_pg_mode == SHADOW_PAGING) { PrintDebug("Creating initial shadow page table\n"); - vm_info->direct_map_pt = (addr_t)V3_PAddr(create_passthrough_pde32_pts(vm_info)); + + + + /* Testing 64 bit page tables for long paged real mode guests */ + // vm_info->direct_map_pt = (addr_t)V3_PAddr(create_passthrough_pts_64(vm_info)); + vm_info->direct_map_pt = (addr_t)V3_PAddr(create_passthrough_pts_32(vm_info)); + /* End Test */ //vm_info->shdw_pg_state.shadow_cr3 |= (vm_info->direct_map_pt & ~0xfff); vm_info->shdw_pg_state.shadow_cr3 = 0; @@ -256,7 +260,7 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { PrintDebug("NP_Enable at 0x%p\n", (void *)&(ctrl_area->NP_ENABLE)); // Set the Nested Page Table pointer - vm_info->direct_map_pt = ((addr_t)create_passthrough_pde32_pts(vm_info) & ~0xfff); + vm_info->direct_map_pt = ((addr_t)create_passthrough_pts_32(vm_info) & ~0xfff); ctrl_area->N_CR3 = vm_info->direct_map_pt; // ctrl_area->N_CR3 = Get_CR3(); @@ -327,7 +331,7 @@ static int start_svm_guest(struct guest_info *info) { v3_clgi(); - PrintDebug("SVM Entry to rip=%p...\n", (void *)info->rip); + //PrintDebug("SVM Entry to rip=%p...\n", (void *)info->rip); v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low); @@ -339,7 +343,7 @@ static int start_svm_guest(struct guest_info *info) { rdtscll(tmp_tsc); v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low); - PrintDebug("SVM Returned\n"); + //PrintDebug("SVM Returned\n"); #if PrintDebug @@ -353,11 +357,11 @@ static int start_svm_guest(struct guest_info *info) { v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc); num_exits++; - PrintDebug("Turning on global interrupts\n"); + //PrintDebug("Turning on global interrupts\n"); v3_stgi(); - PrintDebug("SVM Exit number %d\n", num_exits); + //PrintDebug("SVM Exit number %d\n", num_exits); @@ -370,7 +374,7 @@ static int start_svm_guest(struct guest_info *info) { PrintDebug("SVM ERROR!!\n"); - PrintDebug("RIP: %p\n", (void *)guest_state->rip); + PrintDebug("RIP: %p\n", (void *)(addr_t)(guest_state->rip)); linear_addr = get_addr_linear(info, guest_state->rip, &(info->segments.cs)); @@ -686,7 +690,7 @@ void v3_init_SVM(struct v3_ctrl_ops * vmm_ops) { if (vm_info.page_mode == SHADOW_PAGING) { PrintDebug("Creating initial shadow page table\n"); - vm_info.shdw_pg_state.shadow_cr3 |= ((addr_t)create_passthrough_pde32_pts(&vm_info) & ~0xfff); + vm_info.shdw_pg_state.shadow_cr3 |= ((addr_t)create_passthrough_pts_32(&vm_info) & ~0xfff); PrintDebug("Created\n"); guest_state->cr3 = vm_info.shdw_pg_state.shadow_cr3;