KVM: ppc: refactor instruction emulation into generic and core-specific pieces
authorHollis Blanchard <hollisb@us.ibm.com>
Wed, 5 Nov 2008 15:36:16 +0000 (09:36 -0600)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:52:21 +0000 (16:52 +0200)
commit75f74f0dbe086c239b4b0cc5ed75b903ea3e663f
treec6774128934667d1c82a6e458d9a4233574a95a4
parentc381a04313e7c0fb04246b1ff711e0b5726de6c0
KVM: ppc: refactor instruction emulation into generic and core-specific pieces

Cores provide 3 emulation hooks, implemented for example in the new
4xx_emulate.c:
kvmppc_core_emulate_op
kvmppc_core_emulate_mtspr
kvmppc_core_emulate_mfspr

Strictly speaking the last two aren't necessary, but provide for more
informative error reporting ("unknown SPR").

Long term I'd like to have instruction decoding autogenerated from tables of
opcodes, and that way we could aggregate universal, Book E, and core-specific
instructions more easily and without redundant switch statements.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/44x_emulate.c [new file with mode: 0644]
arch/powerpc/kvm/44x_tlb.c
arch/powerpc/kvm/44x_tlb.h
arch/powerpc/kvm/Makefile
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/booke.h [new file with mode: 0644]
arch/powerpc/kvm/emulate.c