From patchwork Mon Aug 27 23:41:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meador Inge X-Patchwork-Id: 180315 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 106632C00F6 for ; Tue, 28 Aug 2012 09:41:26 +1000 (EST) Received: from localhost ([::1]:34985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T68vr-00064l-WF for incoming@patchwork.ozlabs.org; Mon, 27 Aug 2012 19:41:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T68vk-00064d-Rx for qemu-devel@nongnu.org; Mon, 27 Aug 2012 19:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T68vj-0008AL-JQ for qemu-devel@nongnu.org; Mon, 27 Aug 2012 19:41:16 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:45897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T68vj-00089w-Dy for qemu-devel@nongnu.org; Mon, 27 Aug 2012 19:41:15 -0400 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1T68vh-0007PV-0Q from meador_inge@mentor.com ; Mon, 27 Aug 2012 16:41:13 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 27 Aug 2012 16:41:12 -0700 Received: from dhalsim.mgc.mentorg.com (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Mon, 27 Aug 2012 16:41:12 -0700 From: Meador Inge To: Date: Mon, 27 Aug 2012 18:41:11 -0500 Message-ID: <1346110871-11631-1-git-send-email-meadori@codesourcery.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-OriginalArrivalTime: 27 Aug 2012 23:41:12.0996 (UTC) FILETIME=[71605640:01CD84AD] X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 192.94.38.131 Cc: peter.maydell@linaro.org, paul@codesourcery.com Subject: [Qemu-devel] [PATCH] hw/armv7m_nvic: Correctly register GIC region when setting up NVIC 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 When setting up the NVIC memory regions the memory range 0x100..0xcff is aliased to an IO memory region that belongs to the ARM GIC. This aliased region should be added to the NVIC memory container, but the actual GIC IO memory region was being added instead. This mixup was causing the wrong IO memory access functions to be called when accessing parts of the NVIC memory. Signed-off-by: Meador Inge Reviewed-by: Peter Maydell --- hw/armv7m_nvic.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c index 6a0832e..5c09116 100644 --- a/hw/armv7m_nvic.c +++ b/hw/armv7m_nvic.c @@ -489,7 +489,8 @@ static int armv7m_nvic_init(SysBusDevice *dev) */ memory_region_init_alias(&s->gic_iomem_alias, "nvic-gic", &s->gic.iomem, 0x100, 0xc00); - memory_region_add_subregion_overlap(&s->container, 0x100, &s->gic.iomem, 1); + memory_region_add_subregion_overlap(&s->container, 0x100, + &s->gic_iomem_alias, 1); /* Map the whole thing into system memory at the location required * by the v7M architecture. */