Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FRBxg-0007cw-Sm for qemu-devel@nongnu.org; Wed, 05 Apr 2006 13:38:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FRBxe-0007a7-I4 for qemu-devel@nongnu.org; Wed, 05 Apr 2006 13:38:31 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRBxe-0007Zx-EW for qemu-devel@nongnu.org; Wed, 05 Apr 2006 13:38:30 -0400 Received: from [65.54.175.39] (helo=hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FRC1C-0007tB-VC for qemu-devel@nongnu.org; Wed, 05 Apr 2006 13:42:11 -0400 Message-ID: In-Reply-To: <200604051723.17846.lists@naasa.net> From: "Blue Swirl" Subject: Re: [Qemu-devel] SPARC iommu mapping Date: Wed, 05 Apr 2006 19:36:56 +0200 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jplatte@naasa.net, qemu-devel@nongnu.org > > To find this problem, I enabled debugging in the esp.c file and printed >the > > mapped address (after iommu mapping). In some cases the mapped address >is > > zero: > > > ESP: DMA address 0beb8000 > > ESP: DMA address 00000000 > >I didn't find a manual of the SBUS IOMMU. But if I understand the contents >of >newer implementations of an IOMMU, each entry in this MMU table has a valid >bit. And therefore, a 0 entry is invalid. But the current implementation of >qemu's IOMMU does not check for a valid bit. Where can I find more >information on this topic? And is a besser IOMMU currently in development? I don't have any better documentation either, I just coded against what Proll and Linux expect. But the theory of operation is simple. Much like how the MMU translates CPU's virtual addresses to physical addresses for memory, IOMMU translates device virtual memory accesses to physical addresses. The VA to PA entries are found in a simple page table. In the case of not finding a valid translation entry, IOMMU can't fault the device like normal MMU can easily fault the CPU. I don't know what should happen then, probably put the address to AFAR register and raise some interrupt, while the device (for example Ethernet controller) waiting for the data suffers in limbo. I think it would be strange for an OS to rely on this, so I guess it's a bug somewhere else. My guess for the valid bit is that it's used in a real IOMMU to select the entries that will be loaded to its internal translation buffer. The DMA controllers for both ESP and Lance are within the same page. This means that in Qemu, DMA controller register accesses for either of them go to just one of these. It just happens to work, but maybe this causes the problem. You could try to confirm this by enabling also DEBUG_LANCE and see if there is troublesome activity in the Lance direction near the bad accesses. Can you provide a test case so that I could try it as well? _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963