From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 1/4] always halt non-bsp cpu. Date: Wed, 3 Jun 2009 14:11:11 +0300 Message-ID: <20090603111111.GB11384@redhat.com> References: <1243971470-31676-1-git-send-email-glommer@redhat.com> <1243971470-31676-2-git-send-email-glommer@redhat.com> <4A258D23.9080106@web.de> <20090602212340.GX30777@poweredge.glommer> <4A25A11C.3090700@web.de> <20090602220937.GY30777@poweredge.glommer> <4A25A864.2070006@web.de> <20090603012345.GB30777@poweredge.glommer> <4A265809.3020908@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Glauber Costa , kvm@vger.kernel.org, avi@redhat.com To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39145 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333AbZFCLLN (ORCPT ); Wed, 3 Jun 2009 07:11:13 -0400 Content-Disposition: inline In-Reply-To: <4A265809.3020908@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 03, 2009 at 01:01:29PM +0200, Jan Kiszka wrote: > Glauber Costa wrote: > > On Wed, Jun 03, 2009 at 12:32:04AM +0200, Jan Kiszka wrote: > >> Glauber Costa wrote: > >>> On Wed, Jun 03, 2009 at 12:01:00AM +0200, Jan Kiszka wrote: > >>>> Glauber Costa wrote: > >>>>> On Tue, Jun 02, 2009 at 10:35:47PM +0200, Jan Kiszka wrote: > >>>>>> Glauber Costa wrote: > >>>>>>> This is not kvm specific, and should do fine in plain qemu > >>>>>> This is fine with plain qemu already. The problem, IIUC, is that > >>>>>> in-kernel kvm irqchip does not have a chance to remove the halted state > >>>>>> again. Did you test the effect of this patch on that scenario? What > >>>>>> makes it safe to be removed now? > >>>>> IIRC, the in kernel irqchip sets halted = 0 in the very beginning of > >>>>> the vcpu initialization. > >>>>> > >>>>> It is tested here with in-kernel irqchip and works, so probably not > >>>>> a problem, unless you can spot something. > >>>> At least your patch applied alone breaks -smp >1 here. > >>>> > >>>> But the whole management of env->halted for the in-kernel irqchip in > >>>> qemu-kvm is a bit hacky IMHO. Maybe it's time to rethink this. Would be > >>>> nice to always see a consistent halted in user space, specifically for > >>>> debugging purposes. > >>> out of curiosity: did you apply the whole series? > >> Meanwhile I did, but it makes no difference. > >> > > > > Can you try putting the following patch before this one? > > If it helps you to understand the issue, I will do so later. > > But I *really* suggest to take this chance and develop in-kernel irqchip > support that does not mess with halted, rather keeps it consistent (on > register sync) and maybe adds exceptions from "if (!env->halted)" tests > where required. IMHO, this is mandatory for an upstream merge! > The difference between kernel/userspace irq chip is that in former case halted cpu sleeps in the kernel and in later case in the usespace (well also in the kernel but not in kvm code). We currently abuse halted to do different sleeps. Cpu loop should be reworked. -- Gleb.