x86 emulator: Add 2 operand imul instruction (opcode 0x0f 0xaf)
PATCH 1/1 x86 emulator: Add 2 operand imul instruction (opcode 0x0f 0xaf)
--- arch/x86/kvm/emulate.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
arch/x86/kvm/emulate.c +4 -1
@@ -2474,7 +2474,7 @@ static struct opcode twobyte_table[256] = {N ,D (DstMem | SrcReg | ModRM | BitOp | Lock),D (DstMem | SrcReg | Src2ImmByte | ModRM),D (DstMem | SrcReg | Src2CL | ModRM), -D (ModRM),N , +D (ModRM),D (DstReg | SrcMem | ModRM),/* 0xB0 - 0xB7 */ D (ByteOp | DstMem | SrcReg | ModRM | Lock),D (DstMem | SrcReg | ModRM | Lock), N, D(DstMem | SrcReg | ModRM | BitOp | Lock),
@@ -3567,6 +3567,9 @@ twobyte_insn:break ;case 0xae :/* clflush */ break ; +case 0xaf : +emulate_2op_SrcV_nobyte ("imul" , c->src, c->dst, ctxt->eflags); +break ; case 0xb0 ... 0xb1: /* cmpxchg *//* * Save real source value, then compare EAX against
Signature · 1 line
1.7.0.4
Quoted 19 lines · Mohammed Gamal
Signed-off-by Mohammed Gamal<[email protected]>--- arch/x86/kvm/emulate.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)arch/x86/kvm/emulate.c +1
-1@@ -2474,7 +2474,7 @@ static struct opcode twobyte_table[256] = {N ,D (DstMem | SrcReg | ModRM | BitOp | Lock),D (DstMem | SrcReg | Src2ImmByte | ModRM),D (DstMem | SrcReg | Src2CL | ModRM), -D (ModRM),N , +D (ModRM),D (DstReg | SrcMem | ModRM),/* 0xB0 - 0xB7 */ D (ByteOp | DstMem | SrcReg | ModRM | Lock),D (DstMem | SrcReg | ModRM | Lock), N, D(DstMem | SrcReg | ModRM | BitOp | Lock),
arch/x86/kvm/emulate.c twobyte_insn: · line 3575
Quoted 9 lines
arch/x86/kvm/emulate.c +3
-0@@ -3567,6 +3567,9 @@ twobyte_insn:break ;case 0xae :/* clflush */ break ; +case 0xaf : +emulate_2op_SrcV_nobyte ("imul" , c->src, c->dst, ctxt->eflags); +break ; case 0xb0 ... 0xb1: /* cmpxchg *//* * Save real source value, then compare EAX against
I already added this, please look at the non-atomic-injection branch.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 26 lines · Avi Kivity
Quoted 25 lines · Mohammed Gamal
Signed-off-by Mohammed Gamal<[email protected]>---
arch/x86/kvm/emulate.c | 5 ++++-1 files changed, 4 insertions(+), 1 deletions(-)arch/x86/kvm/emulate.c +1
-1@@ -2474,7 +2474,7 @@ static struct opcode twobyte_table[256] = { N, D(DstMem | SrcReg | ModRM | BitOp | Lock), D(DstMem | SrcReg | Src2ImmByte | ModRM), D(DstMem | SrcReg | Src2CL | ModRM), - D(ModRM), N, + D(ModRM), D(DstReg | SrcMem | ModRM), /* 0xB0 - 0xB7 */D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
N, D(DstMem | SrcReg | ModRM | BitOp | Lock),arch/x86/kvm/emulate.c +0
-0@@ -3567,6 +3567,9 @@ twobyte_insn: break;case
0xae: /* clflush */
break;
+ case0xaf:
Quoted 9 lines
Quoted 6 lines
+
emulate_2op_SrcV_nobyte("imul", c->src, c->dst, ctxt->eflags);
+ break;
case0xb0...0xb1: /* cmpxchg */
/*
* Save real source value, then compare EAX againstI already added this, please look at the non-atomic-injection branch.
Looks like you beat me to it. I'll pull again.
Quoted 5 lines
--
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 36 lines · Mohammed Gamal
Quoted 26 lines · Avi Kivity
Quoted 25 lines · Mohammed Gamal
Signed-off-by Mohammed Gamal<[email protected]>---
arch/x86/kvm/emulate.c | 5 ++++-1 files changed, 4 insertions(+), 1 deletions(-)arch/x86/kvm/emulate.c +1
-1@@ -2474,7 +2474,7 @@ static struct opcode twobyte_table[256] = { N, D(DstMem | SrcReg | ModRM | BitOp | Lock), D(DstMem | SrcReg | Src2ImmByte | ModRM), D(DstMem | SrcReg | Src2CL | ModRM), - D(ModRM), N, + D(ModRM), D(DstReg | SrcMem | ModRM), /* 0xB0 - 0xB7 */D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
N, D(DstMem | SrcReg | ModRM | BitOp | Lock),arch/x86/kvm/emulate.c +0
-0@@ -3567,6 +3567,9 @@ twobyte_insn: break;case
0xae: /* clflush */
break;
+ case0xaf:Quoted 9 lines
Quoted 6 lines
+
emulate_2op_SrcV_nobyte("imul", c->src, c->dst, ctxt->eflags);
+ break;
case0xb0...0xb1: /* cmpxchg */
/*
* Save real source value, then compare EAX againstI already added this, please look at the non-atomic-injection branch.
Quoted 1 line
Looks like you beat me to it. I'll pull again.
Pulled again and no signs of such patch. imul is not implemented there. Did you push your changes?
Quoted 3 lines · Mohammed Gamal
Pulled again and no signs of such patch. imul is not implemented there. Did you push your changes?
It's 738cee07673.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 6 lines · Avi Kivity
Quoted 3 lines · Mohammed Gamal
Pulled again and no signs of such patch. imul is not implemented there. Did you push your changes?
It's 738cee07673.d
Pulled again and it is there now, thanks.
Quoted 6 lines
--
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.