From patchwork Fri Aug 29 14:37:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 36292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A76E2054D for ; Fri, 29 Aug 2014 14:41:04 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id j7sf8039935qaq.5 for ; Fri, 29 Aug 2014 07:41:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references: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=Z1//z5qxpX0m75M0HwWth/LeHAWGUZlnQt/1YE5L0Y8=; b=EC0nXIpTzMwcdN571WiLk42V54EOL//iZrT+GfCXOp/tdcKcU1Q61jZKvevUIajdQx 5a8BltyoK10V/OJZQPso+gLRi6/CettH30EbRYt6dhgXZw3+RFk1bSLvoy+/f8KFpTNQ uHerwGlkk4ovNWWhxzaQDy+qZM5NLUfzNeCpKSDi8O6k0byfEgd5TC6W2zVz3yVnSuQ2 MpoLtdeJIjp8DzKbpd8eQitSStBexqFAc64aQkXh9ooCAniIu72gtJVDLkXcek7RGkIa pyGkxxELC1f2sIgnNEQtyNofVFU7RC6k3PPLgqPKiemGDo1GUPyUQg8l8zYTNGJv2WNM mUCQ== X-Gm-Message-State: ALoCoQmtSP/0yMayN3ELtDDaLn4mjQ7TjLwxM+FosbSuyLuPzAJtqRHAfo4w4sE2pRj1tNa9qsu/ X-Received: by 10.236.34.233 with SMTP id s69mr321029yha.57.1409323264078; Fri, 29 Aug 2014 07:41:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.45 with SMTP id l42ls1055843qga.61.gmail; Fri, 29 Aug 2014 07:41:04 -0700 (PDT) X-Received: by 10.52.147.15 with SMTP id tg15mr7003933vdb.53.1409323263741; Fri, 29 Aug 2014 07:41:03 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id d7si290322vcs.15.2014.08.29.07.41.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 07:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so2578231vcb.33 for ; Fri, 29 Aug 2014 07:41:03 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr8186784vcy.45.1409323263660; Fri, 29 Aug 2014 07:41:03 -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.221.45.67 with SMTP id uj3csp27088vcb; Fri, 29 Aug 2014 07:41:03 -0700 (PDT) X-Received: by 10.229.236.8 with SMTP id ki8mr18352227qcb.12.1409323263002; Fri, 29 Aug 2014 07:41:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h97si275993qge.99.2014.08.29.07.41.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 Aug 2014 07:41:02 -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]:42349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNMM-0003Nc-Cy for patch@linaro.org; Fri, 29 Aug 2014 10:41:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNJ5-00077d-Mj for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNNIy-00083F-Hb for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:39 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:46762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNIy-000805-B8 for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:37:32 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XNNIv-00051k-G0 for qemu-devel@nongnu.org; Fri, 29 Aug 2014 15:37:29 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 Aug 2014 15:37:21 +0100 Message-Id: <1409323049-19255-10-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409323049-19255-1-git-send-email-peter.maydell@linaro.org> References: <1409323049-19255-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.2.115.146 Subject: [Qemu-devel] [PULL 09/16] hw/intc/arm_gic: honor target mask in gic_update() 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.220.174 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: Sergey Fedorov Take IRQ target mask into account when determining the highest priority pending interrupt. Signed-off-by: Sergey Fedorov Acked-by: Christoffer Dall Message-id: 1407947471-26981-1-git-send-email-serge.fdrv@gmail.com Signed-off-by: Peter Maydell --- hw/intc/arm_gic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 55019c9..db9110c 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -66,7 +66,8 @@ void gic_update(GICState *s) best_prio = 0x100; best_irq = 1023; for (irq = 0; irq < s->num_irq; irq++) { - if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm)) { + if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm) && + (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) { if (GIC_GET_PRIORITY(irq, cpu) < best_prio) { best_prio = GIC_GET_PRIORITY(irq, cpu); best_irq = irq;