[Top][All Lists]
[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, 19 Oct 2011 03:22:50 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Oct 18, 2011 at 12:46:50PM +1100, David Gibson wrote:
> On Sun, Oct 16, 2011 at 03:15:53PM +0200, Avi Kivity wrote:
> > On 10/14/2011 04:14 AM, David Gibson wrote:
> > > > Virtio is a very, very special case. virtio requires coherent RAM
> > > > access.
> > >
> > > Right. Virtio's access to memory is *not* emulated PCI DMA, it's
> > > god-like hypervisor access to guest system memory. It should
> > > correctly bypass any IOMMU, and so should remain as
> > > cpu_physical_memory_rw() or the atomic accessors, rather than being
> > > converted to this new API.
> >
> > virtio should definitely not bypass an iommu.
>
> So, I just had a chat with Rusty about this. Perhaps it shouldn't,
> but it does. The spec is in terms of guest physical addresses, not
> bus/DMA addresses, and more to the point the Linux driver does *not*
> do the necessary dma_map() and unmap operations to treat this as a PCI
> DMA. So like it or not, god-like hypervisor access rather than
> emulated PCI DMA is what it does.
Fine, but I'm convinced virtio is not unique in that
it wants atomic accesses.
I just looked at hw/rtl8139.c as one example.
It uses a high bit in a 32 bit register to signal
descriptor ownership. Thus we need to read that
bit first, or read the register atomically.
Current code does cpu_physical_memory_read
which does neither of these things, but
it seems to be a bug. An atomic load would
be the best solution.
--
MST
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, (continued)
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Avi Kivity, 2011/10/02
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Michael S. Tsirkin, 2011/10/02
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Avi Kivity, 2011/10/02
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Anthony Liguori, 2011/10/03
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/11
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Michael S. Tsirkin, 2011/10/12
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/13
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Michael S. Tsirkin, 2011/10/16
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Avi Kivity, 2011/10/16
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/17
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Rusty Russell, 2011/10/18
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Avi Kivity, 2011/10/19
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/19
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/11
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Michael S. Tsirkin, 2011/10/12
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/12
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/12
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/11
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Michael S. Tsirkin, 2011/10/12
- Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA, Gerd Hoffmann, 2011/10/12