From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: KVM git hangs with if=virtio (works under kvm 0.12.3) Date: Mon, 5 Jul 2010 13:36:08 +0100 Message-ID: References: <1278041518.10459.48.camel@geektop> <20100705121759.GP4689@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: ewheeler , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mail-vw0-f46.google.com ([209.85.212.46]:47140 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755861Ab0GEMgJ convert rfc822-to-8bit (ORCPT ); Mon, 5 Jul 2010 08:36:09 -0400 Received: by vws5 with SMTP id 5so5989909vws.19 for ; Mon, 05 Jul 2010 05:36:08 -0700 (PDT) In-Reply-To: <20100705121759.GP4689@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2010/7/5 Gleb Natapov : > On Mon, Jul 05, 2010 at 01:11:25PM +0100, Stefan Hajnoczi wrote: >> On Fri, Jul 2, 2010 at 9:07 AM, Stefan Hajnoczi = wrote: >> > On Fri, Jul 2, 2010 at 4:31 AM, ewheeler wro= te: >> >> Hello all, >> >> >> >> I'm booting a CentOS kernel under today's KVM git and it hangs af= ter >> >> initializing the serial port when the drive if=3Dvirtio, but not = when >> >> drive if=3Dide. =A0Look close---this is not a "forgot to add virt= io_blk" >> >> problem. =A0If I use 0.12.3 from Ubuntu 10.04 it works properly. >> >> >> >> Reproduction: >> >> >> >> Using kvm 0.12.3 on ubuntu 10.04 (1:84+dfsg-0ubuntu16+0.12.3+noro= ms >> >> +0ubuntu9) it will work properly: >> >> >> >> =A0qemu-system-x86_64 -drive file=3Ddummy-disk-image,if=3Dvirtio = \ >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-kernel vmlinuz-2.= 6.18-194.3.1.el5.centos.plus >> >> >> >> As expected, the kernel panics unable to mount root (good-boot.pn= g). >> >> This makes sense, as "dummy-disk-image" is 1MB of 0x00 bytes. >> >> >> >> ---However---if I use today's git (2010-07-01) of kvm: >> >> >> >> =A0 /usr/local/kvm-git/bin/qemu-system-x86_64 -drive file=3Ddummy= -disk-image,if=3Dvirtio \ >> >> =A0 =A0 =A0 =A0-kernel vmlinuz-2.6.18-194.3.1.el5.centos.plus >> >> >> >> This hangs just after initializing the Serial device (obtained by= adding >> >> -serial stdio -append console=3DttyS0): >> >> >> >> Note that this only happens with the disk interface set to virtio >> >> (if=3Dvirtio). =A0It works fine for ide (if=3Dide). >> >> >> >> >> >> Am I doing something wrong here? >> >> Is anyone else having this problem? >> > >> > I have seen this issue with a RHEL 5.5 guest running under >> > qemu-kvm.git. =A0It boots a new guest fine but hangs as you descri= bed >> > with the RHEL 5.5 kernel. =A0I have not investigated. >> >> This issue is affected by extboot, a feature that enables booting fr= om >> virtio-blk devices. =A0I have just sent a patch to the KVM mailing l= ist >> to restore extboot functionality which has been broken in >> qemu-kvm.git. =A0That patch can be used to work around this issue by >> using "-drive ...,boot=3Don" but it doesn't explain why the RHEL 5.5 >> kernel hangs during serial initialization when extboot is not presen= t. >> > Hang that happens during guest boot (after bootloader started the > kernel) cannot be worked around by extboot. extboot is also not neede= d > with latest qemu git to boot from virtio disks since the support for > that is in the bios now. I agree that something else is going on here and needs to be investigated, but I do think that extboot can indirectly affect the guest boot. With extboot the virtio-blk PCI adapter is not touched by the firmware/bootloader. Is it possible that a virtio-blk interrupt is raised and not acknowledged before entering Linux. When Linux brings up the serial port it gets swamped with interrupts? That's just a guess. Newer (non-RHEL 5.5) kernels boot fine without extboot, so another path to solving this bug is to bisect guest kernels. Stefan