From patchwork Thu Apr 2 15:09:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 457719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E94A51400A0 for ; Fri, 3 Apr 2015 02:10:11 +1100 (AEDT) Received: from localhost ([::1]:58819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydgkw-0003Xa-M5 for incoming@patchwork.ozlabs.org; Thu, 02 Apr 2015 11:10:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydgkg-0003EJ-VQ for qemu-devel@nongnu.org; Thu, 02 Apr 2015 11:09:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ydgkd-0002EX-PF for qemu-devel@nongnu.org; Thu, 02 Apr 2015 11:09:50 -0400 Received: from s16892447.onlinehome-server.info ([82.165.15.123]:58292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydgkd-0002ED-Iu for qemu-devel@nongnu.org; Thu, 02 Apr 2015 11:09:47 -0400 Received: from 4e567451.skybroadband.com ([78.86.116.81] helo=kentang.lan) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1YdgkZ-0003DZ-1K; Thu, 02 Apr 2015 16:09:44 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org Date: Thu, 2 Apr 2015 16:09:30 +0100 Message-Id: <1427987370-15897-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 X-SA-Exim-Connect-IP: 78.86.116.81 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Cc: Paolo Bonzini , Mark Cave-Ayland Subject: [Qemu-devel] [PATCH] sun4m: fix slavio sysctrl and led register sizes 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 These were being incorrectly declared as MISC_SIZE (1 byte) rather than 4 bytes and 2 bytes respectively. As a result accesses clamped to the real register size would unexpectedly fail. Signed-off-by: Mark Cave-Ayland CC: Paolo Bonzini --- hw/misc/slavio_misc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c index 5098595..ec50f10 100644 --- a/hw/misc/slavio_misc.c +++ b/hw/misc/slavio_misc.c @@ -68,6 +68,7 @@ typedef struct APCState { } APCState; #define MISC_SIZE 1 +#define LED_SIZE 2 #define SYSCTRL_SIZE 4 #define AUX1_TC 0x02 @@ -452,13 +453,13 @@ static int slavio_misc_init1(SysBusDevice *sbd) /* 16 bit registers */ /* ss600mp diag LEDs */ memory_region_init_io(&s->led_iomem, OBJECT(s), &slavio_led_mem_ops, s, - "leds", MISC_SIZE); + "leds", LED_SIZE); sysbus_init_mmio(sbd, &s->led_iomem); /* 32 bit registers */ /* System control */ memory_region_init_io(&s->sysctrl_iomem, OBJECT(s), &slavio_sysctrl_mem_ops, s, - "system-control", MISC_SIZE); + "system-control", SYSCTRL_SIZE); sysbus_init_mmio(sbd, &s->sysctrl_iomem); /* AUX 1 (Misc System Functions) */