[PATCH] KVM: PPC: BookE: Include trap in pt_regs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When reinjecting host interrupt requests in the exit handler code,
let's also tell the interrupt handler which interrupt number we're
coming from.

Signed-off-by: Alexander Graf <agraf@xxxxxxx>
---
 arch/powerpc/kvm/booke.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 72f13f4..0512bd7 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -596,7 +596,8 @@ static int emulation_exit(struct kvm_run *run, struct kvm_vcpu *vcpu)
 	}
 }
 
-static void kvmppc_fill_pt_regs(struct pt_regs *regs)
+static void kvmppc_fill_pt_regs(struct pt_regs *regs,
+				int exit_nr)
 {
 	ulong r1, ip, msr, lr;
 
@@ -610,6 +611,7 @@ static void kvmppc_fill_pt_regs(struct pt_regs *regs)
 	regs->nip = ip;
 	regs->msr = msr;
 	regs->link = lr;
+	regs->trap = exit_nr;
 }
 
 static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
@@ -619,16 +621,16 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 
 	switch (exit_nr) {
 	case BOOKE_INTERRUPT_EXTERNAL:
-		kvmppc_fill_pt_regs(&regs);
+		kvmppc_fill_pt_regs(&regs, exit_nr);
 		do_IRQ(&regs);
 		break;
 	case BOOKE_INTERRUPT_DECREMENTER:
-		kvmppc_fill_pt_regs(&regs);
+		kvmppc_fill_pt_regs(&regs, exit_nr);
 		timer_interrupt(&regs);
 		break;
 #if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_BOOK3E_64)
 	case BOOKE_INTERRUPT_DOORBELL:
-		kvmppc_fill_pt_regs(&regs);
+		kvmppc_fill_pt_regs(&regs, exit_nr);
 		doorbell_exception(&regs);
 		break;
 #endif
@@ -636,7 +638,7 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 		/* FIXME */
 		break;
 	case BOOKE_INTERRUPT_PERFORMANCE_MONITOR:
-		kvmppc_fill_pt_regs(&regs);
+		kvmppc_fill_pt_regs(&regs, exit_nr);
 		performance_monitor_exception(&regs);
 		break;
 	}
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux