From patchwork Wed Mar 4 14:35:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 45420 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C0C9621416 for ; Wed, 4 Mar 2015 14:37:27 +0000 (UTC) Received: by labhs14 with SMTP id hs14sf19383637lab.0 for ; Wed, 04 Mar 2015 06:37:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding:cc :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=srXViAs6o9B2oMVqb2OYsnJLEDBVsHiv9lFDs3A5ws4=; b=Fri4k/W4xosOxEXerM3TLYhzd31i4GB0p0gEhm3uPXXAmDeMK07hzd5KCTUc7qfoim Xn3dqJHHHXoI08AaPJMY2NUSo8fUeNz12Zb5nTry5n/4oaxhV/0BoH5IkMjOsGnWd+nx 3vOCLHafkFu6ZyzaaA8JoY7a86GRfdCigxMPVwCP8vLQJVRO9H7UNPlc6v40uTOZ7qbK so2mN9B5cnxof+C8dCniFVAGFRX3aFwgqd6eVW6HY1BWk48BWZFQt6zuvL1xL4v51fNh ln0FafJ7uRVniBFzonIAhfwXtFDKwYAwJRrTU4OdLCTIJljtwyvL5tRFWArPBAkU4/fO t2CQ== X-Gm-Message-State: ALoCoQn7m7hL5E/zCSYPQ14dJSVVr8GakEs9dqYs/n0atA/gZ2DhDDryNGy36vGOBQKMDaGbQ+TK X-Received: by 10.112.131.7 with SMTP id oi7mr752762lbb.9.1425479846722; Wed, 04 Mar 2015 06:37:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.140 with SMTP id jo12ls193561lab.19.gmail; Wed, 04 Mar 2015 06:37:26 -0800 (PST) X-Received: by 10.152.43.201 with SMTP id y9mr3080464lal.25.1425479845930; Wed, 04 Mar 2015 06:37:25 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id n15si2629009lbg.94.2015.03.04.06.37.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 06:37:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbjb6 with SMTP id b6so9456224lbj.9 for ; Wed, 04 Mar 2015 06:37:25 -0800 (PST) X-Received: by 10.112.224.3 with SMTP id qy3mr3808133lbc.36.1425479845834; Wed, 04 Mar 2015 06:37:25 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1259078lbj; Wed, 4 Mar 2015 06:37:25 -0800 (PST) X-Received: by 10.140.145.3 with SMTP id 3mr6148937qhr.43.1425479845118; Wed, 04 Mar 2015 06:37:25 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z18si3575712qgz.67.2015.03.04.06.37.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Mar 2015 06:37:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:44432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAQO-0003fN-6t for patch@linaro.org; Wed, 04 Mar 2015 09:37:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAPC-0002F4-H7 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 09:36:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTAP5-0007Jl-0h for qemu-devel@nongnu.org; Wed, 04 Mar 2015 09:36:10 -0500 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:57766 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTAP4-0007J6-Pp for qemu-devel@nongnu.org; Wed, 04 Mar 2015 09:36:02 -0500 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YTBOk-0007Xe-DX; Wed, 04 Mar 2015 16:39:46 +0100 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 4 Mar 2015 14:35:49 +0000 Message-Id: <1425479753-18349-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1425479753-18349-1-git-send-email-alex.bennee@linaro.org> References: <1425479753-18349-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH v2 2/6] hw/intc: arm_gic_kvm.c restore config first X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Greg Bellows 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 + * 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);