On 19.07.14 12:14, Paul Mackerras wrote:
This series aims to increase the range of instructions that KVM on PPC can emulate and reduce code duplication by using the existing instruction emulation code from arch/powerpc/lib/sstep.c for KVM. The ultimate goal is to make PR KVM run faster on the kind of instruction sequences that we get in Linux's first-level interrupt handlers, where we have privileged instructions such as move to/from SPR, mtmsrd, rfid, etc., intermingled with ordinary unprivileged loads, stores, arithmetic instructions, etc. If KVM could emulate those ordinary instructions as well as the privileged ones, we could emulate these code sequences without incurring the cost to exit and re-enter the guest for every single privileged instruction. That would be a speedup provided the guest entry/exit cost was greater than the cost of emulating a few ordinary instructions. This series doesn't get to that ultimate goal but does lay the groundwork. It splits the emulate_step() function into two parts, analyse_instr() and emulate_step(), and uses analyse_instr() in kvmppc_emulate_instruction(). This means that KVM needs to store its vcpu integer register state in a struct pt_regs like the rest of the kernel does. We also need to make kvmppc_handle_load() and kvmppc_handle_store() handle loads and stores to ordinary guest memory as well as emulated MMIO.
Please take a look at my other patch set that implemented instruction emulation. There we split the code paths between MMIO emulation and normal instruction emulation.
I really think that approach is a prerequisite to doing full instruction emulation in longer code snippets. Obviously the generic load/store should then handle MMIO as well as generic memory operations.
Alex -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html