From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v3 01/39] virtio-pci: get config on init Date: Sun, 07 Aug 2011 11:20:53 +0300 Message-ID: <4E3E4AE5.3030007@redhat.com> References: <1312463195-13605-1-git-send-email-avi@redhat.com> <1312463195-13605-2-git-send-email-avi@redhat.com> <4E3BF599.4050207@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" To: Anthony Liguori Return-path: In-Reply-To: <4E3BF599.4050207@codemonkey.ws> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 08/05/2011 04:52 PM, Anthony Liguori wrote: >> static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, >> @@ -689,6 +686,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, >> VirtIODevice *vdev) >> proxy->host_features |= 0x1<< VIRTIO_F_NOTIFY_ON_EMPTY; >> proxy->host_features |= 0x1<< VIRTIO_F_BAD_FEATURE; >> proxy->host_features = vdev->get_features(vdev, >> proxy->host_features); >> + >> + if (vdev->config_len) { >> + vdev->get_config(vdev, vdev->config); >> + } > > > Thinking more closely, I don't think this right. > > Updating on map ensured that the config was refreshed after each time > the bar was mapped. In the very least, the config needs to be > refreshed during reset because the guest may write to the guest space > which should get cleared after reset. Michael, please provide the correct fix. Best merged directly, not via my patchset. -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpybY-0006dy-EE for qemu-devel@nongnu.org; Sun, 07 Aug 2011 04:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpybX-0003fC-HU for qemu-devel@nongnu.org; Sun, 07 Aug 2011 04:21:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpybX-0003f6-AX for qemu-devel@nongnu.org; Sun, 07 Aug 2011 04:21:03 -0400 Message-ID: <4E3E4AE5.3030007@redhat.com> Date: Sun, 07 Aug 2011 11:20:53 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1312463195-13605-1-git-send-email-avi@redhat.com> <1312463195-13605-2-git-send-email-avi@redhat.com> <4E3BF599.4050207@codemonkey.ws> In-Reply-To: <4E3BF599.4050207@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" On 08/05/2011 04:52 PM, Anthony Liguori wrote: >> static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, >> @@ -689,6 +686,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, >> VirtIODevice *vdev) >> proxy->host_features |= 0x1<< VIRTIO_F_NOTIFY_ON_EMPTY; >> proxy->host_features |= 0x1<< VIRTIO_F_BAD_FEATURE; >> proxy->host_features = vdev->get_features(vdev, >> proxy->host_features); >> + >> + if (vdev->config_len) { >> + vdev->get_config(vdev, vdev->config); >> + } > > > Thinking more closely, I don't think this right. > > Updating on map ensured that the config was refreshed after each time > the bar was mapped. In the very least, the config needs to be > refreshed during reset because the guest may write to the guest space > which should get cleared after reset. Michael, please provide the correct fix. Best merged directly, not via my patchset. -- error compiling committee.c: too many arguments to function