From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXjOa-00023a-77 for qemu-devel@nongnu.org; Wed, 01 May 2013 22:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXjOW-00058K-AX for qemu-devel@nongnu.org; Wed, 01 May 2013 22:37:20 -0400 Received: from ozlabs.org ([203.10.76.45]:34043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXjOV-00058E-VR for qemu-devel@nongnu.org; Wed, 01 May 2013 22:37:16 -0400 Date: Thu, 2 May 2013 12:24:55 +1000 From: David Gibson Message-ID: <20130502022455.GD13041@truffula.fritz.box> References: <1367378320-9246-1-git-send-email-david@gibson.dropbear.id.au> <1367378320-9246-16-git-send-email-david@gibson.dropbear.id.au> <20130501051631.GB14106@truffula.fritz.box> <51813E31.5070500@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Hf61M2y+wYpnELGG" Content-Disposition: inline In-Reply-To: <51813E31.5070500@redhat.com> Subject: Re: [Qemu-devel] [PATCH 16/17] spapr_vio: take care of creating our own AddressSpace/DMAContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org --Hf61M2y+wYpnELGG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 01, 2013 at 06:09:21PM +0200, Paolo Bonzini wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Il 01/05/2013 07:16, David Gibson ha scritto: > > Lack of atomicity makes me a little nervous there, although I > > guess its ok since qemu is single-threaded. >=20 > Yes. The original plan was to add a boolean return value to > address_space_rw, but I left this for later since I wasn't sure of the > semantics for multipage writes. What happens if the second half of > the destination buffer has an invalid translation? Right now it's > atomic, but it sounds weird for real hardware. So, in this regard I don't think real hardware would be atomic. It would write a certain amount, then generate some sort of bus error when it hits the bad translation. So in general I expect the (guest) OS would need to treat the target of in-flight device to host DMAs as having undefined contents if there's a bus error like that. It would depend on bus and possibly individual device conventions what it could assume about which DMAs are interrupted, and which might still be in-flight. That is, in this sense, we don't expect the hardware to behave atomically at all. The atomicity I was concerned about was atomicity of checking permissions and returning an error based on that check. So, case, I think an error return value from address_space_rw() is appropriate. Semantics would be that if an error is returned you can't tell if the operation has not started, completed, or somewhere in the middle. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Hf61M2y+wYpnELGG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlGBzncACgkQaILKxv3ab8b8NwCgiX6ceOtGkVDepVyJJ9n6iYmV rIgAoJQtkudiiV/a2qyDkfXMkH6nK3Ns =3wnz -----END PGP SIGNATURE----- --Hf61M2y+wYpnELGG--