diff options
author | Avi Kivity <avi.kivity@gmail.com> | 2013-01-04 16:18:53 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-01-09 17:39:28 -0200 |
commit | f7857f35dbf8e7ca36ebff3f43888fd3fb0f0e70 (patch) | |
tree | 4da1172c30be9e451cb312cc0327d5f95a38bb05 /arch/x86 | |
parent | 45a1467d7edff741d97a8be28342440ee65aa03c (diff) | |
download | linux-3.10-f7857f35dbf8e7ca36ebff3f43888fd3fb0f0e70.tar.gz linux-3.10-f7857f35dbf8e7ca36ebff3f43888fd3fb0f0e70.tar.bz2 linux-3.10-f7857f35dbf8e7ca36ebff3f43888fd3fb0f0e70.zip |
KVM: x86 emulator: add macros for defining 2-operand fastop emulation
Acked-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/emulate.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 09dbdc5a99e..3b5d4dd6750 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -465,6 +465,17 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) ON64(FOP1E(op##q, rax)) \ FOP_END +#define FOP2E(op, dst, src) \ + FOP_ALIGN #op " %" #src ", %" #dst " \n\t" FOP_RET + +#define FASTOP2(op) \ + FOP_START(op) \ + FOP2E(op##b, al, bl) \ + FOP2E(op##w, ax, bx) \ + FOP2E(op##l, eax, ebx) \ + ON64(FOP2E(op##q, rax, rbx)) \ + FOP_END + #define __emulate_1op_rax_rdx(ctxt, _op, _suffix, _ex) \ do { \ unsigned long _tmp; \ @@ -3696,6 +3707,7 @@ static int check_perm_out(struct x86_emulate_ctxt *ctxt) #define D2bv(_f) D((_f) | ByteOp), D(_f) #define D2bvIP(_f, _i, _p) DIP((_f) | ByteOp, _i, _p), DIP(_f, _i, _p) #define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e) +#define F2bv(_f, _e) F((_f) | ByteOp, _e), F(_f, _e) #define I2bvIP(_f, _e, _i, _p) \ IIP((_f) | ByteOp, _e, _i, _p), IIP(_f, _e, _i, _p) |