X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_decoder.h;h=ef08031875a4d7ec0fe62e8e0e77c2949fa77ebd;hb=9dd0a80f28ca47a1fb69992dcd96e7526bf5175c;hp=130e1ae19148f1a3bc49a665162556032eacf241;hpb=d38ca6817962f46012fae1b014a24372494f4d7c;p=palacios-OLD.git diff --git a/palacios/include/palacios/vmm_decoder.h b/palacios/include/palacios/vmm_decoder.h index 130e1ae..ef08031 100644 --- a/palacios/include/palacios/vmm_decoder.h +++ b/palacios/include/palacios/vmm_decoder.h @@ -10,7 +10,7 @@ typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND} operand_type_t; - +int parse(); struct x86_operand { @@ -165,8 +165,11 @@ static inline v3_reg_t get_gpr_mask(struct guest_info * info) { static inline addr_t get_addr_linear(struct guest_info * info, addr_t addr, struct v3_segment * seg) { switch (info->cpu_mode) { case REAL: - return addr + (seg->selector << 4); - break; + // It appears that the segment values are computed and cached in the vmcb structure + // We Need to check this for Intel + /* return addr + (seg->selector << 4); + break;*/ + case PROTECTED: return addr + seg->base; break; @@ -254,14 +257,14 @@ static inline operand_type_t decode_operands16(struct v3_gprs * gprs, // input/o operand_type_t addr_type = INVALID_OPERAND; char * instr_cursor = modrm_instr; - PrintDebug("ModRM mod=%d\n", modrm->mod); + // PrintDebug("ModRM mod=%d\n", modrm->mod); instr_cursor += 1; if (modrm->mod == 3) { mod_mode = REG; addr_type = REG_OPERAND; - PrintDebug("first operand = Register (RM=%d)\n",modrm->rm); + //PrintDebug("first operand = Register (RM=%d)\n",modrm->rm); *first_operand = decode_register(gprs, modrm->rm, reg_size); @@ -352,7 +355,7 @@ static inline operand_type_t decode_operands32(struct v3_gprs * gprs, // input/o mod_mode = REG; addr_type = REG_OPERAND; - PrintDebug("first operand = Register (RM=%d)\n",modrm->rm); + // PrintDebug("first operand = Register (RM=%d)\n",modrm->rm); *first_operand = decode_register(gprs, modrm->rm, reg_size);