From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiPds-0001ml-GR for qemu-devel@nongnu.org; Thu, 08 May 2014 10:49:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiPdm-0008Pz-Cr for qemu-devel@nongnu.org; Thu, 08 May 2014 10:49:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiPdm-0008Pp-6a for qemu-devel@nongnu.org; Thu, 08 May 2014 10:49:42 -0400 Message-ID: <536B996E.8030201@redhat.com> Date: Thu, 08 May 2014 16:49:18 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1392800720-2765-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1392800720-2765-2-git-send-email-mark.cave-ayland@ilande.co.uk> <5316F701.5020500@redhat.com> <536A8FD0.6000401@redhat.com> <536B985C.9060207@ilande.co.uk> In-Reply-To: <536B985C.9060207@ilande.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: Peter Maydell , qemu-devel@nongnu.org, Blue Swirl , Bob Breuer , Anthony Liguori , Artyom Tarasenko Il 08/05/2014 16:44, Mark Cave-Ayland ha scritto: >>> >>>> + case CG3_REG_FBC_CURSTART ... CG3_REG_SIZE: >>>> + val = s->regs[addr - 0x10]; >>>> + break; >>>> + default: >>> >>> Something weird here, you can access regs[16] if addr == CG3_REG_SIZE. >>> >>> The same happens in the write path. >> >> Ping. I cannot fix it without access to the datasheet, though I suspect >> you want CG3_REG_SIZE - 1. > > Hi Paolo, > > Sorry I didn't think you could access regs[16] since the MemoryRegion > size is set to CG3_REG_SIZE too (and so I hope should only handle > accesses from 0 to CG3_REG_SIZE - 1). > > Anyway, I've quickly tried a Solaris 8 boot test replacing CG3_REG_SIZE > with CG3_REG_SIZE - 1 for the case statements in both the read and write > paths and everything still works, so happy for you to go ahead and fix it. Ah okay so it's a false positive. But yes, it's better to fix it. I'll try to send a patch for qemu-trivial. Paolo