]> Pileus Git - ~andy/linux/commit
KVM: PPC: Emulator: clean up SPR reads and writes
authorAlexander Graf <agraf@suse.de>
Fri, 4 May 2012 12:55:12 +0000 (14:55 +0200)
committerAlexander Graf <agraf@suse.de>
Sun, 6 May 2012 14:19:13 +0000 (16:19 +0200)
commit54771e6217ce05a474827d9b23ff03de9d2ef2a0
tree4555f93d29863b6c0bbd4be61c60bfe7b80ce6c9
parentc46dc9a86148bc37c31d67a22a3887144ba7aa81
KVM: PPC: Emulator: clean up SPR reads and writes

When reading and writing SPRs, every SPR emulation piece had to read
or write the respective GPR the value was read from or stored in itself.

This approach is pretty prone to failure. What if we accidentally
implement mfspr emulation where we just do "break" and nothing else?
Suddenly we would get a random value in the return register - which is
always a bad idea.

So let's consolidate the generic code paths and only give the core
specific SPR handling code readily made variables to read/write from/to.

Functionally, this patch doesn't change anything, but it increases the
readability of the code and makes is less prone to bugs.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/44x_emulate.c
arch/powerpc/kvm/book3s_emulate.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/booke.h
arch/powerpc/kvm/booke_emulate.c
arch/powerpc/kvm/e500_emulate.c
arch/powerpc/kvm/emulate.c