From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4i7n-0007rE-Qb for qemu-devel@nongnu.org; Tue, 16 Jun 2015 00:05:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4i7g-0003Br-Cu for qemu-devel@nongnu.org; Tue, 16 Jun 2015 00:05:23 -0400 Message-ID: <557FA068.8000202@redhat.com> Date: Mon, 15 Jun 2015 22:04:56 -0600 From: Eric Blake MIME-Version: 1.0 References: <1434406965-30883-1-git-send-email-jsnow@redhat.com> <1434406965-30883-2-git-send-email-jsnow@redhat.com> <557F57CF.2090102@redhat.com> <557F5B2D.4090408@redhat.com> <557F5FAF.9030707@redhat.com> <557F6359.9060002@redhat.com> In-Reply-To: <557F6359.9060002@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nCjLn35DP4fVLigWop9IJjqn9TXu8EA3K" Subject: Re: [Qemu-devel] [PATCH 1/4] ahci: Do not ignore memory access read size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nCjLn35DP4fVLigWop9IJjqn9TXu8EA3K Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/15/2015 05:44 PM, John Snow wrote: >> Note that while this returns the desired 16 or 32 bits in the low >> order side of the result, it does not guarantee that the remaining >> upper bytes are all 0. I don't know if it matters to callers, or >> even what real hardware does, but you may want to mask things at >> both return statements, to guarantee a stable result limited to >> size bytes of information rather than leaking nearby bytes from the >> rest of the registers being read. >=20 >=20 > I believe the masking is handled by the memory system in general, see > memory_region_read_accessor, which masks the returned uint64_t with an > appropriate value set earlier by access_with_adjusted_size: >=20 > access_mask =3D -1ULL >> (64 - access_size * 8); Good, the caller takes care of it. >=20 > So we're probably OK here, but I can leave a comment if you think it's > too hand-wavey. Yeah, always nicer to state our assumption that we rely on the caller to truncate the result to the desired access size. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nCjLn35DP4fVLigWop9IJjqn9TXu8EA3K 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVf6BoAAoJEKeha0olJ0Nq+88IAI3YgDKxAV5VqJpqhCNr14gY seKZMJhY81TE0bKybOXLzHLEfwh8OnYdtzK3gSaTG+P5gNH83WD9wz7J2HddO5r0 N3uh5YLO5jqrOETGOciStKK2k6RS2SBA5ocbwdqkCeNq2fEBGTqExXlo9RPIDi9T SWe5juy6QL0BRVqAkiQ27w+EpcFi43wKXF0UekLp6hBMKCIJi0ySWACYziU7mS8Q IbOLd/90034zhGAuNTCxXisBHU4JDi+oJ9/W4MWSQrICvuV9lmuDvNPNSXVjjq38 NRfQCDhNYyOtM/DZfekeGGDvCCGo/1SiKasQ6Z9XkJYoqsVdC+vI5mI59Mppn5M= =iNIj -----END PGP SIGNATURE----- --nCjLn35DP4fVLigWop9IJjqn9TXu8EA3K--