From patchwork Fri Dec 7 08:07:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 204420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1DA82C00D9 for ; Fri, 7 Dec 2012 19:08:54 +1100 (EST) Received: from localhost ([::1]:35162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgszL-0004sg-1q for incoming@patchwork.ozlabs.org; Fri, 07 Dec 2012 03:08:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgsz4-0004sP-LV for qemu-devel@nongnu.org; Fri, 07 Dec 2012 03:08:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tgsz1-0007gg-Hz for qemu-devel@nongnu.org; Fri, 07 Dec 2012 03:08:34 -0500 Received: from mail-vb0-f45.google.com ([209.85.212.45]:51527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgsz1-0007ga-Bo for qemu-devel@nongnu.org; Fri, 07 Dec 2012 03:08:31 -0500 Received: by mail-vb0-f45.google.com with SMTP id p1so238894vbi.4 for ; Fri, 07 Dec 2012 00:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=eP77i7ZBooy+lJRKyqZ6yPa+/w55+q+Ye0G/IkINrMU=; b=0tnPFG3KOL1ziFfxMU/N+R+uJve4BF6SLBW/EV2BdMUv4VVNYKa4P5fG6hqzAPKuYJ BGCH3LJtQBNLcxsLgcHQ4IcRSjAQxR4x5Z9ytb06OYFLG7oma9O8Q0hxhIQm2CIwy2qB 5FLU02cQ7BIPvMNBvDRnBv6EwNHnyYKnMsX+5LT5a7KN/d98ocXMMKJgRK3znmlcOERv Jo92XxHsKgdWIZ0loyjKilaWlj54R2o9m10/BVcxZ8re4URGtp9h0ytKn49JaKF/npIl vVnye0bDbJtGnWKzyDm1rumV2HmrL26ZYJNkQSOo4zsZ9RX7geM2HB+bnWTWsTaQmnZ8 C+Hg== Received: by 10.58.74.40 with SMTP id q8mr3410789vev.36.1354867710899; Fri, 07 Dec 2012 00:08:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.244.7 with HTTP; Fri, 7 Dec 2012 00:07:50 -0800 (PST) In-Reply-To: References: From: Daniel Sangorrin Date: Fri, 7 Dec 2012 17:07:50 +0900 Message-ID: To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.45 Cc: peter.maydell@linaro.org, paul@codesourcery.com Subject: [Qemu-devel] [PATCH v2] target-arm: GIC: bug fixes for arm_gic.c 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sorry, it seems that I did not understand the flow in the function "hw/arm_gic.c:gic_dist_writeb()" and made some mistaken assumptions in my previous patch. Please do not apply the previous patch, and apply this one instead if you consider that it is correct. target-arm: fix bug in irq value on arm_gic.c Fix a small bug that was using an incorrect IRQ value in the function gic_dist_writeb. Signed-off-by: Daniel Sangorrin --- hw/arm_gic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) if (!GIC_TEST_ENABLED(irq + i, cm)) { @@ -417,7 +417,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset, for (i = 0; i < 8; i++) { if (value & (1 << i)) { - GIC_SET_PENDING(irq + i, GIC_TARGET(irq)); + GIC_SET_PENDING(irq + i, GIC_TARGET(irq + i)); } } } else if (offset < 0x300) { diff --git a/hw/arm_gic.c b/hw/arm_gic.c index f9e423f..64d4e23 100644 --- a/hw/arm_gic.c +++ b/hw/arm_gic.c @@ -374,7 +374,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset, value = 0xff; for (i = 0; i < 8; i++) { if (value & (1 << i)) { - int mask = (irq < GIC_INTERNAL) ? (1 << cpu) : GIC_TARGET(irq); + int mask = (irq < GIC_INTERNAL) ? (1 << cpu) : GIC_TARGET(irq + i); int cm = (irq < GIC_INTERNAL) ? (1 << cpu) : ALL_CPU_MASK;