@@ -759,6 +759,24 @@ static int kvm_put_vpa(CPUState *cs)
}
#endif /* TARGET_PPC64 */
+static int kvmppc_inject_debug_exception(CPUState *cs)
+{
+ return 0;
+}
+
+static void kvmppc_inject_exception(CPUState *cs)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
+
+ if (env->pending_interrupts & (1 << PPC_INTERRUPT_DEBUG)) {
+ if (kvmppc_inject_debug_exception(cs)) {
+ fprintf(stderr, "%s: Debug exception injection failed\n", __func__);
+ }
+ return;
+ }
+}
+
int kvm_arch_put_registers(CPUState *cs, int level)
{
PowerPCCPU *cpu = POWERPC_CPU(cs);
@@ -772,6 +790,10 @@ int kvm_arch_put_registers(CPUState *cs, int level)
return ret;
}
+ if (env->pending_interrupts) {
+ kvmppc_inject_exception(cs);
+ }
+
regs.ctr = env->ctr;
regs.lr = env->lr;
regs.xer = cpu_read_xer(env);
This patch adds interface to inject interrupt to guest. Currently a void debug exception function added. Follow up patch will use this interface to inject debug interrupt to guest Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com> --- target-ppc/kvm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)