qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA
Date: Wed, 12 Oct 2011 11:12:33 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 12, 2011 at 02:09:26PM +1100, David Gibson wrote:
> On Mon, Oct 03, 2011 at 08:17:05AM -0500, Anthony Liguori wrote:
> > On 10/02/2011 07:14 AM, Michael S. Tsirkin wrote:
> > >On Sun, Oct 02, 2011 at 02:01:10PM +0200, Avi Kivity wrote:
> > >>>Hmm, not entirely virtio specific, some devices use stX macros to do the
> > >>>conversion.  E.g. stw_be_phys and stl_le_phys are used in several
> > >>>places.
> > >>
> > >>These are fine - explicit endianness.
> > >
> > >Right. So changing these to e.g. stl_dma and assuming
> > >LE is default seems like a step backwards.
> > 
> > We're generalizing too much.
> > 
> > In general, the device model doesn't need atomic access functions.

Anthony, are you sure? PCI both provides atomic operations for devices (likely
uncommon). PCI express spec strongly recommends at least dword update
granularity for both reads and writes.
Some guests might depend on this.

> > That's because device model RAM access is not coherent with CPU RAM
> > access.
> > Virtio is a very, very special case.  virtio requires coherent RAM
> > access.

E.g., e1000 driver seems to allocate its rings in coherent memory.
Required? Your guess is as good as mine. It seems to work fine
ATM without these guarantees.

> Right, but it should only need that for the actual rings in the virtio
> core.  I was expecting that those would remain as direct physical
> memory accesses - precisely because virtio is special - rather than
> accesses through any kind of DMA interface.

At the moment, yes. Further, that was just an example I know about.
How about msi/msix? We don't want to
split these writes as that would confuse the APIC.

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



reply via email to

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