From patchwork Wed Apr 1 15:39:14 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: 46634 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 E62E82159A for ; Wed, 1 Apr 2015 15:42:32 +0000 (UTC) Received: by wibgr10 with SMTP id gr10sf12530503wib.2 for ; Wed, 01 Apr 2015 08:42:32 -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=RKGpHNvrjPkshwzw9L7rvpLLRhTaxrtnG7eWzk5g4Ss=; b=I9R4Jb+p4kqcuvyNoO48/EI3HQ2zzwTWcHnMRGcVsLECTHou+fFjE3xYnxphZe65DG 5KiBKBgHM+vUFyasa/H8FIR0mJkQPUcABolgJKbD43l0CN5Wwd5AV7rCtY0Zdl033Fwx yE448cAFFSCEKV5Q+TriEN/TeM/W02cPNChN7Wqg6KVoQbBs9m+9ull07m+pZ3OqUPr3 kft7b946Z3P8Fbjf8GEoc+M74pHvu/OaqXd1Yq5kANdQlB1oMh7HrRFZRNxBqFgPv3/t aHKZGDmNqGuLo8nN7DbByuMHzfPwCdKtj7tGSrnQy3ktsBkxiiJLj1RJqpkyjphxGqf9 /2MA== X-Gm-Message-State: ALoCoQliHlIArvaGEFRyaeqvo2D3oO8ME0v9ol99LGsAbz9icY0jJ4nlt6Mr2EHjlFxmhZhJLynv X-Received: by 10.112.138.233 with SMTP id qt9mr3578202lbb.2.1427902952182; Wed, 01 Apr 2015 08:42:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.4 with SMTP id lk4ls87728lac.15.gmail; Wed, 01 Apr 2015 08:42:32 -0700 (PDT) X-Received: by 10.112.183.134 with SMTP id em6mr35855117lbc.52.1427902952030; Wed, 01 Apr 2015 08:42:32 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id is5si1897630lac.110.2015.04.01.08.42.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 08:42:32 -0700 (PDT) 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 lbbug6 with SMTP id ug6so39379107lbb.3 for ; Wed, 01 Apr 2015 08:42:31 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr36516233lab.106.1427902951885; Wed, 01 Apr 2015 08:42:31 -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 k9csp746114lbq; Wed, 1 Apr 2015 08:42:31 -0700 (PDT) X-Received: by 10.55.21.3 with SMTP id f3mr43757935qkh.96.1427902950463; Wed, 01 Apr 2015 08:42:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n9si2197491qga.13.2015.04.01.08.42.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Apr 2015 08:42:30 -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]:53454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdKmj-0006lK-JA for patch@linaro.org; Wed, 01 Apr 2015 11:42:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdKjn-0002WZ-Ao for qemu-devel@nongnu.org; Wed, 01 Apr 2015 11:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdKje-0007l1-Jl for qemu-devel@nongnu.org; Wed, 01 Apr 2015 11:39:27 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:36087 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdKje-0007kv-DJ for qemu-devel@nongnu.org; Wed, 01 Apr 2015 11:39:18 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YdLq4-0006ck-Ew; Wed, 01 Apr 2015 18:50:00 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 1 Apr 2015 16:39:14 +0100 Message-Id: <1427902756-30567-4-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.4 In-Reply-To: <1427902756-30567-1-git-send-email-alex.bennee@linaro.org> References: <1427902756-30567-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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , christoffer.dall@linaro.org, greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v6 3/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.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 Acked-by: Christoffer Dall --- v6 - tweak wording for configuration register 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);