Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2013 16:49:21 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254964 - head/sys/amd64/vmm
Message-ID:  <201308271649.r7RGnLjI099445@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Tue Aug 27 16:49:20 2013
New Revision: 254964
URL: http://svnweb.freebsd.org/changeset/base/254964

Log:
  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.

Modified:
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==============================================================================
--- head/sys/amd64/vmm/vmm_instruction_emul.c	Tue Aug 27 16:45:00 2013	(r254963)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c	Tue Aug 27 16:49:20 2013	(r254964)
@@ -77,6 +77,10 @@ static const struct vie_op one_byte_opco
 		.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
 			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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308271649.r7RGnLjI099445>