aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/kvm_emulate.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-03-27 06:36:25 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-07-11 03:13:58 -0400
commit54cfdb3e95d4f70409a7d3432a42cffc9a232be7 (patch)
tree01ad8c40d9c316b7359fb7e7605ba0c9b85a75eb /arch/x86/include/asm/kvm_emulate.h
parentd40a6898e50c2589ca3d345ef5ca6671e2b35b1a (diff)
KVM: emulate: speed up emulated moves
We can just blindly move all 16 bytes of ctxt->src's value to ctxt->dst. write_register_operand will take care of writing only the lower bytes. Avoiding a call to memcpy (the compiler optimizes it out) gains about 200 cycles on kvm-unit-tests for register-to-register moves, and makes them about as fast as arithmetic instructions. We could perhaps get a larger speedup by moving all instructions _except_ moves out of x86_emulate_insn, removing opcode_len, and replacing the switch statement with an inlined em_mov. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 0e0151c13b2c..432447370044 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -233,7 +233,7 @@ struct operand {
233 union { 233 union {
234 unsigned long val; 234 unsigned long val;
235 u64 val64; 235 u64 val64;
236 char valptr[sizeof(unsigned long) + 2]; 236 char valptr[sizeof(sse128_t)];
237 sse128_t vec_val; 237 sse128_t vec_val;
238 u64 mm_val; 238 u64 mm_val;
239 void *data; 239 void *data;