[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API |
Date: |
Mon, 1 Aug 2011 13:23:22 +0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
> >> + VirtIODevice *vdev = proxy->vdev;
> >>
> >> if (PCI_COMMAND == address) {
> >> if (!(val& PCI_COMMAND_MASTER)) {
> >> @@ -525,6 +503,9 @@ static void virtio_write_config(PCIDevice *pci_dev,
> >> uint32_t address,
> >> }
> >> }
> >> }
> >> + if (address == PCI_BASE_ADDRESS_0&& vdev->config_len) {
> >> + vdev->get_config(vdev, vdev->config);
> >> + }
> >>
> >> pci_default_write_config(pci_dev, address, val, len);
> >> msix_write_config(pci_dev, address, val, len);
> >
> >I'm not really sure why did we get the config on map,
> >specifically - Anthony, do you know?
> >But if we want to do that, memory space enable might
> >be a better place. Or maybe we just want a callback on
> >map.
>
>
> 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.
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?
> --
> error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH 20/39] virtio-pci: convert to memory API, Anthony Liguori, 2011/08/01