ppc: do not look at the MMU index

The MMU index is an internal detail that should not be
needed by the translator.  Look at the MSR directly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ppc: avoid excessive TLB flushing

PowerPC TCG flushes the TLB on every IR/DR change, which basically
means on every user<->kernel context switch.  Use the 6-element
TLB array as a cache, where each MMU index is mapped to a different
state of the IR/DR/PR/HV bits.

This brings the number of TLB flushes down from ~900000 to ~50000
for starting up the Debian installer, which is in line with x86
and gives a ~10% performance improvement.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
sparc: economize on TLB flushes

Only flush primary or secondary entries when writing to the DMMU
register.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>