qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] pci: Don't create an address space object f


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 2/5] pci: Don't create an address space object for every PCI device
Date: Wed, 24 Apr 2013 23:07:07 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Apr 24, 2013 at 02:34:21PM +0200, Paolo Bonzini wrote:
> Il 24/04/2013 14:01, David Gibson ha scritto:
> > So while its true that the DMAContext handling needs to be better
> > integrated with the MemoryRegion and AddressSpace handling, that commit
> > wasn't actually a step in the right direction for it.  Since then, the
> > DMAContext has been extended so it can backend onto an AddressSpace, and
> > thereby, a MemoryRegion.  Effectively a DMAContext is now an AddressSpace
> > with iommu translation handling on top.
> > 
> > Therefore, this patch essentially reverts the earlier commit, making all
> > PCI devices by default shared the global dma_context_memory which backs
> > onto main system memory.  Those cases which need to set up different DMA
> > address spaces for each PCI device should supply a suitable dma_context_fn
> > in the bus to correctly assign / create suitable DMAContext structures.
> 
> I think this will be handled correctly when I submit IOMMU AddressSpace
> patches (next week or so).  The structure will be
> 
>         PCI device 1                           PCI device 2
>     ---------------------------------------------------------------
>        AddressSpace 1                          AddressSpace 2
>            |                                       |
>            | (enable/disable)                      | (enable/disable)
>            '-------------------.  .----------------'
>                                v  v
>                          IOMMU AddressSpace
>                                 |
>                                 | (translation)
>                                 v
>                            system memory
> 
> VFIO will be able to access the IOMMU AddressSpace simply via
> pci_dev->iommu, and that field will be ==-identical  for different PCI
> devices.

Hrm, ok.  Still seems excessively complicated, but as long as there's
a way to get from the pci device to the common address space, I can
work with that.

-- 
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

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]