Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


minor changes to organization
[palacios.git] / palacios / include / palacios / vmm_instr_decoder.h
index 4341910..60ff80a 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <palacios/vmm_types.h>
 
-
 /* .... Giant fucking switch tables */
 
 
@@ -29,6 +28,7 @@ typedef enum {
     SMSW,
     CLTS,
     INVLPG,
+    INT, // KCH: adding software interrupts
 
     MOV_CR2,
     MOV_2CR,
@@ -262,6 +262,8 @@ static int get_operand_width(struct guest_info * info, struct x86_instr * instr,
                case LONG:
                    if (instr->prefixes.rex_op_size) {
                        return 8;
+                   } else {
+                       return 4;
                    }
                case PROTECTED:
                case PROTECTED_PAE:
@@ -309,6 +311,7 @@ static int get_operand_width(struct guest_info * info, struct x86_instr * instr,
                    return -1;
            }
 
+    case INT: // KCH
        case MOV_DR2:
        case MOV_2DR:
        case MOV_CR2:
@@ -334,6 +337,7 @@ static int get_operand_width(struct guest_info * info, struct x86_instr * instr,
            return -1;
        
     }
+
     return 0;
 }
 
@@ -450,7 +454,7 @@ static inline int decode_cr(struct guest_info * core,
 
     struct v3_ctrl_regs * crs = &(core->ctrl_regs);
 
-    PrintDebug("\t Ctrl regs %d\n", reg_code);
+//    PrintDebug("\t Ctrl regs %d\n", reg_code);
 
     switch (reg_code) {
        case 0:
@@ -1334,7 +1338,10 @@ static op_form_t op_code_to_form(uint8_t * instr, int * length) {
 
        case 0xf4:
            return HLT;
-
+    
+    // KCH
+    case 0xcd:
+        return INT;
 
        case 0xf6: {
            struct modrm_byte * modrm = (struct modrm_byte *)&(instr[1]);
@@ -1497,6 +1504,7 @@ static char * op_form_to_str(op_form_t form) {
        case SETO: return "SETO";
        case STOS_8: return "STOS_8";
        case STOS: return "STOS";
+    case INT: return "INT"; // KCH
 
        case INVALID_INSTR:
        default: