From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC][PATCH 1/1] kvm:ppc:booke-64: soft-disable interrupts Date: Fri, 10 May 2013 08:07:00 +1000 Message-ID: <1368137220.3715.14.camel@pasglop> References: <1368134856.654.11@snotra> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "tiejun.chen" , Bhushan Bharat-R65777 , Caraman Mihai Claudiu-B02008 , Wood Scott-B07421 , "linuxppc-dev@lists.ozlabs.org" , "agraf@suse.de" , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" To: Scott Wood Return-path: Received: from gate.crashing.org ([63.228.1.57]:59448 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753912Ab3EIWHP (ORCPT ); Thu, 9 May 2013 18:07:15 -0400 In-Reply-To: <1368134856.654.11@snotra> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2013-05-09 at 16:27 -0500, Scott Wood wrote: > On 05/09/2013 07:37:42 AM, Benjamin Herrenschmidt wrote: > > On Thu, 2013-05-09 at 17:44 +0800, tiejun.chen wrote: > > > > > > Actually in the case GS=1 even if EE=0, EXT/DEC/DBELL still occur > > as I > > > recall. > > > > Only if directed to the hypervisor. > > This is always the case with KVM, right? At least on booke... Hrm, on A2 we could choose iirc. Well not DEC but EXT at least, I don't remember about DBELL. > > > > Case 1) > > > > -> Local_irq_disable() will set soft_enabled = 0 > > > > -> Now Externel interrupt happens, there we set PACA_IRQ_EE in > > > irq_happened, Also clears EE in SRR1 and rfi. So interrupts are hard > > > disabled. No more other interrupt gated by MSR.EE can happen. Looks > > > like the idea here is to not let a device keep on inserting > > interrupt > > > till the interrupt condition on device is cleared, right? > > > > The external interrupt line is level sensitive normally, so we have to > > mask MSR:EE in that case or the interrupt would keep re-occurring > > (note > > that FSL has this concept of auto-acked interrupts via the on die MPIC > > for which you can potentially use PACA_IRQ_EE_EDGE instead and avoid > > having to mask MSR:EE). > > Note that if we do this, we can no longer leave the interrupt vector in > EPR, and would have to track (potentially multiple different) pending > external interrupts in software. Right, you can have a little queue in the PACA and leave EE disabled if it's full. You can probably get away with a queue of 1 though :-) Cheers, Ben.