From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzGAD-0001NV-6Q for qemu-devel@nongnu.org; Tue, 06 Apr 2010 17:18:25 -0400 Received: from [140.186.70.92] (port=53101 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzGAB-0001NN-Nb for qemu-devel@nongnu.org; Tue, 06 Apr 2010 17:18:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzGA9-00078J-UI for qemu-devel@nongnu.org; Tue, 06 Apr 2010 17:18:23 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:54356 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzGA9-00077G-La for qemu-devel@nongnu.org; Tue, 06 Apr 2010 17:18:21 -0400 Date: Wed, 7 Apr 2010 01:17:59 +0400 (MSD) From: malc In-Reply-To: <4BBB9685.9090801@redhat.com> Message-ID: References: <4BBB9685.9090801@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qemu-devel] Re: [PATCH] fix 100% cpu utilization when cpu is stopped (was Re: d6f4ade214a9f74dca9495b83a24ff9c113e4f9a) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Tue, 6 Apr 2010, Paolo Bonzini wrote: > On 04/05/2010 03:51 PM, malc wrote: > > Hello, > > > > d6f4ade214a9f74dca9495b83a24ff9c113e4f9a: disentangle tcg and deadline > > calculation > > introduces following regression(s): > > > > 100% cpu utilization when QEMU is invoked like: > > qemu -S -s ... > > > > ditto when gdb takes control over the session via gdb-stub > > (i.e. the breakpoint is hit or C-c is pressed inside gdb to > > interrupt the attached qemu instance) > > The bug is that env->stopped is not really as comprehensive as it seems to be > (and cpu_has_work thinks); it is only valid with iothread basically, and even > then it is cleared by reset and it is not set when starting qemu with -S. > > Signed-off-by: Paolo Bonzini > > diff --git a/cpus.c b/cpus.c > index a2e0642..0debe77 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -100,9 +100,7 @@ static int cpu_can_run(CPUState *env) > { > if (env->stop) > return 0; > - if (env->stopped) > - return 0; > - if (!vm_running) > + if (env->stopped || !vm_running) > return 0; > return 1; > } > @@ -111,7 +109,7 @@ static int cpu_has_work(CPUState *env) > { > if (env->stop) > return 1; > - if (env->stopped) > + if (env->stopped || !vm_running) > return 0; > if (!env->halted) > return 1; > This doesn't apply for whatever reason, i patched the thing by hand and things seem to work, thanks, care to resend? -- mailto:av1474@comtv.ru