From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDZwI-00033k-MB for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:28:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDZwH-0002j7-4o for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:28:50 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:44783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDZwG-0002if-SR for qemu-devel@nongnu.org; Thu, 07 Mar 2013 07:28:49 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Mar 2013 12:27:38 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A688617D805C for ; Thu, 7 Mar 2013 12:29:06 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r27CSKhN19464346 for ; Thu, 7 Mar 2013 12:28:20 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r27CSTe6029357 for ; Thu, 7 Mar 2013 05:28:29 -0700 Message-ID: <513887EC.3050305@de.ibm.com> Date: Thu, 07 Mar 2013 13:28:28 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1360108037-9211-1-git-send-email-jlarrew@linux.vnet.ibm.com> <1360108037-9211-3-git-send-email-jlarrew@linux.vnet.ibm.com> <513621F7.9030403@suse.de> <51362575.2000908@de.ibm.com> In-Reply-To: <51362575.2000908@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Cornelia Huck , aliguori@us.ibm.com, qemu-devel@nongnu.org, Jesse Larrew , Jens Freimann Ping. Anthony, Jesse, how is this supposed to work? Christian On 05/03/13 18:03, Christian Borntraeger wrote: > On 05/03/13 17:48, Alexander Graf wrote: >> On 02/06/2013 12:47 AM, Jesse Larrew wrote: >>> Currently, the config size for virtio devices is hard coded. When a new >>> feature is added that changes the config size, drivers that assume a static >>> config size will break. For purposes of backward compatibility, there needs >>> to be a way to inform drivers of the config size needed to accommodate the >>> set of features enabled. >>> >>> Signed-off-by: Jesse Larrew >> >> The following patch gets my s390 virtio guest working again, but I doubt it's the right fix. >> >> What is the expected dependency chain of feature calls? >> >> >> Alex >> >> diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c >> index 089ed92..81be971 100644 >> --- a/hw/s390x/s390-virtio-bus.c >> +++ b/hw/s390x/s390-virtio-bus.c >> @@ -154,7 +154,7 @@ static int s390_virtio_net_init(VirtIOS390Device *dev) >> VirtIODevice *vdev; >> >> vdev = virtio_net_init((DeviceState *)dev, &dev->nic, &dev->net, >> - dev->host_features); >> + dev->host_features | (1 << VIRTIO_NET_F_MAC)); >> if (!vdev) { >> return -1; >> } >> >> > > Actually this goes back to > > commit 1e89ad5b00ba0426d4e949c9e6ce2926c15b81b7 > Author: Anthony Liguori > Date: Tue Feb 5 17:47:15 2013 -0600 > > virtio-net: pass host features to virtio_net_init > > Signed-off-by: Anthony Liguori > > virtio-s390 calls virtio_net_init before it actually queries the dev->features into > the host_features. virtio-ccw does the same, but it does not BUG. (Its still wrong IMHO) > > Same for virtio-pci: > > > static int virtio_net_init_pci(PCIDevice *pci_dev) > { > VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); > VirtIODevice *vdev; > > vdev = virtio_net_init(&pci_dev->qdev, &proxy->nic, &proxy->net, > proxy->host_features); <--- use host_feature > > vdev->nvectors = proxy->nvectors; > virtio_init_pci(proxy, vdev); <------------- actually gets host_feature (!) > [..] > > > Good that my old rusty virtio-ccw transport has lots of BUG_ONS :-) > > >