aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-26 04:56:06 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:35 -0400
commit8d8f4e9f66ab36e4fcc75eca1e828af8466309f1 (patch)
treeeac8232b0446d4d7cd853da7d0ce5583680e8ebc /arch/x86/kvm/emulate.c
parent081bca0e6b87d0c7b9ade7ffee1f44aca336a8fa (diff)
KVM: x86 emulator: support byte/word opcode pairs
Many x86 instructions come in byte and word variants distinguished with bit 0 of the opcode. Add macros to aid in defining them. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 2b9b0feabdba..1a230b5495e0 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2330,6 +2330,9 @@ static int em_rdtsc(struct x86_emulate_ctxt *ctxt)
2330#define GD(_f, _g) { .flags = ((_f) | Group | GroupDual), .u.gdual = (_g) } 2330#define GD(_f, _g) { .flags = ((_f) | Group | GroupDual), .u.gdual = (_g) }
2331#define I(_f, _e) { .flags = (_f), .u.execute = (_e) } 2331#define I(_f, _e) { .flags = (_f), .u.execute = (_e) }
2332 2332
2333#define D2bv(_f) D((_f) | ByteOp), D(_f)
2334#define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e)
2335
2333static struct opcode group1[] = { 2336static struct opcode group1[] = {
2334 X7(D(Lock)), N 2337 X7(D(Lock)), N
2335}; 2338};
@@ -2572,6 +2575,9 @@ static struct opcode twobyte_table[256] = {
2572#undef GD 2575#undef GD
2573#undef I 2576#undef I
2574 2577
2578#undef D2bv
2579#undef I2bv
2580
2575static unsigned imm_size(struct decode_cache *c) 2581static unsigned imm_size(struct decode_cache *c)
2576{ 2582{
2577 unsigned size; 2583 unsigned size;