From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] Allow to call vm_stop from vcpu thread Date: Thu, 15 Jan 2009 14:43:49 +0100 Message-ID: <496F3D95.2040901@siemens.com> References: <20090115132327.GB11299@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from lizzard.sbs.de ([194.138.37.39]:17995 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762132AbZAONo0 (ORCPT ); Thu, 15 Jan 2009 08:44:26 -0500 In-Reply-To: <20090115132327.GB11299@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: > Signed-off-by: Gleb Natapov > diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c > index e4fba78..484a232 100644 > --- a/qemu/qemu-kvm.c > +++ b/qemu/qemu-kvm.c > @@ -296,11 +296,15 @@ static void pause_all_threads(void) > { > CPUState *penv = first_cpu; > > - assert(!cpu_single_env); > - > while (penv) { > - penv->kvm_cpu_state.stop = 1; > - pthread_kill(penv->kvm_cpu_state.thread, SIG_IPI); > + if (penv != cpu_single_env) { > + penv->kvm_cpu_state.stop = 1; > + pthread_kill(penv->kvm_cpu_state.thread, SIG_IPI); > + } else { > + penv->kvm_cpu_state.stop = 0; > + penv->kvm_cpu_state.stopped = 1; > + cpu_interrupt(penv, CPU_INTERRUPT_EXIT); > + } > penv = (CPUState *)penv->next_cpu; > } Who do you have in mind to use this? At least the debugging infrastructure could do so, but I do not recall ATM if there were limitations that the above change may not overcome. Maybe you could test your patch by changing (probably simplifying) the path from a breakpoint hit to vm_stop. Thanks, Jan -- Siemens AG, Corporate Technology, CT SE 26 Corporate Competence Center Embedded Linux