X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_xed.c;h=3511f8a2383c2eba2bbfda616e41c0b73fed1ee6;hb=9928ec9289de6658a2830370b1d1b514833515d0;hp=7c1c13e5065ce3589b83bde1fe16bf0f028bc332;hpb=2f94a8dfea7209ee001ab014f5668c360320f14f;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_xed.c b/palacios/src/palacios/vmm_xed.c index 7c1c13e..3511f8a 100644 --- a/palacios/src/palacios/vmm_xed.c +++ b/palacios/src/palacios/vmm_xed.c @@ -147,17 +147,16 @@ static int set_decoder_mode(struct guest_info * info, xed_state_t * state) { } /* -static int is_flags_reg(xed_reg_enum_t xed_reg) { - switch (xed_reg) { - case XED_REG_FLAGS: - case XED_REG_EFLAGS: - case XED_REG_RFLAGS: - return 1; - default: - return 0; - } -} - + static int is_flags_reg(xed_reg_enum_t xed_reg) { + switch (xed_reg) { + case XED_REG_FLAGS: + case XED_REG_EFLAGS: + case XED_REG_RFLAGS: + return 1; + default: + return 0; + } + } */ int v3_init_decoder(struct guest_info * info) { @@ -433,8 +432,6 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins default: PrintError("Unhandled Operand Type\n"); return -1; - - } } } @@ -472,10 +469,7 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins } v3_op->type = REG_OPERAND; - - } else { - switch (op_enum) { case XED_OPERAND_MEM0: @@ -517,7 +511,6 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins return -1; } } - } // set third operand @@ -545,17 +538,12 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins instr->third_operand.type = REG_OPERAND; - } else { PrintError("Unhandled third operand type %s\n", xed_operand_type_enum_t2str(op_type)); - return -1; + instr->num_operands = 2; } - - } - - return 0; } @@ -580,7 +568,7 @@ static int get_memory_operand(struct guest_info * info, xed_decoded_inst_t * xe int addr_width = v3_get_addr_width(info);; // struct v3_segment * seg_reg; - PrintDebug("Xen mode = %s\n", xed_machine_mode_enum_t2str(xed_state_get_machine_mode(info->decoder_state))); + PrintDebug("Xed mode = %s\n", xed_machine_mode_enum_t2str(xed_state_get_machine_mode(info->decoder_state))); PrintDebug("Address width: %s\n", xed_address_width_enum_t2str(xed_state_get_address_width(info->decoder_state))); PrintDebug("Stack Address width: %s\n", @@ -657,7 +645,7 @@ static int get_memory_operand(struct guest_info * info, xed_decoded_inst_t * xe // This is a horrendous hack... // XED really screwed the pooch in calculating the displacement - if (v3_get_cpu_mode(info) == LONG) { + if (v3_get_vm_cpu_mode(info) == LONG) { displacement = mem_op.displacement; } else { displacement = MASK(mem_op.displacement, mem_op.displacement_size);