diff options
author | Bandan Das <bsd@redhat.com> | 2014-04-16 12:46:14 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-11 09:14:01 +0200 |
commit | 41061cdb98a0bec464278b4db8e894a3121671f5 (patch) | |
tree | da1cd3e8f52f23fe8dd614b38474065f5b9f3ca1 /arch/x86/include/asm | |
parent | 573e80fe04db1aa44e8303037f65716ba5c3a343 (diff) | |
download | linux-41061cdb98a0bec464278b4db8e894a3121671f5.tar.bz2 |
KVM: emulate: do not initialize memopp
rip_relative is only set if decode_modrm runs, and if you have ModRM
you will also have a memopp. We can then access memopp unconditionally.
Note that rip_relative cannot be hoisted up to decode_modrm, or you
break "mov $0, xyz(%rip)".
Also, move typecast on "out of range value" of mem.ea to decode_modrm.
Together, all these optimizations save about 50 cycles on each emulated
instructions (4-6%).
Signed-off-by: Bandan Das <bsd@redhat.com>
[Fix immediate operands with rip-relative addressing. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 6c808408326f..fcf58cd25ebd 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h @@ -295,6 +295,11 @@ struct x86_emulate_ctxt { struct operand dst; int (*execute)(struct x86_emulate_ctxt *ctxt); int (*check_perm)(struct x86_emulate_ctxt *ctxt); + /* + * The following six fields are cleared together, + * the rest are initialized unconditionally in x86_decode_insn + * or elsewhere + */ bool rip_relative; u8 rex_prefix; u8 lock_prefix; |