From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5JWl-0003KU-Ca for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:43:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5JWj-0000nm-VR for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:43:31 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:54157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5JWj-0000nd-Kv for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:43:29 -0400 Message-ID: <4E76119F.5040004@web.de> Date: Sun, 18 Sep 2011 17:43:27 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4E75E7A4.50702@web.de> <4E75E96E.90101@web.de> <4E761051.9000204@redhat.com> In-Reply-To: <4E761051.9000204@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8380A459053B7D8A6F0F03B9" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses 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) --------------enig8380A459053B7D8A6F0F03B9 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-09-18 17:37, Avi Kivity wrote: > On 09/18/2011 03:51 PM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> As we register old portio regions via ioport_register, we are also >> responsible for providing the word access wrapper. >> >> Signed-off-by: Jan Kiszka >> --- >> >> Oops, was lacking a shift for word reads. >> >> memory.c | 10 ++++++++++ >> 1 files changed, 10 insertions(+), 0 deletions(-) >> >> diff --git a/memory.c b/memory.c >> index b3ee232..aef4702 100644 >> --- a/memory.c >> +++ b/memory.c >> @@ -397,6 +397,11 @@ 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); >> + } 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); >> } >=20 > What about width 4? This is PIO, limited by the x86 address space to 16 bit. Will add a comme= nt. > Why not use access_with_adjusted_size()? Because of different accessor prototypes. Jan --------------enig8380A459053B7D8A6F0F03B9 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/ iEYEARECAAYFAk52EZ8ACgkQitSsb3rl5xRSrACg2bWEEZNTFdtdbI+dSGTQfY2p yLUAoLLbBeIWli3xgMVB+L517UFIOfTo =O/Ju -----END PGP SIGNATURE----- --------------enig8380A459053B7D8A6F0F03B9--