From: Kyle Hale Date: Wed, 26 Oct 2011 22:28:47 +0000 (-0400) Subject: Previous software interrupt support was added to Xed, but I wasn't using the kernel X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=3c6a3b61c1fbd76c55c63440276d21fa8e79ab16;p=palacios.git Previous software interrupt support was added to Xed, but I wasn't using the kernel module then. After switching to the kernel module it appeared that there was no support in the internal decoder for INTs. This commit adds this support, and corrects a previous error in calculating the operand width of an INT instruction. --- diff --git a/palacios/include/palacios/vmm_instr_decoder.h b/palacios/include/palacios/vmm_instr_decoder.h index 6e33c46..53831c4 100644 --- a/palacios/include/palacios/vmm_instr_decoder.h +++ b/palacios/include/palacios/vmm_instr_decoder.h @@ -191,6 +191,7 @@ static int get_operand_width(struct guest_info * info, struct x86_instr * instr, case XOR_MEM2_8: case XOR_IMM2_8: case INC_8: + case INT: case DEC_8: case NEG_8: case NOT_8: @@ -310,7 +311,7 @@ static int get_operand_width(struct guest_info * info, struct x86_instr * instr, return -1; } - case INT: + //case INT: case MOV_DR2: case MOV_2DR: case MOV_CR2: diff --git a/palacios/src/palacios/vmm_v3dec.c b/palacios/src/palacios/vmm_v3dec.c index 5980dcb..343be38 100644 --- a/palacios/src/palacios/vmm_v3dec.c +++ b/palacios/src/palacios/vmm_v3dec.c @@ -448,6 +448,15 @@ static int parse_operands(struct guest_info * core, uint8_t * instr_ptr, break; } + case INT: { + instr->dst_operand.type = IMM_OPERAND; + instr->dst_operand.size = operand_width; + instr->dst_operand.operand = *(uint8_t *)instr_ptr; + instr_ptr += operand_width; + instr->num_operands = 1; + + break; + } case INVLPG: { uint8_t reg_code = 0; @@ -505,7 +514,7 @@ static v3_op_type_t op_form_to_type(op_form_t form) { case INVLPG: return V3_OP_INVLPG; - case INT: + case INT: return V3_OP_INT; case MOV_CR2: