From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LMjnq-0004i5-JU for qemu-devel@nongnu.org; Tue, 13 Jan 2009 08:59:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LMjno-0004g1-IV for qemu-devel@nongnu.org; Tue, 13 Jan 2009 08:59:33 -0500 Received: from [199.232.76.173] (port=50201 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMjnn-0004fe-Qa for qemu-devel@nongnu.org; Tue, 13 Jan 2009 08:59:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:40945) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LMjnn-0000p1-7m for qemu-devel@nongnu.org; Tue, 13 Jan 2009 08:59:31 -0500 Message-ID: <496C9E40.3010505@suse.de> Date: Tue, 13 Jan 2009 14:59:28 +0100 From: Alexander Graf MIME-Version: 1.0 Subject: Re: [Qemu-devel] virtio breakage with 2.6.25 guest kernel References: <496C9813.7000609@suse.de> <1231854508.4290.186.camel@localhost.localdomain> In-Reply-To: <1231854508.4290.186.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: rusty@rustcorp.com.au, qemu-devel@nongnu.org Mark McLoughlin wrote: > Hi Alex, > > (Dropping kvm-devel@sf.net - it's kvm@vger.kernel.org now anyway) > Thunderbird keeps selecting that one and I'm sometimes too confused to see it's actually the wrong one. > On Tue, 2009-01-13 at 14:33 +0100, Alexander Graf wrote: > > >> while I don't fully understand the problem, here's what I experience so far: >> >> When using an openSUSE 11.0 kernel (2.6.25) in the guest, virtio on tap >> breaks with current KVM git, while it used to work before (haven't >> bisected, definitely worked in kvm-78, but is probably due to Anthony's >> rewrite). It shows the following message (comes from qemu): >> >> virtio-net header not in first element >> >> This is because qemu expects a message with mergeable rx bufs (12 >> bytes), but if I see things correctly the old kernel doesn't support >> that feature (sends 10 bytes). I put in some debug messages on IO >> reads/writes in the qemu virtio handler and got these: >> >> virtio IO read: 0 = 0x100bba3 >> virtio IO write: 0x4 = 0x100bba3 >> virtio: setting features 0x100bba3 >> >> So I believe the feature masking is somewhat non-functional? Or did I >> read the masking code in qemu's virtio-net wrong? >> >> Basically for me, current KVM git broke old guest support, which is a >> clear regression and should not happen. Does anybody with more expertise >> in virtio want to take on this? >> > > Yeah, I noticed this one last week. > > The issue here is that 2.6.25 virtio erroneously says it supports all > features supported by the host - i.e. it's a guest kernel bug. > > With recent qemu, that causes us to enable mergeable receive buffers and > the guest barfs. See: > > mask = ioread32(vp_dev->ioaddr + VIRTIO_PCI_HOST_FEATURES); > if (mask & (1 << bit)) { > mask |= (1 << bit); > iowrite32(mask, vp_dev->ioaddr + VIRTIO_PCI_GUEST_FEATURES); > > This got fixed in 2.6.26 by: > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c45a6816 > > I did consider forwarding this to stable@vger.kernel.org, but apparently > the 2.6.25.x series is finished now anyway. > Ok, that's good to know. I don't think anyone officially supported virtio in 2.6.25 days, but I'll check internally if we need to backport anything. Thanks a lot Alex