KVM: ppc: optimize kvm stat handling
authorHollis Blanchard <hollisb@us.ibm.com>
Wed, 5 Nov 2008 15:36:21 +0000 (09:36 -0600)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:52:23 +0000 (16:52 +0200)
commit1b6766c7f3533c5d03668e11dd5617ae4a52e5a8
tree3f5ed50be4044dca495c247dda069d634b012b38
parentb8fd68ac8db1f926fdb2c7f196598a279461de53
KVM: ppc: optimize kvm stat handling

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: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/booke.c