From patchwork Mon Mar 16 11:01:53 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: 45824 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD5AE21523 for ; Mon, 16 Mar 2015 11:07:56 +0000 (UTC) Received: by wghl18 with SMTP id l18sf25829424wgh.1 for ; Mon, 16 Mar 2015 04:07:56 -0700 (PDT) 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=ZNuSNi4/v8UIBDzKYCL3ydaCnm5Xur+CZqlepvb9pD8=; b=B+JKcx0J3mNJLsUXPnDOEXHAGgHeYyv3gnr7G9BS3Dv4Qe1p8DJrueSJrNBvBdJDQz lQ/AAyEehzuWcJPY655RYi0bRwF8eCQ1mIBljNLbzQvAuGOSmWbwK7grCCT9dTmaqb2U ieHG2y221cWQsyvBqRmufh43LGMFUYa3up3oNeymGDN3l1kbuuSlojPVQ62AR/Y6fJWv TKpaSLztTjVeug/zwa22hrwsYq6DpMxAHGS9aLkpNwhrpsG4O8nOmII4wvyAVYXdGdAp b1cY5bREObQpA1G+mLk4imF4SXHYm/DvAkbhtfzJysVwsVZGy1BZvXVZDZqihpwpT82F XMHQ== X-Gm-Message-State: ALoCoQkXelQhIMyu3iHqoRS+AHTbEL2W8OJVXzNjJog2DdNqdFNziISOJODeulHe/OeaFLBiKryh X-Received: by 10.180.211.199 with SMTP id ne7mr5823811wic.5.1426504076084; Mon, 16 Mar 2015 04:07:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.228.136 with SMTP id si8ls681840lac.11.gmail; Mon, 16 Mar 2015 04:07:55 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr53386366lbb.76.1426504075106; Mon, 16 Mar 2015 04:07:55 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id xs12si7826820lac.23.2015.03.16.04.07.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 04:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcds1 with SMTP id ds1so28753523lbc.3 for ; Mon, 16 Mar 2015 04:07:55 -0700 (PDT) X-Received: by 10.152.120.134 with SMTP id lc6mr53835270lab.72.1426504074989; Mon, 16 Mar 2015 04:07:54 -0700 (PDT) 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 h5csp2503764lbj; Mon, 16 Mar 2015 04:07:54 -0700 (PDT) X-Received: by 10.55.41.231 with SMTP id p100mr107657617qkp.106.1426504073700; Mon, 16 Mar 2015 04:07:53 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z20si9555345qge.38.2015.03.16.04.07.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Mar 2015 04:07:53 -0700 (PDT) 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]:48400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXSsC-0008Nw-NO for patch@linaro.org; Mon, 16 Mar 2015 07:07:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXSr4-0007Nu-Vy for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXSr0-00078W-SV for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:06:42 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:33326 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXSr0-00078L-LW for qemu-devel@nongnu.org; Mon, 16 Mar 2015 07:06:38 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YXTtX-0000VG-CZ; Mon, 16 Mar 2015 13:13:19 +0100 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Mon, 16 Mar 2015 11:01:53 +0000 Message-Id: <1426503716-13931-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426503716-13931-1-git-send-email-alex.bennee@linaro.org> References: <1426503716-13931-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 v4 2/5] 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.170 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 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);