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.


added 64 bit operand support
[palacios.git] / palacios / src / palacios / vmm_v3dec.c
index dd0abd9..1b2436f 100644 (file)
@@ -80,8 +80,16 @@ int v3_decode(struct guest_info * core, addr_t instr_ptr, struct x86_instr * ins
 
     // REX prefix
     if (v3_get_vm_cpu_mode(core) == LONG) {
-       if ((*(uint8_t *)(instr_ptr + length) & 0xf0) == 0x40) {
-           *(uint8_t *)&(instr->prefixes.rex) = *(uint8_t *)(instr_ptr + length);
+       uint8_t prefix = *(uint8_t *)(instr_ptr + length);
+
+       if ((prefix & 0xf0) == 0x40) {
+           instr->prefixes.rex = 1;
+
+           instr->prefixes.rex_rm = (prefix & 0x01);
+           instr->prefixes.rex_sib_idx = ((prefix & 0x02) >> 1);
+           instr->prefixes.rex_reg = ((prefix & 0x04) >> 2);
+           instr->prefixes.rex_op_size = ((prefix & 0x08) >> 3);
+
            length += 1;
        }
     }