From patchwork Fri Aug 20 09:12:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 120589 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7K9EDci017311 for ; Fri, 20 Aug 2010 09:14:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967Ab0HTJOH (ORCPT ); Fri, 20 Aug 2010 05:14:07 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:55564 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751752Ab0HTJOF (ORCPT ); Fri, 20 Aug 2010 05:14:05 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id BF3A517014B for ; Fri, 20 Aug 2010 17:14:08 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o7K9Am31022305 for ; Fri, 20 Aug 2010 17:10:48 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 3BA4814C021 for ; Fri, 20 Aug 2010 17:15:08 +0800 (CST) Message-ID: <4C6E46E0.4080409@cn.fujitsu.com> Date: Fri, 20 Aug 2010 17:12:00 +0800 From: Wei Yongjun User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5 MIME-Version: 1.0 To: kvm@vger.kernel.org Subject: [BUG?] can not writeback more then 8 bytes memory Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 09:14:13 +0000 (UTC) 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);