• Paolo Bonzini's avatar
    KVM: emulate: protect checks on ctxt->d by a common "if (unlikely())" · d40a6898
    Paolo Bonzini authored
    There are several checks for "peculiar" aspects of instructions in both
    x86_decode_insn and x86_emulate_insn.  Group them together, and guard
    them with a single "if" that lets the processor quickly skip them all.
    Make this more effective by adding two more flag bits that say whether the
    .intercept and .check_perm fields are valid.  We will reuse these
    flags later to avoid initializing fields of the emulate_ctxt struct.
    
    This skims about 30 cycles for each emulated instructions, which is
    approximately a 3% improvement.
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    d40a6898
emulate.c 125 KB