diff mbox

PATCH 2/3] KVM: x86 emulator: do not adjust the address for immediate source

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

Commit Message

Wei Yongjun Aug. 6, 2010, 7:20 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 470c7eb..e7e3d2d 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)
 {
 	unsigned long mask, byte_offset;
 
-	if (c->dst.type == OP_MEM) {
+	if (c->dst.type == OP_MEM && c->src.type == OP_REG) {
 		if (c->src.bytes == 2)
 			c->src.val = (s16)c->src.val;
 		else if (c->src.bytes == 4)