From patchwork Thu Nov 29 17:02:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 13294 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0D39E24252 for ; Thu, 29 Nov 2012 17:03:05 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id AE9B5A18784 for ; Thu, 29 Nov 2012 17:03:04 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so8045646iag.11 for ; Thu, 29 Nov 2012 09:03:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=cSPaqRiC7WmkjzFLdN6GTQU9phjFYYzyy1xHKsQOoA8=; b=LE0+zMIK4gEHIjPUeNqo6ApUpw6lL15hC2TdqL594jj/pvjagV7T+R6cANnxrso5yB HYersfIq55YWOWyWKuXovQkhy7FAE7oKuknQRaG5OOdD/K7RytYCsvHgtS2evXq34BHx XPaeQPIfrIPxfD2zZLj5zUAC6M+cANaYKeVPHCEKcuXuspcFIXqzvHfAh20WErFvm3lB b2C4nX8Sql6xQWdMAOfrlgZ9ZTZ/KAgEL0ZnkSeXVmgyw+2Us0Qgm0vBu7PyTCZgxA32 QHfeYyp0j93V1vcUDWqSLq2Xfpkd0oO0OfyswA0bfoGoQ7B4CwW2W2oOtf/seOxZvlgE oGoA== Received: by 10.43.125.133 with SMTP id gs5mr20906631icc.54.1354208583961; Thu, 29 Nov 2012 09:03:03 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp886780igt; Thu, 29 Nov 2012 09:03:03 -0800 (PST) Received: by 10.66.88.102 with SMTP id bf6mr63522895pab.10.1354208582446; Thu, 29 Nov 2012 09:03:02 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id yk3si3629380pbc.279.2012.11.29.09.03.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Nov 2012 09:03:02 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Te7Vp-0002Kc-5L; Thu, 29 Nov 2012 17:02:57 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, kvmarm@lists.cs.columbia.edu, Mark Langsdorf , Evgeny Voevodin , Maksim Kozlov , Igor Mitsyanko , Dmitry Solodkiy , Marc Zyngier Subject: [PATCH 2/3] hw/arm_gic: Fix comparison with priority mask register Date: Thu, 29 Nov 2012 17:02:56 +0000 Message-Id: <1354208577-8935-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1354208577-8935-1-git-send-email-peter.maydell@linaro.org> References: <1354208577-8935-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQlyLN+M/0bev038UJIhPRqdMjElVzBsNRGWiDNJJKSgM2xWaEq+V8qKHhzBSlo3E2aQv7mY The GIC spec states that only interrupts with higher priority than the value in the GICC_PMR priority mask register are passed through to the processor. We were incorrectly allowing through interrupts with a priority equal to the specified value: correct the comparison operation to match the spec. Signed-off-by: Peter Maydell Reviewed-by: Igor Mitsyanko --- hw/arm_gic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm_gic.c b/hw/arm_gic.c index f9e423f..672d539 100644 --- a/hw/arm_gic.c +++ b/hw/arm_gic.c @@ -73,7 +73,7 @@ void gic_update(GICState *s) } } level = 0; - if (best_prio <= s->priority_mask[cpu]) { + if (best_prio < s->priority_mask[cpu]) { s->current_pending[cpu] = best_irq; if (best_prio < s->running_priority[cpu]) { DPRINTF("Raised pending IRQ %d\n", best_irq);