From: Nicholas Piggin <npiggin@gmail.com>
To: Fabiano Rosas <farosas@linux.ibm.com>, qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, danielhb413@gmail.com, qemu-ppc@nongnu.org,
clg@kaod.org, david@gibson.dropbear.id.au
Subject: Re: [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support
Date: Fri, 25 Feb 2022 10:51:31 +1000 [thread overview]
Message-ID: <1645749518.dllm9jbas4.astroid@bobo.none> (raw)
In-Reply-To: <20220224185817.2207228-5-farosas@linux.ibm.com>
Excerpts from Fabiano Rosas's message of February 25, 2022 4:58 am:
> This adds migration support for TCG pseries machines running a KVM-HV
> guest.
>
> The state that needs to be migrated is:
>
> - the nested PTCR value;
> - the in_nested flag;
> - the nested_tb_offset.
> - the saved host CPUPPCState structure;
>
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
The series generally looks good to me, I guess patches 1 and 2 are
fixes that could go ahead.
Main thing about this is I was thinking of cutting down the CPUPPCState
structure for saving the host state when in the L2, and making a
specific structure for that that only contains what is required.
This patch could easily switch to that so it's no big deal AFAIKS.
> diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> index 7ee1984500..ae09b1bcfe 100644
> --- a/target/ppc/machine.c
> +++ b/target/ppc/machine.c
> @@ -10,6 +10,7 @@
> #include "kvm_ppc.h"
> #include "power8-pmu.h"
> #include "hw/ppc/ppc.h"
> +#include "hw/ppc/spapr_cpu_core.h"
>
> static void post_load_update_msr(CPUPPCState *env)
> {
> @@ -679,6 +680,48 @@ static const VMStateDescription vmstate_tb_env = {
> }
> };
>
> +static const VMStateDescription vmstate_hdecr = {
> + .name = "cpu/hdecr",
> + .version_id = 1,
> + .minimum_version_id = 1,
> + .fields = (VMStateField[]) {
> + VMSTATE_UINT64(hdecr_next, ppc_tb_t),
> + VMSTATE_TIMER_PTR(hdecr_timer, ppc_tb_t),
> + VMSTATE_END_OF_LIST()
> + }
> +};
> +
> +static bool nested_needed(void *opaque)
> +{
> + PowerPCCPU *cpu = opaque;
> + SpaprCpuState *spapr_cpu = spapr_cpu_state(cpu);
> +
> + return spapr_cpu->in_nested;
> +}
I don't know the migration code -- are you assured of having a
spapr CPU here?
Maybe this could call a helper function located near the spapr/nested
code like 'return ppc_cpu_need_hdec_migrate(cpu)' ?
Thanks,
Nick
next prev parent reply other threads:[~2022-02-25 0:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 18:58 [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG) Fabiano Rosas
2022-02-24 18:58 ` [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr Fabiano Rosas
2022-02-24 20:06 ` Richard Henderson
2022-02-25 3:15 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-28 2:04 ` David Gibson
2022-02-24 18:58 ` [RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod Fabiano Rosas
2022-02-25 3:17 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-24 18:58 ` [RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase Fabiano Rosas
2022-02-25 3:21 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-28 2:06 ` David Gibson
2022-02-24 18:58 ` [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support Fabiano Rosas
2022-02-25 0:51 ` Nicholas Piggin [this message]
2022-02-25 3:42 ` David Gibson
2022-02-25 10:57 ` Nicholas Piggin
2022-02-24 21:00 ` [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG) Mark Cave-Ayland
2022-02-25 3:54 ` David Gibson
2022-02-25 16:11 ` Fabiano Rosas
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=1645749518.dllm9jbas4.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=farosas@linux.ibm.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.