• H
    KVM: ppc: optimize kvm stat handling · 1b6766c7
    Hollis Blanchard 提交于
    Currently we use an unnecessary if&switch to detect some cases.
    To be honest we don't need the ligh_exits counter anyway, because we can
    calculate it out of others. Sum_exits can also be calculated, so we can
    remove that too.
    MMIO, DCR  and INTR can be counted on other places without these
    additional control structures (The INTR case was never hit anyway).
    
    The handling of BOOKE_INTERRUPT_EXTERNAL/BOOKE_INTERRUPT_DECREMENTER is
    similar, but we can avoid the additional if when copying 3 lines of code.
    I thought about a goto there to prevent duplicate lines, but rewriting three
    lines should be better style than a goto cross switch/case statements (its
    also not enough code to justify a new inline function).
    Signed-off-by: NChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
    Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
    Signed-off-by: NAvi Kivity <avi@redhat.com>
    1b6766c7
booke.c 17.0 KB