[Top][All Lists]

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

Re: [Qemu-devel] Re: PATCH, RFC: Generic DMA framework

From: Blue Swirl
Subject: Re: [Qemu-devel] Re: PATCH, RFC: Generic DMA framework
Date: Sun, 26 Aug 2007 20:54:53 +0300

On 8/26/07, Fabrice Bellard <address@hidden> wrote:
> Paul Brook wrote:
> >>>> pci_gdma.diff: Convert PCI devices and targets
> >>>>
> >>>> Any comments? The patches are a bit intrusive and I can't test the
> >>>> targets except that they compile.
> >>> Shouldn't the PCI DMA object be a property of the PCI bus?
> >>> ie. we don't want/need to pass it round as a separate parameter. It can
> >>> be inferred form the device/bus.
> >> I agree. Moreover the DMA is bus specific so I don't see a need to add a
> >> generic DMA layer.
> >
> > I can see use for a generic DMA interface. It has some nice possibilities 
> > for
> > devices which can connect via a variety of busses and maybe for layering
> > different busses within a system.
> >
> > However I don't know how well this will work in practice for the machines 
> > qemu
> > currently emulates.
> I can see more uses for a simple bus interface which could be used at
> least for ISA devices. The API should include bus read/write functions
> (which can be used to implement DMA) and functions to allocate/free a
> memory region as we have for the CPU bus.
> Of course the same must be added for PCI buses so that the PCI memory
> area can be mapped at any position in the CPU address space.

Nice idea. The functions in exec.c could be made more generic by
extending them with an object parameter, for example
int cpu_register_io_memory(int io_index,
                           CPUReadMemoryFunc **mem_read,
                           CPUWriteMemoryFunc **mem_write,
                           void *opaque)
would become
int bus_register_io_memory(void *opaque,
                           int io_index,
                           CPUReadMemoryFunc **mem_read,
                           CPUWriteMemoryFunc **mem_write,
                           void *io_opaque)

The opaque object would be struct PCIBus for PCI devices, something
other for ISA. The ISA DMA DREQ signal is still a problem, or could we
use qemu_irq for that too?

Ideally the devices would not know too much about the bus they are in.

reply via email to

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