X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=4c37ddf4d2ecd7318e1707e5021f59ee067fc159;hb=1b72cd1ffc37529af00e7e0a04034a67dad0c786;hp=2a461b972bcfdd9dfe00cb5096d7ddb8134fbd35;hpb=3e5e5a12e64630d7a37ed32b8d7e2d993c79f7e0;p=palacios.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 2a461b9..4c37ddf 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -199,10 +199,7 @@ static int init_vmcs_bios(struct guest_info * info, struct vmx_data * vmx_state) /********** Setup and VMX Control Fields from MSR ***********/ /* Setup IO map */ - /***** THEES NEED TO BE MOVED TO A GLOBAL LOCATION ***/ - v3_init_vmx_io_map(info->vm_info); - v3_init_vmx_msr_map(info->vm_info); - /**** ****/ + struct v3_msr tmp_msr; @@ -647,8 +644,8 @@ int v3_vmx_enter(struct guest_info * info) { v3_vmx_restore_vmcs(info); -#ifdef CONFIG_SYMBIOTIC - if (info->vm_info->sym_state.symcalls[info->cpu_id].sym_call_active == 0) { +#ifdef CONFIG_SYMCALL + if (info->sym_core_state.symcall_state.sym_call_active == 0) { update_irq_entry_state(info); } #else @@ -709,8 +706,8 @@ int v3_vmx_enter(struct guest_info * info) { exit_log[info->num_exits % 10] = exit_info; -#ifdef CONFIG_SYMBIOTIC - if (info->vm_info->sym_state.symcalls[info->cpu_id].sym_call_active == 0) { +#ifdef CONFIG_SYMCALL + if (info->sym_core_state.symcall_state.sym_call_active == 0) { update_irq_exit_state(info); } #else @@ -797,7 +794,7 @@ void v3_init_vmx_cpu(int cpu_id) { uint64_t ret = 0; v3_get_msr(VMX_CR4_FIXED0_MSR,&(tmp_msr.hi),&(tmp_msr.lo)); - +#ifdef __V3_64BIT__ __asm__ __volatile__ ( "movq %%cr4, %%rbx;" "orq $0x00002000, %%rbx;" @@ -826,6 +823,38 @@ void v3_init_vmx_cpu(int cpu_id) { : : "%rbx" ); +#elif __V3_32BIT__ + __asm__ __volatile__ ( + "movq %%cr4, %%ecx;" + "orq $0x00002000, %%ecx;" + "movq %%ecx, %0;" + : "=m"(ret) + : + : "%ecx" + ); + + if ((~ret & tmp_msr.value) == 0) { + __asm__ __volatile__ ( + "movq %0, %%cr4;" + : + : "q"(ret) + ); + } else { + PrintError("Invalid CR4 Settings!\n"); + return; + } + + __asm__ __volatile__ ( + "movq %%cr0, %%ecx; " + "orq $0x00000020,%%ecx; " + "movq %%ecx, %%cr0;" + : + : + : "%ecx" + ); + +#endif + // // Should check and return Error here....