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 <kw...@redhat.com> > > Cc: Michael S. Tsirkin <m...@redhat.com> > > > > Signed-off-by: David Gibson <da...@gibson.dropbear.id.au> > > --- > > 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