[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is
From: |
Mark Cave-Ayland |
Subject: |
Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running |
Date: |
Thu, 9 Feb 2017 13:11:26 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 |
On 07/02/17 15:46, Laurent Vivier wrote:
>> If you do this enough times (maybe 10 or so?) you'll see the progress
>> bars stop working correctly and get out of sync, i.e. it will freeze for
>> long periods of time and then "jump" to catch-up but not all the way.
>>
>> With my above patch applied to include the decrementer in the migration,
>> the bug was no longer visible in my tests.
>
> Thank you for all these details.
>
> I've been able to reproduce the problem, and I think the proposition you
> did in:
>
> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01114.html
>
> is the good one:
>
> diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> index df9f7a4..1dc95b8 100644
> --- a/target/ppc/machine.c
> +++ b/target/ppc/machine.c
> @@ -172,6 +172,7 @@ static void cpu_pre_save(void *opaque)
> env->spr[SPR_CFAR] = env->cfar;
> #endif
> env->spr[SPR_BOOKE_SPEFSCR] = env->spe_fscr;
> + env->spr[SPR_DECR] = cpu_ppc_load_decr(env);
>
> for (i = 0; (i < 4) && (i < env->nb_BATs); i++) {
> env->spr[SPR_DBAT0U + 2*i] = env->DBAT[0][i];
> @@ -214,6 +215,7 @@ static int cpu_post_load(void *opaque, int version_id)
> env->cfar = env->spr[SPR_CFAR];
> #endif
> env->spe_fscr = env->spr[SPR_BOOKE_SPEFSCR];
> + cpu_ppc_store_decr(env, env->spr[SPR_DECR]);
>
> for (i = 0; (i < 4) && (i < env->nb_BATs); i++) {
> env->DBAT[0][i] = env->spr[SPR_DBAT0U + 2*i];
>
>
> It's interesting because it doesn't break migration between different
> qemu releases as the register is already part of the migration stream.
> It was just not updated in the case of TCG (KVM is keeping it alive).
> And in case of KVM, calling cpu_ppc_load_decr()/cpu_ppc_store_decr()
> will not break anything as:
>
> - cpu_ppc_load_decr() returns "env->spr[SPR_DECR]",
> - cpu_ppc_store_decr() does nothing.
>
> Could you re-send this patch with your S-o-b, please?
Hi Laurent,
No problem, and thanks for the analysis. In fact, I have a couple of
other patches up on github which should fix up the remainder of the
issues and make g3beige migrateable (I would add the mac99 is currently
fairly close, however Ben has several WIP patches that change the mac99
model so I don't think it's worth making that machine officially
migrateable yet).
The one question I would ask is that if cpu_ppc_store_decr() does
nothing on KVM then would this causes issues attempting a migration
between TCG and KVM? In theory I believe I would still need to add
VMSTATE_PPC_TIMEBASE_V to the vmstate and encode the decrementer offset
relative to the timebase for this to work correctly as per the original
thread.
I'm just thinking if we are close to finalising the g3beige vmstate then
it would make sense to get it right so a KVM<>TCG migration can happen
if at all feasible.
ATB,
Mark.
- [Qemu-devel] [PULL 091/107] target-ppc: Add xvcv[hpsp, sphp] instructions, (continued)
- [Qemu-devel] [PULL 091/107] target-ppc: Add xvcv[hpsp, sphp] instructions, David Gibson, 2017/02/02
- [Qemu-devel] [PULL 083/107] target-ppc: Add xscvqps[d, w]z instructions, David Gibson, 2017/02/02
- [Qemu-devel] [PULL 105/107] target/ppc/mmu_hash64: Fix incorrect shift value in amr calculation, David Gibson, 2017/02/02
- [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, David Gibson, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Mark Cave-Ayland, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Laurent Vivier, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Mark Cave-Ayland, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Laurent Vivier, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Mark Cave-Ayland, 2017/02/02
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Laurent Vivier, 2017/02/07
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running,
Mark Cave-Ayland <=
- Re: [Qemu-devel] [PULL 095/107] spapr: clock should count only if vm is running, Laurent Vivier, 2017/02/09
[Qemu-devel] [PULL 107/107] hw/ppc/pnv: Use error_report instead of hw_error if a ROM file can't be found, David Gibson, 2017/02/02
[Qemu-devel] [PULL 103/107] tcg/POWER9: NOOP the cp_abort instruction, David Gibson, 2017/02/02
[Qemu-devel] [PULL 106/107] ppc/kvm: Handle the "family" CPU via alias instead of registering new types, David Gibson, 2017/02/02
[Qemu-devel] [PULL 092/107] powerpc/cpu-models: rename ISAv3.00 logical PVR definition, David Gibson, 2017/02/02
[Qemu-devel] [PULL 076/107] target-ppc: Add xsiexpqp instruction, David Gibson, 2017/02/02
[Qemu-devel] [PULL 104/107] target/ppc/mmu_hash64: Fix printing unsigned as signed int, David Gibson, 2017/02/02
Re: [Qemu-devel] [PULL 000/107] ppc-for-2.9 queue 20170202, no-reply, 2017/02/02