linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs
@ 2013-05-03 16:11 Mihai Caraman
  2013-05-03 16:24 ` Alexander Graf
  2013-05-03 18:04 ` Scott Wood
  0 siblings, 2 replies; 10+ messages in thread
From: Mihai Caraman @ 2013-05-03 16:11 UTC (permalink / raw)
  To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm

A change in the generic code highlighted that we were running with IRQs
(soft) enabled on Book3E 64-bit when trying to restart interrupts from
handle_exit(). This is a lesson to configure lockdep often :)

There is no reason to exit guest with soft_enabled == 1, a local_irq_enable()
call will do this for us so get rid of kvmppc_layz_ee() calls. With this fix
we eliminate irqs_disabled() warnings and some guest and host hangs revealed
under stress tests, but guests still exhibit some unresponsiveness.

The unresponsiveness has to do with the fact that arch_local_irq_restore()
does not guarantees to hard enable interrupts. To do so replace exception
function calls like timer_interrupt() with irq_happened flags. The
local_irq_enable() call takes care of replaying them and lets the interrupts
hard enabled.

Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
 arch/powerpc/kvm/booke.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 1020119..82f155e 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -673,7 +673,6 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
 		ret = s;
 		goto out;
 	}
-	kvmppc_lazy_ee_enable();
 
 	kvm_guest_enter();
 
@@ -789,16 +788,16 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
 	switch (exit_nr) {
 	case BOOKE_INTERRUPT_EXTERNAL:
 		kvmppc_fill_pt_regs(&regs);
-		do_IRQ(&regs);
+		local_paca->irq_happened |= PACA_IRQ_EE;
 		break;
 	case BOOKE_INTERRUPT_DECREMENTER:
 		kvmppc_fill_pt_regs(&regs);
-		timer_interrupt(&regs);
+		local_paca->irq_happened |= PACA_IRQ_DEC;
 		break;
 #if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_BOOK3E_64)
 	case BOOKE_INTERRUPT_DOORBELL:
 		kvmppc_fill_pt_regs(&regs);
-		doorbell_exception(&regs);
+		local_paca->irq_happened |= PACA_IRQ_DBELL;
 		break;
 #endif
 	case BOOKE_INTERRUPT_MACHINE_CHECK:
@@ -1148,8 +1147,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 		if (s <= 0) {
 			local_irq_enable();
 			r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
-		} else {
-			kvmppc_lazy_ee_enable();
 		}
 	}
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-05-03 23:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-03 16:11 [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs Mihai Caraman
2013-05-03 16:24 ` Alexander Graf
2013-05-03 22:03   ` Benjamin Herrenschmidt
2013-05-03 18:04 ` Scott Wood
2013-05-03 20:01   ` Caraman Mihai Claudiu-B02008
2013-05-03 20:15     ` Scott Wood
2013-05-03 20:56       ` Caraman Mihai Claudiu-B02008
2013-05-03 22:06         ` Scott Wood
2013-05-03 22:59           ` Caraman Mihai Claudiu-B02008
2013-05-03 23:30             ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).