From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] Re: [RFC PATCH 4/7] ide: IOMMU support Date: Thu, 15 Jul 2010 07:45:06 -0500 Message-ID: <4C3F02D2.2090006@codemonkey.ws> References: <1279086307-9596-1-git-send-email-eduard.munteanu@linux360.ro> <201007141453.06131.paul@codesourcery.com> <20100714183343.GB23755@8bytes.org> <201007142113.44913.paul@codesourcery.com> <4C3E2C2E.70507@codemonkey.ws> <20100715091031.GD23755@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Paul Brook , qemu-devel@nongnu.org, avi@redhat.com, kvm@vger.kernel.org, Eduard - Gabriel Munteanu To: Joerg Roedel Return-path: Received: from mail-qw0-f46.google.com ([209.85.216.46]:52372 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933120Ab0GOMpB (ORCPT ); Thu, 15 Jul 2010 08:45:01 -0400 Received: by qwh6 with SMTP id 6so211900qwh.19 for ; Thu, 15 Jul 2010 05:45:01 -0700 (PDT) In-Reply-To: <20100715091031.GD23755@8bytes.org> Sender: kvm-owner@vger.kernel.org List-ID: On 07/15/2010 04:10 AM, Joerg Roedel wrote: > On Wed, Jul 14, 2010 at 04:29:18PM -0500, Anthony Liguori wrote: > >> On 07/14/2010 03:13 PM, Paul Brook wrote: >> >>> Well, ok, the function name needs fixing too. However I think the only thing >>> missing from the current API is that it does not provide a way to determine >>> which device is performing the access. >>> >> I agree with Paul. >> >> The right approach IMHO is to convert devices to use bus-specific >> functions to access memory. The bus specific functions should have a >> device argument as the first parameter. >> > If this means a seperate interface for device dma accesses and not fold > that functionality into the cpu_physical_memory* interface I agree too :-) > No. PCI devices should never call cpu_physical_memory*. PCI devices should call pci_memory*. ISA devices should call isa_memory*. All device memory accesses should go through their respective buses. There can be multiple IOMMUs at different levels of the device hierarchy. If you don't provide bus-level memory access functions that chain through the hierarchy, it's extremely difficult to implement all the necessary hooks to perform the translations at different places. Regards, Anthony Liguori > Joerg > >