]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: emulate: do not initialize memopp
authorBandan Das <bsd@redhat.com>
Wed, 16 Apr 2014 16:46:14 +0000 (12:46 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jul 2014 07:14:01 +0000 (09:14 +0200)
commit4f5ee7780a8e229349a8b9366434959f76cbf56c
treeda1cd3e8f52f23fe8dd614b38474065f5b9f3ca1
parentfba007572f727f9ccefa414e5475561b15e56ec0
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>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c