From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb8aG-0000Ob-ON for qemu-devel@nongnu.org; Thu, 26 Mar 2015 10:16:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yb8aB-0002qq-Mn for qemu-devel@nongnu.org; Thu, 26 Mar 2015 10:16:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb8aB-0002qi-DG for qemu-devel@nongnu.org; Thu, 26 Mar 2015 10:16:27 -0400 Message-ID: <5514147E.8050509@redhat.com> Date: Thu, 26 Mar 2015 15:15:26 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1425593606-5909-1-git-send-email-hpoussin@reactos.org> <1425593606-5909-2-git-send-email-hpoussin@reactos.org> <5512CA20.7040305@redhat.com> <5513083D.30008@reactos.org> In-Reply-To: <5513083D.30008@reactos.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/8] rc4030: create custom DMA address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , qemu-devel@nongnu.org Cc: Leon Alrae , Laurent@Vivier.EU, Aurelien Jarno On 25/03/2015 20:10, Herv=C3=A9 Poussineau wrote: > Le 25/03/2015 15:45, Paolo Bonzini a =C3=A9crit : >> >> >> On 05/03/2015 23:13, Herv=C3=A9 Poussineau wrote: >>> Add a new memory region in system address space where DMA address spa= ce >>> definition (the 'translation table') belongs, so we can update on the >>> fly >>> the DMA address space. >>> >>> Signed-off-by: Herv=C3=A9 Poussineau >> >> Would it make sense to just use an IOMMU region for the DMA address >> space? >=20 > I don't really know. Currently, the first user is the dp8393x network > card (a sysbus device), which is connected through the DMA address spac= e. > It means that *every* read or write access needs to be translated, even > those accessing 1 or 2 bytes. dp8393x has no direct connection to the > system memory. > On some other machines, like the m68k Quadra 800, the dp8393x is only > connected to the system memory. >=20 > A second user is the ESP SCSI card in DMA mode, using the DMA address > space with the help of the DMA controller. >=20 > As DMA address space mapping doesn't change much (except initialization > phases), and that it is used for small (1 or 2 bytes) and big transfers > (network packets and disk accesses), I thought that an address space wa= s > better. Both are okay. The IOMMU makes address space changes faster; your scheme is basically a form of caching, it trades update performance for improved translation performance. The trick you're using with shadowing the RAM is nifty, but it leaks a memory region. I'll reply to the main patch. Paolo