From patchwork Thu Mar 7 16:27:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 225883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 936F82C038A for ; Fri, 8 Mar 2013 03:28:56 +1100 (EST) Received: from localhost ([::1]:39203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDdgc-0001fs-PB for incoming@patchwork.ozlabs.org; Thu, 07 Mar 2013 11:28:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDdgB-0001f0-E1 for qemu-devel@nongnu.org; Thu, 07 Mar 2013 11:28:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDdfy-0004HR-G0 for qemu-devel@nongnu.org; Thu, 07 Mar 2013 11:28:27 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:41870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDdfy-0004Gi-5S for qemu-devel@nongnu.org; Thu, 07 Mar 2013 11:28:14 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Mar 2013 16:25:44 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 7 Mar 2013 16:25:26 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 460EF1B0806B for ; Thu, 7 Mar 2013 16:27:53 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r27GRh7M17760298 for ; Thu, 7 Mar 2013 16:27:44 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r27GRqhm020542 for ; Thu, 7 Mar 2013 09:27:52 -0700 Received: from [9.152.224.94] (dyn-9-152-224-94.boeblingen.de.ibm.com [9.152.224.94]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r27GRpeu020513; Thu, 7 Mar 2013 09:27:52 -0700 Message-ID: <5138C007.6080305@de.ibm.com> Date: Thu, 07 Mar 2013 17:27:51 +0100 From: Christian Borntraeger User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: Anthony Liguori 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> <87621319kc.fsf@codemonkey.ws> In-Reply-To: <87621319kc.fsf@codemonkey.ws> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13030716-5024-0000-0000-000005654CEA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.107 Cc: qemu-devel@nongnu.org, Cornelia Huck , Jens Freimann , Alexander Graf , Jesse Larrew Subject: Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org > You're misreading how this works. > > Host features are set based on command line arguments. This is > advertised to the guest. The vdev->get_config() call then sanitizes > features. For instance, look at: > > static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features) > { > VirtIONet *n = to_virtio_net(vdev); > NetClientState *nc = qemu_get_queue(n->nic); > > features |= (1 << VIRTIO_NET_F_MAC); > > if (!peer_has_vnet_hdr(n)) { > features &= ~(0x1 << VIRTIO_NET_F_CSUM); > > > This removes the VIRTIO_NET_F_CSUM feature if the peer doesn't support > it. It's presupposing that the feature bit is set. > > It's a bug in both virtio-ccw that features=0 when get_features is > called. You can also tell this with: > > [10:02 AM] anthony@titi:~/git/qemu/hw/s390x$ grep DEFINE_VIRTIO_NET_FEATURES * > virtio-ccw.c: DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]), > > So virtio-s390 is doing it wrong, but virtio-ccw looks like its doing it > right. There is a parse error in your statement (error in both virtio-ccw). Is virtio-ccw ok or not? At least, this patch seems to work. (That also implies, that a transport must not hide virtio feature bits). From: Christian Borntraeger Date: Thu, 7 Mar 2013 17:21:41 +0100 Subject: [PATCH] Allow virtio-net features for legacy s390 virtio bus Enable all virtio-net features for the legacy s390 virtio bus. This also fixes kernel BUG at /usr/src/packages/BUILD/kernel-default-3.0.58/linux-3.0/drivers/s390/kvm/kvm_virtio.c:121! Signed-off-by: Christian Borntraeger Reviewed-by: Anthony Liguori --- hw/s390x/s390-virtio-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 1200691..a8a8e19 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -399,6 +399,7 @@ static const VirtIOBindings virtio_s390_bindings = { static Property s390_virtio_net_properties[] = { DEFINE_NIC_PROPERTIES(VirtIOS390Device, nic), + DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features), DEFINE_PROP_UINT32("x-txtimer", VirtIOS390Device, net.txtimer, TX_TIMER_INTERVAL), DEFINE_PROP_INT32("x-txburst", VirtIOS390Device,