Browse Source

KVM: x86 emulator: initialize src.val and dst.val for register operands

This lets us treat the case where mod == 3 in the same manner as other cases.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Avi Kivity 17 years ago
parent
commit
66b8550573
1 changed files with 2 additions and 0 deletions
  1. 2 0
      arch/x86/kvm/x86_emulate.c

+ 2 - 0
arch/x86/kvm/x86_emulate.c

@@ -1001,6 +1001,7 @@ done_prefixes:
 		 */
 		if ((c->d & ModRM) && c->modrm_mod == 3) {
 			c->src.type = OP_REG;
+			c->src.val = c->modrm_val;
 			break;
 		}
 		c->src.type = OP_MEM;
@@ -1044,6 +1045,7 @@ done_prefixes:
 	case DstMem:
 		if ((c->d & ModRM) && c->modrm_mod == 3) {
 			c->dst.type = OP_REG;
+			c->dst.val = c->dst.orig_val = c->modrm_val;
 			break;
 		}
 		c->dst.type = OP_MEM;