From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5KFF-0006QD-W4 for qemu-devel@nongnu.org; Sun, 18 Sep 2011 12:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5KFE-0001eJ-Ks for qemu-devel@nongnu.org; Sun, 18 Sep 2011 12:29:29 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:60924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5KFE-0001eC-8z for qemu-devel@nongnu.org; Sun, 18 Sep 2011 12:29:28 -0400 Message-ID: <4E761C66.9010208@web.de> Date: Sun, 18 Sep 2011 18:29:26 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4E75EA08.4090809@web.de> <4E7614CC.4000206@redhat.com> In-Reply-To: <4E7614CC.4000206@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9ACE9E5B4217011F5A97E4A5" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel , Richard Henderson This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9ACE9E5B4217011F5A97E4A5 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-09-18 17:57, Avi Kivity wrote: > On 09/18/2011 03:54 PM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> We can express the offset of old portio completely via >> MemoryRegionPortio::offset by splitting up regions of different offset= s >> and adjusting those offsets appropriately. >=20 > Please split into two patches - core and isa. They depend on each other. >=20 >> + /* Copy the sub-list and null-terminate it. */ >> + pio =3D g_new(MemoryRegionPortio, count + 1); >> + memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count); >> + memset(pio + count, 0, sizeof(MemoryRegionPortio)); >=20 > Wish: g_copy(pio, pio_init, count); // aka std::copy() >=20 >> @@ -396,12 +395,12 @@ static void memory_region_iorange_read(IORange >> *iorange, >> >> *data =3D ((uint64_t)1<< (width * 8)) - 1; >> if (mrp) { >> - *data =3D mrp->read(mr->opaque, offset + mr->offset); >> + *data =3D mrp->read(mr->opaque, offset + mrp->offset); >> } else if (width =3D=3D 2) { >> mrp =3D find_portio(mr, offset, 1, false); >> assert(mrp); >> - *data =3D mrp->read(mr->opaque, offset + mr->offset) | >> - (mrp->read(mr->opaque, offset + mr->offset + >> 1)<< 8); >> + *data =3D mrp->read(mr->opaque, offset + mrp->offset) | >> + (mrp->read(mr->opaque, offset + mrp->offset + >> 1)<< 8); >> } >> return; >> } >=20 > So long as mr->offset exists, you need to take it into account. Only fair. > And I > don't want to remove memory_region_set_offset() until everything (that > can potentially use it, at least) has been converted. IMO it's easier to fix those potential users before converting them. You need to review them anyway to decide if an offset might be needed, and which one precisely. Are you aware of any candidates? For PIO, there should be none now. Jan --------------enig9ACE9E5B4217011F5A97E4A5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk52HGYACgkQitSsb3rl5xQBQgCg7922zQNwtv3O/Fj2svc0cgsK PyQAnR9ogBh/9wdSmHnSU6unDpYcknN6 =w08x -----END PGP SIGNATURE----- --------------enig9ACE9E5B4217011F5A97E4A5--