From patchwork Wed Feb 25 16:02:34 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: 45085 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 312542142A for ; Wed, 25 Feb 2015 16:03:48 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id h11sf4161693wiw.1 for ; Wed, 25 Feb 2015 08:03:47 -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=xQEoooBzjvq5Ndbe/jI3NHSgaEZBC8e0szRrOQ8P9dg=; b=Yrsuwjpcy6VGNhprrrC1TjE2z4FxIRo4haQKj3pX56y2Rtm1xDG3WdgLf7F8DtecgO sMhI6UJxQ2PGqMButZOr+sdLhqbBdzraCBad/yHIQOtEqXQBI5UCbgnuyG8REaNpszF6 enab0czRkOxi/Zm54AAMgNa/7fUvx8JKBKARccWJoNaHqE8pHyJyqCmp6cU4r9LKBhEm fgtYzoqpSdc/b+KW2iDm6VDUr0BL+CznIKKC7wompYqFdhgG19ogYVrxFfPPpfxfUmTe 3k7XWwy3Ax26otY1N9+FWN8SRUPJO6mr3zCdDuDqkITf8SzOVGWfGTaQtruyiLAg6H5i 10sw== X-Gm-Message-State: ALoCoQn4JS3GIbZqEwP3CSNMInPS1lkmV/gT2R92o893ljM9i2PnuVTctLisKe1hLBn+29C+Ipla X-Received: by 10.152.19.100 with SMTP id d4mr604514lae.7.1424880227461; Wed, 25 Feb 2015 08:03:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.246.38 with SMTP id xt6ls33310lac.102.gmail; Wed, 25 Feb 2015 08:03:47 -0800 (PST) X-Received: by 10.112.170.132 with SMTP id am4mr3343562lbc.89.1424880227316; Wed, 25 Feb 2015 08:03:47 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id cy5si29493216lac.169.2015.02.25.08.03.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 08:03:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbvp9 with SMTP id p9so4877504lbv.0 for ; Wed, 25 Feb 2015 08:03:47 -0800 (PST) X-Received: by 10.152.4.227 with SMTP id n3mr435375lan.72.1424880227201; Wed, 25 Feb 2015 08:03:47 -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 h5csp2712137lbj; Wed, 25 Feb 2015 08:03:46 -0800 (PST) X-Received: by 10.53.4.39 with SMTP id cb7mr4500701vdd.37.1424880220756; Wed, 25 Feb 2015 08:03:40 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b110si32515158qga.95.2015.02.25.08.03.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Feb 2015 08:03:40 -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]:54758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQeR1-0003D9-Ra for patch@linaro.org; Wed, 25 Feb 2015 11:03:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQeQA-0002Pq-J8 for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:02:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQeQ6-0006nB-My for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:02:46 -0500 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:47121 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQeQ6-0006mh-GI for qemu-devel@nongnu.org; Wed, 25 Feb 2015 11:02:42 -0500 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YQfO7-0007hX-TJ; Wed, 25 Feb 2015 18:04:44 +0100 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 25 Feb 2015 16:02:34 +0000 Message-Id: <1424880159-29348-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424880159-29348-1-git-send-email-alex.bennee@linaro.org> References: <1424880159-29348-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 2/6] arm_gic_kvm.c: restore config before pending IRQs 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.172 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 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);