Received: from eggs.gnu.org ([208.118.235.92]:36039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Sr6-0003a7-NL for qemu-devel@nongnu.org; Tue, 13 Mar 2012 10:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7Sqe-0001F1-AD for qemu-devel@nongnu.org; Tue, 13 Mar 2012 10:37:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44477 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Sqe-0001Ec-0s for qemu-devel@nongnu.org; Tue, 13 Mar 2012 10:37:12 -0400 Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20120313140430.GS24916@truffala.fritz.box> Date: Tue, 13 Mar 2012 15:37:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1331269308-22372-1-git-send-email-david@gibson.dropbear.id.au> <1331269308-22372-11-git-send-email-david@gibson.dropbear.id.au> <4F59DA05.40204@redhat.com> <20120313050734.GL24916@truffala.fritz.box> <78EB34FD-B41C-4D40-B05D-0BDB070EA6AA@suse.de> <20120313140430.GS24916@truffala.fritz.box> Subject: Re: [Qemu-devel] [PATCH 10/13] iommu: Introduce IOMMU emulation infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Paolo Bonzini , mst@redhat.com, eduard.munteanu@linux360.ro, qemu-devel@nongnu.org, rth@twiddle.net On 13.03.2012, at 15:04, David Gibson wrote: > On Tue, Mar 13, 2012 at 02:56:47PM +0100, Alexander Graf wrote: >>=20 >> On 13.03.2012, at 06:07, David Gibson wrote: >>=20 >>> On Fri, Mar 09, 2012 at 11:23:01AM +0100, Paolo Bonzini wrote: >>>> Il 09/03/2012 06:01, David Gibson ha scritto: >>>>> This patch adds the basic infrastructure necessary to emulate an = IOMMU >>>>> visible to the guest. The DMAContext structure is extended with >>>>> information and a callback describing the translation, and the = various >>>>> DMA functions used by devices will now perform IOMMU translation = using >>>>> this callback. >>>>>=20 >>>>> Cc: Michael S. Tsirkin >>>>> Cc: Richard Henderson >>>>>=20 >>>>> Signed-off-by: Eduard - Gabriel Munteanu = >>>>> Signed-off-by: David Gibson >>>>> --- >>>>> configure | 12 ++++ >>>>> dma-helpers.c | 191 = +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>>>> dma.h | 125 +++++++++++++++++++++++++++++++------- >>>>> 3 files changed, 306 insertions(+), 22 deletions(-) >>>>>=20 >>>>> diff --git a/configure b/configure >>>>> index a5eb832..e6fba2f 100755 >>>>> --- a/configure >>>>> +++ b/configure >>>>> @@ -138,6 +138,7 @@ linux_aio=3D"" >>>>> cap_ng=3D"" >>>>> attr=3D"" >>>>> libattr=3D"" >>>>> +iommu=3D"yes" >>>>> xfs=3D"" >>>>>=20 >>>>> vhost_net=3D"no" >>>>> @@ -784,6 +785,10 @@ for opt do >>>>> ;; >>>>> --enable-vhost-net) vhost_net=3D"yes" >>>>> ;; >>>>> + --enable-iommu) iommu=3D"yes" >>>>> + ;; >>>>> + --disable-iommu) iommu=3D"no" >>>>> + ;; >>>>=20 >>>> This need not be a configure option. Just enable it, or it will >>>> bitrot. >>>=20 >>> I did wonder about that. I'd like to hear that suggested by more = than >>> one person before I unconditionally add code which will impose an >>> overhead on all emulated DMAs. >>=20 >> Maybe make it a target option? That way targets that want and need >> an IOMMU can compile the code in, while the others don't see >> performance hits. That would of course mean that we'd still have >> conditional code paths, but at least they wouldn't bitrot, as >> building multiple targets means you'd build both paths. >=20 > Heh, yeah, so I tried that way back. It's problematic, unfortunately, > as it would require pulling a number of things out of libhw and back > into target dependent code. Hrm. How about measuring the performance overhead then? Maybe it's = negligible? Alex