From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Yongjun Subject: [PATCH 2/3 v2] KVM: x86 emulator: do not adjust the address for immediate source Date: Mon, 09 Aug 2010 11:37:37 +0800 Message-ID: <4C5F7801.3020702@cn.fujitsu.com> References: <4C5BB725.3060609@cn.fujitsu.com> <4C5F1379.5040401@redhat.com> <4C5F7760.2030106@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:52052 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755266Ab0HIDj7 (ORCPT ); Sun, 8 Aug 2010 23:39:59 -0400 In-Reply-To: <4C5F7760.2030106@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: adjust the dst address for a register source but not adjust the address for an immediate source. Signed-off-by: Wei Yongjun --- arch/x86/kvm/emulate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f48890d..161d361 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -728,7 +728,7 @@ static void fetch_bit_operand(struct decode_cache *c) { long sv, mask; - if (c->dst.type == OP_MEM) { + if (c->dst.type == OP_MEM && c->src.type == OP_REG) { mask = ~(c->dst.bytes * 8 - 1); if (c->src.bytes == 2) -- 1.7.0.4