From patchwork Wed Apr 1 17:08:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 46651 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD752216D1 for ; Wed, 1 Apr 2015 17:09:35 +0000 (UTC) Received: by lbfb1 with SMTP id b1sf11970262lbf.2 for ; Wed, 01 Apr 2015 10:09:34 -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 :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=axeTvlHTz6v/7SQkcTAqejz6rY2DUcLyNOJQxOaYzS8=; b=aikNIevnU5Hs8UuyYzBSZW93/3C3te32pSJr0prWO9ZONuCHMr7tnVuK4YL9h7BeDb mOyIkfpoVGGd4+z8LjHNoFpiJts7fvwUlue39rd+lnhAAvoW0zloimjz3B5A6uId4vlf 0gwUWQXllOP+Q/VbXwP0pegZOCq8AHVtGcbaCNI+DHxbPbWpOwOBJ+wCqQ5bFwplcKX9 zi951H57gC5TH0MEakN8oG8kY3wzVM0zQocDwlG6ixQr2dkvvFzQe6NleYbbSXECL7RJ 9W6f4EQ4/KsOHS5MtXfH3iHKUaz7+id7ItLXSxICq+bs4wTmTsry1c6VTg9fXSSMeM42 xyIA== X-Gm-Message-State: ALoCoQmgqCSeiJAuEw/ycpTdQ7nzdktaI3NFAIi6P/4JzROhd0Q/Cp1GveV9gb22cnJWRpunFXcq X-Received: by 10.194.95.67 with SMTP id di3mr11242501wjb.0.1427908174470; Wed, 01 Apr 2015 10:09:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.105 with SMTP id db9ls91178lad.87.gmail; Wed, 01 Apr 2015 10:09:34 -0700 (PDT) X-Received: by 10.112.98.201 with SMTP id ek9mr36829777lbb.68.1427908174146; Wed, 01 Apr 2015 10:09:34 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id al5si2096523lbc.80.2015.04.01.10.09.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 10:09:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labe2 with SMTP id e2so41760344lab.3 for ; Wed, 01 Apr 2015 10:09:34 -0700 (PDT) X-Received: by 10.152.163.35 with SMTP id yf3mr10228142lab.86.1427908174007; Wed, 01 Apr 2015 10:09:34 -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.57.201 with SMTP id k9csp797228lbq; Wed, 1 Apr 2015 10:09:33 -0700 (PDT) X-Received: by 10.140.151.21 with SMTP id 21mr59091921qhx.8.1427908172498; Wed, 01 Apr 2015 10:09:32 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id he1si2421206qcb.39.2015.04.01.10.09.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 10:09:32 -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]:54146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdM8x-0000tq-Dz for patch@linaro.org; Wed, 01 Apr 2015 13:09:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdM7w-0008Cq-6j for qemu-devel@nongnu.org; Wed, 01 Apr 2015 13:08:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdM7u-0001dG-V4 for qemu-devel@nongnu.org; Wed, 01 Apr 2015 13:08:28 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:33290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdM7u-0001cG-My for qemu-devel@nongnu.org; Wed, 01 Apr 2015 13:08:26 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YdM7m-0002yA-QR for qemu-devel@nongnu.org; Wed, 01 Apr 2015 18:08:18 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Wed, 1 Apr 2015 18:08:16 +0100 Message-Id: <1427908098-11358-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1427908098-11358-1-git-send-email-peter.maydell@linaro.org> References: <1427908098-11358-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 6/8] 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: peter.maydell@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.215.54 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 From: Alex Bennée 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 Signed-off-by: Peter Maydell --- hw/intc/arm_gic_kvm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index 0d20750..e1952ad 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 configuration registers 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);