From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6EtF-00004s-2p for qemu-devel@nongnu.org; Sat, 10 Mar 2012 00:30:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6EtB-0008E9-Vi for qemu-devel@nongnu.org; Sat, 10 Mar 2012 00:30:48 -0500 Received: from ozlabs.org ([203.10.76.45]:50688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6EtB-0008DH-87 for qemu-devel@nongnu.org; Sat, 10 Mar 2012 00:30:45 -0500 Date: Sat, 10 Mar 2012 16:30:25 +1100 From: David Gibson Message-ID: <20120310053025.GC24916@truffala.fritz.box> References: <1331269308-22372-1-git-send-email-david@gibson.dropbear.id.au> <1331269308-22372-9-git-send-email-david@gibson.dropbear.id.au> <4F59D1E4.7030807@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F59D1E4.7030807@redhat.com> Subject: Re: [Qemu-devel] [PATCH 08/13] ide/ahci: Use universal DMA helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: rth@twiddle.net, eduard.munteanu@linux360.ro, mst@redhat.com, qemu-devel@nongnu.org, agraf@suse.de On Fri, Mar 09, 2012 at 10:48:20AM +0100, Kevin Wolf wrote: > Am 09.03.2012 06:01, schrieb David Gibson: > > The AHCI device can provide both PCI and SysBus AHCI device > > emulations. For this reason, it wasn't previously converted to use > > the pci_dma_*() helper functions. Now that we have universal DMA > > helper functions, this converts AHCI to use them. > > > > The DMAContext is obtained from pci_dma_context() in the PCI case and > > set to NULL in the SysBus case (i.e. we assume for now that a SysBus > > AHCI has no IOMMU translation). > > > > Cc: Kevin Wolf > > Cc: Michael S. Tsirkin > > > > Signed-off-by: David Gibson > > --- > > hw/ide/ahci.c | 7 ++++--- > > hw/ide/ahci.h | 3 ++- > > hw/ide/ich.c | 2 +- > > 3 files changed, 7 insertions(+), 5 deletions(-) > > > > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > > index 6a218b5..3d31179 100644 > > --- a/hw/ide/ahci.c > > +++ b/hw/ide/ahci.c > > @@ -668,7 +668,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist) > > AHCI_SG *tbl = (AHCI_SG *)prdt; > > > > /* FIXME: pass the correct DMAContext */ > > - qemu_sglist_init(sglist, sglist_alloc_hint, NULL); > > + qemu_sglist_init(sglist, sglist_alloc_hint, ad->hba->dma); > > Does the FIXME still apply after this change? Ah, no, I'll fix that in the next version. I've also spotted there are still a bunch of cpu_physical_memory_*() calls in there that I either missed, or which have been added since I did the conversion. I'll tackle that next week. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson