From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH 3/3] KVM: x86 emulator: mask group 8 instruction as BitOp
Date: Fri, 06 Aug 2010 15:21:59 +0800 [thread overview]
Message-ID: <4C5BB817.7030800@cn.fujitsu.com> (raw)
In-Reply-To: <4C5BB725.3060609@cn.fujitsu.com>
Mask group 8 instruction as BitOp, so we can share the
code for adjust the source operand.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
arch/x86/kvm/emulate.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index e7e3d2d..dc6a74e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -746,6 +746,9 @@ static void fetch_bit_operand(struct decode_cache *c)
c->dst.addr.mem += (c->src.val & mask) / 8;
}
}
+
+ /* only subword offset */
+ c->src.val &= (c->dst.bytes << 3) - 1;
}
static int read_emulated(struct x86_emulate_ctxt *ctxt,
@@ -2346,7 +2349,7 @@ static struct opcode twobyte_table[256] = {
D(DstReg | SrcMem16 | ModRM | Mov),
/* 0xB8 - 0xBF */
N, N,
- G(0, group8), D(DstMem | SrcReg | ModRM | BitOp | Lock),
+ G(BitOp, group8), D(DstMem | SrcReg | ModRM | BitOp | Lock),
N, N, D(ByteOp | DstReg | SrcMem | ModRM | Mov),
D(DstReg | SrcMem16 | ModRM | Mov),
/* 0xC0 - 0xCF */
@@ -3420,8 +3423,6 @@ twobyte_insn:
break;
case 0xab:
bts: /* bts */
- /* only subword offset */
- c->src.val &= (c->dst.bytes << 3) - 1;
emulate_2op_SrcV_nobyte("bts", c->src, c->dst, ctxt->eflags);
break;
case 0xac: /* shrd imm8, r, r/m */
@@ -3449,8 +3450,6 @@ twobyte_insn:
break;
case 0xb3:
btr: /* btr */
- /* only subword offset */
- c->src.val &= (c->dst.bytes << 3) - 1;
emulate_2op_SrcV_nobyte("btr", c->src, c->dst, ctxt->eflags);
break;
case 0xb6 ... 0xb7: /* movzx */
@@ -3472,8 +3471,6 @@ twobyte_insn:
break;
case 0xbb:
btc: /* btc */
- /* only subword offset */
- c->src.val &= (c->dst.bytes << 3) - 1;
emulate_2op_SrcV_nobyte("btc", c->src, c->dst, ctxt->eflags);
break;
case 0xbe ... 0xbf: /* movsx */
--
1.7.0.4
next prev parent reply other threads:[~2010-08-06 7:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 7:17 [PATCH 1/3] KVM: x86 emulator: fix negative bit offset BitOp instruction emulation Wei Yongjun
2010-08-06 7:20 ` PATCH 2/3] KVM: x86 emulator: do not adjust the address for immediate source Wei Yongjun
2010-08-06 7:26 ` [PATCH 2/3 v2] " Wei Yongjun
2010-08-06 7:21 ` Wei Yongjun [this message]
2010-08-06 8:10 ` [PATCH 1/3] KVM: x86 emulator: fix negative bit offset BitOp instruction emulation Paolo Bonzini
2010-08-08 20:28 ` Avi Kivity
2010-08-09 3:34 ` [PATCH 1/3 v2] " Wei Yongjun
2010-08-09 3:37 ` [PATCH 2/3 v2] KVM: x86 emulator: do not adjust the address for immediate source Wei Yongjun
2010-08-09 3:39 ` [PATCH 3/3 v2] KVM: x86 emulator: mask group 8 instruction as BitOp Wei Yongjun
2010-08-10 2:46 ` [PATCH 1/3 v2] KVM: x86 emulator: fix negative bit offset BitOp instruction emulation Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C5BB817.7030800@cn.fujitsu.com \
--to=yjwei@cn.fujitsu.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.