From: Jack Lange Date: Fri, 4 Apr 2008 18:59:24 +0000 (+0000) Subject: quick fix for segmentation bug: X-Git-Tag: working-cdboot-physical-but-not-qemu~41 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=6b22aca151afafdf17b8f0d8e52e3a4142b9ca03 quick fix for segmentation bug: --- diff --git a/palacios/src/geekos/svm_io.c b/palacios/src/geekos/svm_io.c index 96c746d..e573549 100644 --- a/palacios/src/geekos/svm_io.c +++ b/palacios/src/geekos/svm_io.c @@ -55,11 +55,19 @@ 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 = guest_state->es.base; + addr_t base_addr = 0; 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 // We will multiply the final added offset by this value to go the correct direction @@ -177,11 +185,19 @@ 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 = guest_state->ds.base; + addr_t base_addr = 0; 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