X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_emulator.c;h=3294aa0dec2d8bb3e816f4e6af29c464813e2661;hb=5db3136d5331c355c188537c68005db8d2cb4eac;hp=3fedc517951140aab01d13d124d33fb2b35bedd3;hpb=c373d9a80b116014c546e7761982fedf7419664b;p=palacios.git diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index 3fedc51..3294aa0 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -1,3 +1,22 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Jack Lange + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + #include #include #include @@ -121,7 +140,7 @@ int v3_emulate_memory_read(struct guest_info * info, addr_t read_gva, int (*read)(addr_t read_addr, void * dst, uint_t length, void * priv_data), addr_t read_gpa, void * private_data) { struct basic_instr_info instr_info; - char instr[15]; + uchar_t instr[15]; int ret; struct emulated_page * data_page = V3_Malloc(sizeof(struct emulated_page)); addr_t data_addr_offset = PT32_PAGE_OFFSET(read_gva); @@ -204,20 +223,26 @@ int v3_emulate_memory_write(struct guest_info * info, addr_t write_gva, addr_t write_gpa, void * private_data) { struct basic_instr_info instr_info; - char instr[15]; + uchar_t instr[15]; int ret; struct write_region * write_op = V3_Malloc(sizeof(struct write_region )); struct emulated_page * data_page = V3_Malloc(sizeof(struct emulated_page)); addr_t data_addr_offset = PT32_PAGE_OFFSET(write_gva); pte32_t saved_pte; + int i; - PrintDebug("Emulating Write\n"); + PrintDebug("Emulating Write for instruction at 0x%x\n",info->rip); if (info->mem_mode == PHYSICAL_MEM) { ret = read_guest_pa_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } else { ret = read_guest_va_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr); } + + + PrintDebug("Instruction is"); + for (i=0;i<15;i++) { PrintDebug(" 0x%x",instr[i]); } + PrintDebug("\n"); if (v3_basic_mem_decode(info, (addr_t)instr, &instr_info) == -1) { PrintError("Could not do a basic memory instruction decode\n"); @@ -226,6 +251,10 @@ int v3_emulate_memory_write(struct guest_info * info, addr_t write_gva, return -1; } + if (instr_info.has_rep==1) { + PrintDebug("Emulated instruction has rep\n"); + } + /* if (instr_info.has_rep == 1) { PrintError("We currently don't handle rep* instructions\n");