From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org, fabrice@bellard.org,
Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] Re: PATCH, RFC: Generic DMA framework
Date: Tue, 28 Aug 2007 22:03:36 +0300 [thread overview]
Message-ID: <f43fc5580708281203k19068a8ag934d97f3450527b5@mail.gmail.com> (raw)
In-Reply-To: <f43fc5580708261054n23c80d3at8a0a2e6f706d69c6@mail.gmail.com>
On 8/26/07, Blue Swirl <blauwirbel@gmail.com> wrote:
> On 8/26/07, Fabrice Bellard <fabrice@bellard.org> 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?
On second thought, there is a huge difference between a write access
originating from CPU destined for the device and the device writing to
main memory. The CPU address could be 0xf000 1000, which may translate
to a bus address of 0x1000, as an example. The device could write to
main memory using the same bus address 0x1000, but this time the IOMMU
would map this to for example 0x1234 5000, or without an IOMMU it
would be just 0x1000.
So for the CPU physical address to bus address translation, my
proposal would work. But the system does not work in the direction of
device to memory, which was the original problem.
The devices in the same bus could access each other as well. How would
these accesses be identified, so that they are not device to memory
accesses?
Maybe I have missed something important?
next prev parent reply other threads:[~2007-08-28 19:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 19:48 [Qemu-devel] PATCH, RFC: Generic DMA framework Blue Swirl
2007-08-16 18:18 ` [Qemu-devel] " Blue Swirl
2007-08-16 19:58 ` malc
2007-08-19 17:46 ` Blue Swirl
2007-08-24 19:40 ` Blue Swirl
2007-08-24 20:18 ` Paul Brook
2007-08-24 23:33 ` Fabrice Bellard
2007-08-25 0:29 ` Paul Brook
2007-08-26 11:30 ` Fabrice Bellard
2007-08-26 17:54 ` Blue Swirl
2007-08-28 19:03 ` Blue Swirl [this message]
2007-08-28 19:43 ` Paul Brook
2007-08-29 17:00 ` Blue Swirl
2007-08-29 20:39 ` Paul Brook
2007-08-29 21:18 ` Paul Brook
2007-09-08 14:07 ` Blue Swirl
2007-09-08 14:31 ` Paul Brook
2007-09-08 14:53 ` Blue Swirl
2007-09-08 16:03 ` Paul Brook
2007-09-15 16:16 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f43fc5580708281203k19068a8ag934d97f3450527b5@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=fabrice@bellard.org \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).