X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_assist.c;h=5766b15c4f06b3d805e45cd285bcaa935f6f065e;hp=fa67d975461a934b16c9600aab9a74fe5a609d47;hb=a34275476494aeabed460b284a70cfc9b66a9896;hpb=77472ac6e4de7f87a8d8b8c9a554e1fcb05206a5 diff --git a/palacios/src/palacios/vmx_assist.c b/palacios/src/palacios/vmx_assist.c index fa67d97..5766b15 100644 --- a/palacios/src/palacios/vmx_assist.c +++ b/palacios/src/palacios/vmx_assist.c @@ -304,14 +304,10 @@ int v3_vmxassist_init(struct guest_info * core, struct vmx_data * vmx_state) { }; - addr_t vmxassist_gdt = 0; - - if (v3_gpa_to_hva(core, VMXASSIST_GDT, &vmxassist_gdt) == -1) { - PrintError(core->vm_info, core, "Could not find VMXASSIST GDT destination\n"); + if (v3_write_gpa_memory(core, VMXASSIST_GDT, sizeof(uint64_t)*5, (void*)gdt)!=sizeof(uint64_t)*5) { + PrintError(core->vm_info, core, "Could not write VMXASSIST GDT\n"); return -1; } - - memcpy((void *)vmxassist_gdt, gdt, sizeof(uint64_t) * 5); core->segments.gdtr.base = VMXASSIST_GDT; @@ -366,15 +362,12 @@ int v3_vmxassist_init(struct guest_info * core, struct vmx_data * vmx_state) { extern uint8_t v3_vmxassist_start[]; extern uint8_t v3_vmxassist_end[]; - addr_t vmxassist_dst = 0; - if (v3_gpa_to_hva(core, VMXASSIST_START, &vmxassist_dst) == -1) { - PrintError(core->vm_info, core, "Could not find VMXASSIST destination\n"); + if (v3_write_gpa_memory(core, VMXASSIST_START, v3_vmxassist_end-v3_vmxassist_start,v3_vmxassist_start)!=v3_vmxassist_end-v3_vmxassist_start) { + PrintError(core->vm_info, core, "Could not write VMXASSIST\n"); return -1; } - memcpy((void *)vmxassist_dst, v3_vmxassist_start, v3_vmxassist_end - v3_vmxassist_start); - vmx_state->assist_state = VMXASSIST_OFF; }