From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgUH9-0001lk-0I for qemu-devel@nongnu.org; Mon, 28 Sep 2015 04:59:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgUH5-0005Hw-Pi for qemu-devel@nongnu.org; Mon, 28 Sep 2015 04:59:10 -0400 References: <1443069231-14856-1-git-send-email-david@gibson.dropbear.id.au> <1443069231-14856-6-git-send-email-david@gibson.dropbear.id.au> <56052DEC.6040500@redhat.com> <20150925113349.GL11620@voom.redhat.com> <5605383E.1090406@redhat.com> <20150926065414.GM11620@voom.redhat.com> From: Paolo Bonzini Message-ID: <56090157.2000903@redhat.com> Date: Mon, 28 Sep 2015 10:59:03 +0200 MIME-Version: 1.0 In-Reply-To: <20150926065414.GM11620@voom.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/7] memory: Allow replay of IOMMU mapping notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, abologna@redhat.com, alex.williamson@redhat.com, qemu-ppc@nongnu.org On 26/09/2015 08:54, David Gibson wrote: > On Fri, Sep 25, 2015 at 02:04:14PM +0200, Paolo Bonzini wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 >>=20 >>=20 >>=20 >> On 25/09/2015 13:33, David Gibson wrote: >>> 1) Is there a case where using the no-replay functions makes=20 >>> sense? >>>=20 >>> I'm not sure. I think vfio is the only user so far, so I >>> guess that's technically a no. I was reluctant to change the >>> interface and semantics just off the bat, though. >>=20 >> Considering memory_region_listener does the reply, I think it's=20 >> okay. >=20 > Uh.. just to be clear, are you saying I should change this so > there's only the replaying interface? Maybe... The only issue is the "granularity" argument, which is not in memory_region_register_iommu_notifier. That makes me wonder if the replay and registration make sense as separate operations. What about adding a new function memory_region_iommu_replay and separate the two phases? >> For solving the problem that Laurent mentioned, using int128 >> seems like the easiest solution... >=20 > Maybe. It means I have to do all the address calculation in the > loop with an int128, then truncate it to do the actual call. That > seems harder to me than the overflow check I added, but I suppose > it's conceptually similar in some ways. Your overflow check is also okay, I wrote this before seeing the updated version. Paolo