From patchwork Thu Oct 29 14:43:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dustin Kirkland X-Patchwork-Id: 56473 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9TEi2KN032555 for ; Thu, 29 Oct 2009 14:44:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754524AbZJ2Onk (ORCPT ); Thu, 29 Oct 2009 10:43:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754564AbZJ2Onj (ORCPT ); Thu, 29 Oct 2009 10:43:39 -0400 Received: from adelie.canonical.com ([91.189.90.139]:45603 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754246AbZJ2Onj (ORCPT ); Thu, 29 Oct 2009 10:43:39 -0400 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1N3WE1-0007aM-RE; Thu, 29 Oct 2009 14:43:41 +0000 Received: from cpe-66-69-232-158.austin.res.rr.com ([66.69.232.158] helo=[192.168.1.146]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1N3WE1-0006jE-Hv; Thu, 29 Oct 2009 14:43:41 +0000 Subject: Re: [Qemu-devel] qemu-kvm-0.11 regression, crashes on older guests with virtio network From: Dustin Kirkland Reply-To: kirkland@canonical.com To: Mark McLoughlin Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Anthony Liguori , Scott Tsai In-Reply-To: <1256807803.10825.39.camel@blaa> References: <1256807803.10825.39.camel@blaa> Date: Thu, 29 Oct 2009 09:43:37 -0500 Message-ID: <1256827417.25064.122.camel@x200> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Work around broken virtio drivers in 2.6.26 Signed-off-by: Anthony Liguori diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 9bce3a0..5b615f9 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -120,6 +120,9 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev) if (tap_has_vnet_hdr(host)) { tap_using_vnet_hdr(host, 1); +#if 0 + /* Stop advertising advanced features until we work around the fact + * that this is totally broken in 2.6.26 kernels */ features |= (1 << VIRTIO_NET_F_CSUM); features |= (1 << VIRTIO_NET_F_GUEST_CSUM); features |= (1 << VIRTIO_NET_F_GUEST_TSO4); @@ -130,6 +133,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev) features |= (1 << VIRTIO_NET_F_HOST_ECN); features |= (1 << VIRTIO_NET_F_MRG_RXBUF); /* Kernel can't actually handle UFO in software currently. */ +#endif } #endif @@ -374,8 +378,14 @@ static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt, struct virtio_net_hdr *hdr = iov[0].iov_base; int offset = 0; +#if 0 hdr->flags = 0; hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; +#else + /* we need to clear out the whole header, including any garbage that may be + */ + memset(hdr, 0, sizeof(*hdr)); +#endif #ifdef TAP_VNET_HDR if (tap_has_vnet_hdr(n->vc->vlan->first_client)) {