qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA
Date: Sat, 3 Sep 2011 12:25:10 +0000

On Fri, Sep 2, 2011 at 8:35 AM, Avi Kivity <address@hidden> wrote:
> On 09/01/2011 07:32 PM, Anthony Liguori wrote:
>>>
>>> True. But I still think it's the right thing.
>>>
>>> We can't really pass a MemoryRegion as the source address, since there
>>> is no per-device MemoryRegion.
>>
>>
>> Couldn't the PCI bus expose 255 MemoryRegions though?
>
> What would those mean?  A MemoryRegion is something that can respond to
> reads and writes.

If I understand Anthony's idea, the MemoryRegion (one of 255 in this
case) would identify the device in bus agnostic (even PIO vs. MMIO)
way. In the numerous previously failed attempts to manage generic DMA,
the upstream handle was either an opaque pointer, bus specific
structure or IOMMU handle, but this is much better. From the device
MemoryRegion, the bus should be discoverable and then the bus can
resolve the chain back to host RAM with similar logic to perform the
DMA via IOMMUs or whatever strange buses or devices are involved in
between. Awesome!

>> It could still use the pci_address_space I think since that should include
>> RAM too, right?
>>
>
> No.
>
>> In fact, initially, you could have a pci_bus_get_device_memory_region(bus,
>> dev) that just returns pci_address_space().
>>
>> You just need the memory_st[bwl] functions I think.
>>
>
> Maybe we need a different type of object here - MemoryClient or something.
>
> --
> I have a truly marvellous patch that fixes the bug which this
> signature is too narrow to contain.
>
>
>



reply via email to

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