From patchwork Mon Mar 23 17:05:41 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: 46212 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17B78214B0 for ; Mon, 23 Mar 2015 17:08:07 +0000 (UTC) Received: by widex7 with SMTP id ex7sf8794243wid.2 for ; Mon, 23 Mar 2015 10:08:06 -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:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=FYW3w2MlzmBO1bDENK5AFnnaqnpz57JAjVMwvyu5nu8=; b=IIkxABP65mMjL3Ys4yaty0+NvMyfwUgi2xOh5fos4rfK4D+wTYFzdlERbFWbJmPp9j j/yxVLRie9EVCCKmi4RgGJsWWzytDl3qNQuf+o1aBmrvm+EeoITs7bYuTCD/+wHHEJwH b5KSpGM6WqgIqdS+/0qr94yBsikhfiP0LGzjf6k1p/B7KACW1GBsx3NU1WmGgEe1eaXN 8+lLk0VOAp+IY/yVyDqT/KAHxVV4pP8m/FQWjQ9NzT+5DpYkpH1zaWQH32JCkcksHq/7 g6yyofxu9XtfiomdSHJ0WgdlTIubwDKgNWxmFKVL82Xn8nrWgjut5aEy33wViEyI46g7 F6/A== X-Gm-Message-State: ALoCoQnKXVnwxhxvJDDhWCKtthC0Jswr/7haTcoxieCWs8I5z4oTcf/IspTh4GWSokYxJQE7lr3V X-Received: by 10.180.83.41 with SMTP id n9mr433908wiy.4.1427130486420; Mon, 23 Mar 2015 10:08:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.68 with SMTP id k4ls787013lam.53.gmail; Mon, 23 Mar 2015 10:08:06 -0700 (PDT) X-Received: by 10.112.239.1 with SMTP id vo1mr114198lbc.110.1427130486107; Mon, 23 Mar 2015 10:08:06 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id p3si1058892lbm.74.2015.03.23.10.08.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 10:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagg8 with SMTP id g8so139518121lag.1 for ; Mon, 23 Mar 2015 10:08:06 -0700 (PDT) X-Received: by 10.112.130.195 with SMTP id og3mr110634lbb.112.1427130486013; Mon, 23 Mar 2015 10:08:06 -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 k9csp955073lbq; Mon, 23 Mar 2015 10:08:05 -0700 (PDT) X-Received: by 10.68.174.132 with SMTP id bs4mr22958469pbc.135.1427130484085; Mon, 23 Mar 2015 10:08:04 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tu4si1676999pab.237.2015.03.23.10.08.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 10:08:04 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya5o9-0007Gp-4j; Mon, 23 Mar 2015 17:06:33 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya5nl-00074l-62 for linux-arm-kernel@bombadil.infradead.org; Mon, 23 Mar 2015 17:06:09 +0000 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155] helo=socrates.bennee.com) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya5nj-0007kY-3A for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 17:06:07 +0000 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1Ya6rE-0005wQ-93; Mon, 23 Mar 2015 19:13:48 +0100 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v5 3/6] hw/intc: arm_gic_kvm.c restore config first Date: Mon, 23 Mar 2015 17:05:41 +0000 Message-Id: <1427130344-27986-4-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1427130344-27986-1-git-send-email-alex.bennee@linaro.org> References: <1427130344-27986-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150323_170607_156493_2127FB94 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.215.51 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 0d20750..e2512f1 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);