• Paolo Bonzini's avatar
    KVM: emulate: speed up emulated moves · 54cfdb3e
    Paolo Bonzini authored
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    54cfdb3e
emulate.c 125 KB