From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVQPe-0006Ey-Hq for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:20:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVQPY-0001fX-4O for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:20:06 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45664 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVQPX-0001f1-Rn for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:20:00 -0500 Message-ID: <4ED505FE.2090808@suse.de> Date: Tue, 29 Nov 2011 17:19:10 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1322492805-5530-1-git-send-email-afaerber@suse.de> <4ED4D446.3010508@suse.de> <4ED4E56C.9090507@redhat.com> In-Reply-To: <4ED4E56C.9090507@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] exec.c: Fix subpage memory access to RAM MemoryRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org Am 29.11.2011 15:00, schrieb Avi Kivity: > On 11/29/2011 02:47 PM, Andreas F=C3=A4rber wrote: >>> =20 >>> addr +=3D mmio->region_offset[idx]; >>> idx =3D mmio->sub_io_index[idx]; >>> + if (unlikely(idx =3D=3D IO_MEM_RAM)) { >>> + ram_addr_t raddr =3D /*mmio->base |*/ addr; >>> + void *ptr =3D qemu_get_ram_ptr(raddr); >> >> ...and/or this seems to lead to "Bad RAM pointer" (or so) when there's >> ELF code loaded into the subpage at that address despite being IO_MEM_= RAM? >> (Seen, e.g., if for RL78 I increase the page size from 12 to 16.) >> >=20 > addr is relative to the start of the page, instead of the start of the > region. You can use mmio->region_offset[idx] to compensate. That's exactly what the first line of the snippet above does, no? (sorry, there's still a confusing comment from an earlier attempt) Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg