public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] Allow to call vm_stop from vcpu thread
Date: Thu, 15 Jan 2009 14:43:49 +0100	[thread overview]
Message-ID: <496F3D95.2040901@siemens.com> (raw)
In-Reply-To: <20090115132327.GB11299@redhat.com>

Gleb Natapov wrote:
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> 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

  reply	other threads:[~2009-01-15 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 13:23 [PATCH] Allow to call vm_stop from vcpu thread Gleb Natapov
2009-01-15 13:43 ` Jan Kiszka [this message]
2009-01-15 13:47   ` Gleb Natapov
2009-01-15 14:19     ` Jan Kiszka
2009-02-05 12:50 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496F3D95.2040901@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox