From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-ppc <qemu-ppc@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] spapr: fix H_SET_MODE to sync LPCR with KVM
Date: Mon, 20 Jan 2014 15:41:41 +0100 [thread overview]
Message-ID: <6640E9DA-EA5C-44DB-9A9C-CF0276ED69E6@suse.de> (raw)
In-Reply-To: <1389939196-24323-1-git-send-email-aik@ozlabs.ru>
On 17.01.2014, at 07:13, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> The kvm_cpu_exec() only puts registers to KVM if the @kvm_vcpu_dirty flag
> has been set.
>
> This adds registers sync which also sets @kvm_vcpu_dirty so we store new
> LPCR to KVM before continuing with the KVM_RUN ioctl.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> hw/ppc/spapr_hcall.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index f755a53..b61d744 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -682,6 +682,7 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPREnvironment *spapr,
> CPU_FOREACH(cs) {
> PowerPCCPU *cp = POWERPC_CPU(cs);
> CPUPPCState *env = &cp->env;
> + kvm_cpu_synchronize_state(cs);
This should be cpu_synchronize_state(). But even then I'm not 100% sure we're not racy. What guarantees that the other vcpu doesn't go back into the guest before we fiddle with its LPCR?
We might have to put the LPCR fiddling and synchronization into a single function we call through run_on_cpu().
Alex
prev parent reply other threads:[~2014-01-20 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 6:13 [Qemu-devel] [PATCH] spapr: fix H_SET_MODE to sync LPCR with KVM Alexey Kardashevskiy
2014-01-20 14:41 ` Alexander Graf [this message]
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=6640E9DA-EA5C-44DB-9A9C-CF0276ED69E6@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).