From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Glauber Costa" Subject: Re: 2.6.27.5 guest boot failure using in-kernel PIT Date: Mon, 24 Nov 2008 12:33:48 -0200 Message-ID: <5d6222a80811240633q757e0769kf9064eebc23331@mail.gmail.com> References: <20081120142253.GA30825@blackpad> <20081120220517.GB30825@blackpad> <49266950.40200@web.de> <20081121171028.GA8361@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "Jan Kiszka" , "Eduardo Habkost" , kvm@vger.kernel.org To: "Marcelo Tosatti" Return-path: Received: from mail-qy0-f11.google.com ([209.85.221.11]:49850 "EHLO mail-qy0-f11.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751643AbYKXOdt (ORCPT ); Mon, 24 Nov 2008 09:33:49 -0500 Received: by qyk4 with SMTP id 4so1730420qyk.13 for ; Mon, 24 Nov 2008 06:33:48 -0800 (PST) In-Reply-To: <20081121171028.GA8361@dmt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Nov 21, 2008 at 3:10 PM, Marcelo Tosatti wrote: > Hi Jan, > > On Fri, Nov 21, 2008 at 08:54:56AM +0100, Jan Kiszka wrote: >> Eduardo Habkost wrote: >> > On Thu, Nov 20, 2008 at 12:22:53PM -0200, Eduardo Habkost wrote: >> >> Hi, >> >> >> >> When using a kvm.git kernel as host, I am getting guest boot failures >> >> when booting Fedora Rawhide kernel (2.6.27.5-117.fc10.x86_64). Guest >> >> stops booting at: >> >> >> >> ENABLING IO-APIC IRQs >> >> ..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1 >> >> ..MP-BIOS bug: 8254 timer not connected to IO-APIC >> >> ...trying to set up timer (IRQ0) through the 8259A ... >> >> ..... (found apic 0 pin 0) ... >> >> ....... failed. >> >> ...trying to set up timer as Virtual Wire IRQ... >> >> ..... failed. >> >> ...trying to set up timer as ExtINT IRQ... >> > >> > I've just found out this problem happens because the guest has HZ=1000 >> > and the host had HZ=250 and no CONFIG_HIGH_RES_TIMERS. >> > >> > With this setup, the host is not managing to inject enough timer >> > interrupts during the mdelay() loop on timer_irq_works(). >> > >> >> Interesting, and plausible. >> >> My observation so far is a sporadic test failure, often correlating with >> some raised host OS load. I'm running a high-res kernel, but that cannot >> prevent that this only 10 ticks long loop of the guest may obtain too >> few CPU cycles to handle enough of them once in a while (IIRC, it needs >> 4 out of the 10 ticks to declare the timer routing functional). > > Using in-kernel PIT? > > This is a potential problem which can be worked around by disabling the > whole thing either via no_timer_check or paravirt equivalent (Glauber?) > but for the non-paravirt case it seems its not the culprit. Possible > failure scenarios: For KVM_CLOCK case, I believe there's absolutely no reason to be more complicated than than that: +extern int no_timer_check; + void __init kvmclock_init(void) { if (!kvm_para_available()) @@ -178,6 +180,8 @@ void __init kvmclock_init(void) if (kvmclock && kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE)) { if (kvm_register_clock("boot clock")) return; + + no_timer_check = 1; pv_time_ops.get_wallclock = kvm_get_wallclock; pv_time_ops.set_wallclock = kvm_set_wallclock; pv_time_ops.sched_clock = kvm_clock_read;