diff mbox

[BUG?] can not writeback more then 8 bytes memory

Message ID 4C6E46E0.4080409@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 20, 2010, 9:12 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index dc3a648..43a6819 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2213,7 +2213,8 @@  static struct opcode group5[] = {
 };
 
 static struct group_dual group7 = { {
-	N, N, D(ModRM | SrcMem | Priv), D(ModRM | SrcMem | Priv),
+	N, D(DstMem | SrcNone | ModRM | Op3264),
+	D(ModRM | SrcMem | Priv), D(ModRM | SrcMem | Priv),
 	D(SrcNone | ModRM | DstMem | Mov), N,
 	D(SrcMem16 | ModRM | Mov | Priv),
 	D(SrcMem | ModRM | ByteOp | Priv | NoAccess),
@@ -3282,6 +3283,7 @@  twobyte_insn:
 		switch (c->modrm_reg) {
 			u16 size;
 			unsigned long address;
+			struct desc_ptr dt;
 
 		case 0: /* vmcall */
 			if (c->modrm_mod != 3 || c->modrm_rm != 1)
@@ -3296,6 +3298,11 @@  twobyte_insn:
 			/* Disable writeback. */
 			c->dst.type = OP_NONE;
 			break;
+		case 1: /* sidt */
+			ops->get_idt(&dt, ctxt->vcpu);
+			c->dst.bytes = c->op_bytes + 2;
+			memcpy(&c->dst.valptr, &dt, c->dst.bytes);
+			break;
 		case 2: /* lgdt */
 			rc = read_descriptor(ctxt, ops, c->src.addr.mem,
 					     &size, &address, c->op_bytes);