Thread (75 messages) 75 messages, 6 authors, 2012-10-08

RE: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest

flat view

From: Caraman Mihai Claudiu-B02008 <hidden>
Date: 2012-07-06 23:03:46
Also in: kvm

-----Original Message-----
From: Linuxppc-dev [mailto:linuxppc-dev-
bounces+mihai.caraman=3Dfreescale.com@lists.ozlabs.org] On Behalf Of
Benjamin Herrenschmidt
Sent: Thursday, July 05, 2012 1:21 AM
To: Alexander Graf
Cc: qemu-ppc@nongnu.org List; Caraman Mihai Claudiu-B02008; linuxppc-dev;
KVM list; [off-list ref]
Subject: Re: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable
interrupts when entering guest
=20
On Wed, 2012-07-04 at 16:14 +0200, Alexander Graf wrote:
quoted
quoted
+#ifdef CONFIG_64BIT
+#define _hard_irq_disable() hard_irq_disable()
+#else
+#define _hard_irq_disable() local_irq_disable()
+#endif
So you only swap out the disable bit, but not the enable one? Ben,
would this work out?
=20
hard_irq_disable() both soft and hard disable. local_irq_enable() will
see that irqs are hard disabled and will hard enable.
=20
However, there's a nastier discrepancy above: local_irq_disable will
properly inform lockdep that we are disabling, while hard_irq_disable
won't.
=20
Arguably we might want to fix that inside hard_irq_disable() itself...
=20
Also you need to be careful. If you are coming with interrupts already
enabled, it's fine, but if you have interrupts soft disabled, then
you hard disable, before you enter the guest you probably want to
check if anything was left "pending" and cancel the entering of the
guest if that is the case.
On which cases I can find interrupts soft disabled if I call local_irq_enab=
le()
ahead? Can this happen when my kernel task is scheduled?=20

I presume that if I call hard_irq_disable() before entering the guest, a gu=
est exit
will find interrupts soft disabled.

-Mike
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help