All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-ppc@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	"Alexander Graf" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] spapr: reset @kvm_vcpu_dirty before starting CPU
Date: Thu, 16 Jan 2014 09:47:15 +1100	[thread overview]
Message-ID: <52D70FF3.80808@ozlabs.ru> (raw)
In-Reply-To: <1389761859-10150-1-git-send-email-aik@ozlabs.ru>

On 01/15/2014 03:57 PM, Alexey Kardashevskiy wrote:
> Normally QEMU kvm_arch_get_registers() reads registers and sets a dirty
> flag which prevents further registers reading from KVM till
> kvm_arch_put_registers() executes and resets the flag.
> 
> However if we run QEMU with "-S" ("suspended"), then execute "info cpus"
> from the QEMU monitor, we end up with not reading registers in
> rtas_start_cpu() as qmp_query_cpus() calls kvm_cpu_synchronize_state()
> which leaves @kvm_vcpu_dirty=true what prevents kvm_cpu_synchronize_state()
> from synchronizing registers and we loose the values.
> 
> This resets @kvm_vcpu_dirty flag as we do not have content which we really want to
> keep at this point as the CPU is halted.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---


Alex, ping. Is it complicated or controversial patch? ;)



> 
> We could also reset @kvm_vcpu_dirty in qmp_query_cpus() but that would be
> racy.
> ---
>  hw/ppc/spapr_rtas.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 1cb276d..3dade5e 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -185,6 +185,8 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPREnvironment *spapr,
>          /* This will make sure qemu state is up to date with kvm, and
>           * mark it dirty so our changes get flushed back before the
>           * new cpu enters */
> +
> +        cs->kvm_vcpu_dirty = false;
>          kvm_cpu_synchronize_state(cs);
>  
>          env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);
> 


-- 
Alexey

  reply	other threads:[~2014-01-15 22:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  4:57 [Qemu-devel] [PATCH] spapr: reset @kvm_vcpu_dirty before starting CPU Alexey Kardashevskiy
2014-01-15 22:47 ` Alexey Kardashevskiy [this message]
2014-01-20 14:45 ` Alexander Graf
2014-01-20 15:02   ` Alexey Kardashevskiy
2014-01-20 16:20 ` Andreas Färber

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=52D70FF3.80808@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.