From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVQpU-0004fA-4z for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:46:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVQpS-0007gb-Tj for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:46:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVQpS-0007gN-Mk for qemu-devel@nongnu.org; Tue, 29 Nov 2011 11:46:46 -0500 Message-ID: <4ED50C73.8090507@redhat.com> Date: Tue, 29 Nov 2011 18:46:43 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1322492805-5530-1-git-send-email-afaerber@suse.de> <4ED4D446.3010508@suse.de> <4ED4E56C.9090507@redhat.com> <4ED505FE.2090808@suse.de> In-Reply-To: <4ED505FE.2090808@suse.de> 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: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: qemu-devel@nongnu.org On 11/29/2011 06:19 PM, Andreas F=C3=A4rber wrote: > 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_ME= M_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 th= e > > 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) > Depends on whether ->region_offset has the right value or not, where's the code that adjusts it? For your case that does f00-fff it should be -0xf00 + ram_addr (of the start of the region). --=20 error compiling committee.c: too many arguments to function