Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Michael S. Tsirkin
On Wed, Aug 03, 2011 at 06:23:41PM +0300, Avi Kivity wrote: > On 08/03/2011 06:16 PM, Michael S. Tsirkin wrote: > >> > >> Well, the reason we have this logic here, I think, is > >> to make sure it runs before the guest accesses > >> the configuration with a write access. > >> > >> I'm not sure

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Avi Kivity
On 08/03/2011 06:16 PM, Michael S. Tsirkin wrote: > > Well, the reason we have this logic here, I think, is > to make sure it runs before the guest accesses > the configuration with a write access. > > I'm not sure why we don't do this in the init > callback - Anthony? So the following shou

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-03 Thread Michael S. Tsirkin
On Mon, Aug 01, 2011 at 01:23:22PM +0300, Michael S. Tsirkin wrote: > On Mon, Aug 01, 2011 at 12:35:44PM +0300, Avi Kivity wrote: > > On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: > > >> > > >> static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, > > >>

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-02 Thread Gerd Hoffmann
On 08/02/11 11:17, Avi Kivity wrote: On 08/01/2011 10:53 PM, Michael S. Tsirkin wrote: > > > Just because a memory region becomes visible to the cpu is no reason > to have a callback. From the device perspective, it can't tell that > it happened. BTW this is what qxl does, too, conceptually: on

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-02 Thread Avi Kivity
On 08/02/2011 12:34 PM, Michael S. Tsirkin wrote: On Tue, Aug 02, 2011 at 12:17:06PM +0300, Avi Kivity wrote: > On 08/01/2011 10:53 PM, Michael S. Tsirkin wrote: > >> > >> > >> Just because a memory region becomes visible to the cpu is no reason > >> to have a callback. From the device

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-02 Thread Michael S. Tsirkin
On Tue, Aug 02, 2011 at 12:17:06PM +0300, Avi Kivity wrote: > On 08/01/2011 10:53 PM, Michael S. Tsirkin wrote: > >> > >> > >> Just because a memory region becomes visible to the cpu is no reason > >> to have a callback. From the device perspective, it can't tell that > >> it happened. > > > >B

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-02 Thread Avi Kivity
On 08/01/2011 10:53 PM, Michael S. Tsirkin wrote: > > > Just because a memory region becomes visible to the cpu is no reason > to have a callback. From the device perspective, it can't tell that > it happened. BTW this is what qxl does, too, conceptually: on config writes, it peeks at the ba

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Anthony Liguori
On 08/01/2011 05:23 AM, Michael S. Tsirkin wrote: On Mon, Aug 01, 2011 at 12:35:44PM +0300, Avi Kivity wrote: On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, uint32_t val, int len)

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Anthony Liguori
On 08/01/2011 03:26 AM, Michael S. Tsirkin wrote: On Sun, Jul 31, 2011 at 08:57:43PM +0300, Avi Kivity wrote: @@ -491,30 +473,26 @@ static void virtio_pci_config_writel(void *opaque, uint32_t addr, uint32_t val) virtio_config_writel(proxy->vdev, addr, val); } -static void virtio_map(PC

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Michael S. Tsirkin
On Mon, Aug 01, 2011 at 12:35:44PM +0300, Avi Kivity wrote: > On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: > >> > >> static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, > >> uint32_t val, int len) > >> { > >> VirtIOPCIProxy *proxy =

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Michael S. Tsirkin
On Mon, Aug 01, 2011 at 12:35:44PM +0300, Avi Kivity wrote: > On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: > >> > >> static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, > >> uint32_t val, int len) > >> { > >> VirtIOPCIProxy *proxy =

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Avi Kivity
On 08/01/2011 11:26 AM, Michael S. Tsirkin wrote: > > static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, > uint32_t val, int len) > { > VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); > +VirtIODevice *vdev =

Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-08-01 Thread Michael S. Tsirkin
On Sun, Jul 31, 2011 at 08:57:43PM +0300, Avi Kivity wrote: > @@ -491,30 +473,26 @@ static void virtio_pci_config_writel(void *opaque, > uint32_t addr, uint32_t val) > virtio_config_writel(proxy->vdev, addr, val); > } > > -static void virtio_map(PCIDevice *pci_dev, int region_num, > -

[Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API

2011-07-31 Thread Avi Kivity
except msix. [jan: fix build] Signed-off-by: Avi Kivity --- hw/virtio-pci.c | 74 ++ hw/virtio-pci.h |2 +- 2 files changed, 31 insertions(+), 45 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index d685243..c114e1a 100644