From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Mark Cave-Ayland Date: Thu, 2 Apr 2015 16:09:30 +0100 Message-Id: <1427987370-15897-1-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: [Qemu-devel] [PATCH] sun4m: fix slavio sysctrl and led register sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Mark Cave-Ayland 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) */ -- 1.7.10.4