From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest Date: Thu, 05 Jul 2012 08:21:05 +1000 Message-ID: <1341440465.16808.38.camel@pasglop> References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> <1340627195-11544-10-git-send-email-mihai.caraman@freescale.com> <10CBFB35-5A18-4EA8-A129-58CCC4CFBB83@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "qemu-ppc@nongnu.org List" , Mihai Caraman , linuxppc-dev , KVM list , "" To: Alexander Graf Return-path: In-Reply-To: <10CBFB35-5A18-4EA8-A129-58CCC4CFBB83@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org On Wed, 2012-07-04 at 16:14 +0200, Alexander Graf wrote: > > +#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? hard_irq_disable() both soft and hard disable. local_irq_enable() will see that irqs are hard disabled and will hard enable. However, there's a nastier discrepancy above: local_irq_disable will properly inform lockdep that we are disabling, while hard_irq_disable won't. Arguably we might want to fix that inside hard_irq_disable() itself... 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. Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Wed, 04 Jul 2012 22:21:05 +0000 Subject: Re: [Qemu-ppc] [RFC PATCH 09/17] KVM: PPC64: booke: Hard disable interrupts when entering guest Message-Id: <1341440465.16808.38.camel@pasglop> List-Id: References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> <1340627195-11544-10-git-send-email-mihai.caraman@freescale.com> <10CBFB35-5A18-4EA8-A129-58CCC4CFBB83@suse.de> In-Reply-To: <10CBFB35-5A18-4EA8-A129-58CCC4CFBB83@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: "qemu-ppc@nongnu.org List" , Mihai Caraman , linuxppc-dev , KVM list , "" On Wed, 2012-07-04 at 16:14 +0200, Alexander Graf wrote: > > +#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? hard_irq_disable() both soft and hard disable. local_irq_enable() will see that irqs are hard disabled and will hard enable. However, there's a nastier discrepancy above: local_irq_disable will properly inform lockdep that we are disabling, while hard_irq_disable won't. Arguably we might want to fix that inside hard_irq_disable() itself... 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. Cheers, Ben.