X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fsvm_io.c;h=95828936b4662000924228c2ecae702d804e48a2;hb=a31286a91d6a84a60b34ee088517ee5d0d2176b0;hp=e5735497e530f2d1a3bf4c8476a5da7b92b4aa27;hpb=6b22aca151afafdf17b8f0d8e52e3a4142b9ca03;p=palacios.git diff --git a/palacios/src/geekos/svm_io.c b/palacios/src/geekos/svm_io.c index e573549..9582893 100644 --- a/palacios/src/geekos/svm_io.c +++ b/palacios/src/geekos/svm_io.c @@ -55,18 +55,12 @@ int handle_svm_io_ins(struct guest_info * info) { vmm_io_hook_t * hook = get_io_hook(&(info->io_map), io_info->port); uint_t read_size = 0; - addr_t base_addr = 0; + addr_t base_addr = guest_state->es.base ; addr_t dst_addr = 0; uint_t rep_num = 1; ullong_t mask = 0; - if (info->cpu_mode == REAL) { - base_addr = (guest_state->es.base << 4); - } else if (info->cpu_mode == PROTECTED) { - base_addr = guest_state->es.base; - } - // This is kind of hacky... // direction can equal either 1 or -1 @@ -113,7 +107,7 @@ int handle_svm_io_ins(struct guest_info * info) { while (rep_num > 0) { addr_t host_addr; - dst_addr = base_addr + (info->vm_regs.rdi & mask); + dst_addr = get_addr_linear(info, info->vm_regs.rdi & mask, base_addr); if (guest_va_to_host_va(info, dst_addr, &host_addr) == -1) { // either page fault or gpf... @@ -185,19 +179,13 @@ int handle_svm_io_outs(struct guest_info * info) { vmm_io_hook_t * hook = get_io_hook(&(info->io_map), io_info->port); uint_t write_size = 0; - addr_t base_addr = 0; + addr_t base_addr = guest_state->ds.base; addr_t dst_addr = 0; uint_t rep_num = 1; ullong_t mask = 0; - if (info->cpu_mode == REAL) { - base_addr = (guest_state->ds.base << 4); - } else if (info->cpu_mode == PROTECTED) { - base_addr = guest_state->ds.base; - } - // This is kind of hacky... // direction can equal either 1 or -1 // We will multiply the final added offset by this value to go the correct direction @@ -242,7 +230,7 @@ int handle_svm_io_outs(struct guest_info * info) { while (rep_num > 0) { addr_t host_addr; - dst_addr = base_addr + (info->vm_regs.rsi & mask); + dst_addr = get_addr_linear(info, (info->vm_regs.rsi & mask), base_addr); if (guest_va_to_host_va(info, dst_addr, &host_addr) == -1) { // either page fault or gpf...