diff options
author | neel <neel@FreeBSD.org> | 2013-08-27 16:49:20 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-08-27 16:49:20 +0000 |
commit | 99ab2bf08eb4c6c6bab630a6a655ca024838e010 (patch) | |
tree | 924cbef80ec0eb75bbab3212576e40d1268f4fdc | |
parent | 14b16775515537edf64104960d90f55cdcb5bc99 (diff) | |
download | FreeBSD-src-99ab2bf08eb4c6c6bab630a6a655ca024838e010.zip FreeBSD-src-99ab2bf08eb4c6c6bab630a6a655ca024838e010.tar.gz |
Add support for emulating the byte move instruction "mov r/m8, r8".
This emulation is required when dumping MMIO space via the ddb "examine"
command.
-rw-r--r-- | sys/amd64/vmm/vmm_instruction_emul.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index f90443e..4af22d4 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -77,6 +77,10 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x89, .op_type = VIE_OP_TYPE_MOV, }, + [0x8A] = { + .op_byte = 0x8A, + .op_type = VIE_OP_TYPE_MOV, + }, [0x8B] = { .op_byte = 0x8B, .op_type = VIE_OP_TYPE_MOV, @@ -268,13 +272,18 @@ emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, error = memwrite(vm, vcpuid, gpa, val, size, arg); } break; + case 0x8A: case 0x8B: /* * MOV from mem (ModRM:r/m) to reg (ModRM:reg) + * 8A/r: mov r/m8, r8 + * REX + 8A/r: mov r/m8, r8 * 8B/r: mov r32, r/m32 * REX.W 8B/r: mov r64, r/m64 */ - if (vie->rex_w) + if (vie->op.op_byte == 0x8A) + size = 1; + else if (vie->rex_w) size = 8; error = memread(vm, vcpuid, gpa, &val, size, arg); if (error == 0) { @@ -688,7 +697,6 @@ decode_modrm(struct vie *vie) vie->base_register = VM_REG_GUEST_RIP; else vie->base_register = VM_REG_LAST; - } break; } |