summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-04-12 12:36:14 +0200
committerAvi Kivity <avi@redhat.com>2009-06-10 10:48:40 +0200
commita5f868bd45a64ce1f502d228723a5b6c357790cd (patch)
treeeb67ac51d8fecd1308e5d274a39a6e7e1420343c /arch
parentKVM: MMU: remove global page optimization logic (diff)
downloadlinux-a5f868bd45a64ce1f502d228723a5b6c357790cd.tar.xz
linux-a5f868bd45a64ce1f502d228723a5b6c357790cd.zip
KVM: x86 emulator: Add decoding of 16bit second immediate argument
Such as segment number in lcall/ljmp Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86_emulate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index d7c9f6fd0d34..c0150636d453 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -76,6 +76,7 @@
#define Src2CL (1<<29)
#define Src2ImmByte (2<<29)
#define Src2One (3<<29)
+#define Src2Imm16 (4<<29)
#define Src2Mask (7<<29)
enum {
@@ -1072,6 +1073,12 @@ done_prefixes:
c->src2.bytes = 1;
c->src2.val = insn_fetch(u8, 1, c->eip);
break;
+ case Src2Imm16:
+ c->src2.type = OP_IMM;
+ c->src2.ptr = (unsigned long *)c->eip;
+ c->src2.bytes = 2;
+ c->src2.val = insn_fetch(u16, 2, c->eip);
+ break;
case Src2One:
c->src2.bytes = 1;
c->src2.val = 1;