From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXSzi-0005fY-Eq for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:15:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXSzf-0001ZN-OM for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:15:38 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:35829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXSzf-0001ZE-Gj for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:15:35 -0400 Received: by labjg1 with SMTP id jg1so36609523lab.2 for ; Mon, 16 Mar 2015 04:15:34 -0700 (PDT) Date: Mon, 16 Mar 2015 12:15:59 +0100 From: Christoffer Dall Message-ID: <20150316111559.GA26480@cbox> References: <1426503716-13931-1-git-send-email-alex.bennee@linaro.org> <1426503716-13931-3-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1426503716-13931-3-git-send-email-alex.bennee@linaro.org> Subject: Re: [Qemu-devel] [PATCH v4 2/5] hw/intc: arm_gic_kvm.c restore config first List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu On Mon, Mar 16, 2015 at 11:01:53AM +0000, Alex Bennée wrote: > As there is logic to deal with the difference between edge and level > triggered interrupts in the kernel we must ensure it knows the > configuration of the IRQs before we restore the pending state. > > Signed-off-by: Alex Bennée > Acked-by: Christoffer Dall > > diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c > index 1ad3eb0..2f21ae7 100644 > --- a/hw/intc/arm_gic_kvm.c > +++ b/hw/intc/arm_gic_kvm.c > @@ -370,6 +370,11 @@ static void kvm_arm_gic_put(GICState *s) > * the appropriate CPU interfaces in the kernel) */ > kvm_dist_put(s, 0x800, 8, s->num_irq, translate_targets); > > + /* irq_state[n].trigger -> GICD_ICFGRn > + * (restore targets before pending IRQs so we treat level/edge targets? trigger? configurations? > + * correctly */ > + kvm_dist_put(s, 0xc00, 2, s->num_irq, translate_trigger); > + > /* irq_state[n].pending + irq_state[n].level -> GICD_ISPENDRn */ > kvm_dist_put(s, 0x280, 1, s->num_irq, translate_clear); > kvm_dist_put(s, 0x200, 1, s->num_irq, translate_pending); > @@ -378,8 +383,6 @@ static void kvm_arm_gic_put(GICState *s) > kvm_dist_put(s, 0x380, 1, s->num_irq, translate_clear); > kvm_dist_put(s, 0x300, 1, s->num_irq, translate_active); > > - /* irq_state[n].trigger -> GICD_ICFRn */ > - kvm_dist_put(s, 0xc00, 2, s->num_irq, translate_trigger); > > /* s->priorityX[irq] -> ICD_IPRIORITYRn */ > kvm_dist_put(s, 0x400, 8, s->num_irq, translate_priority); > -- > 2.3.2 >