qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-6.0] hw/ppc: Do not re-read the clock on pre_save if doing savevm
@ 2020-12-02 17:28 Greg Kurz
  2020-12-03  2:31 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kurz @ 2020-12-02 17:28 UTC (permalink / raw)
  To: David Gibson
  Cc: Kevin Wolf, qemu-ppc, qemu-devel, Dr. David Alan Gilbert,
	Laurent Vivier

A guest with enough RAM, eg. 128G, is likely to detect savevm downtime
and to complain about stalled CPUs. This happens because we re-read
the timebase just before migrating it and we thus don't account for
all the time between VM stop and pre-save.

A very similar situation was already addressed for live migration of
paused guests (commit d14f33976282). Extend the logic to do the same
with savevm.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1893787
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/ppc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 1b9827207676..5cbbff1f8d0c 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -1027,7 +1027,8 @@ static void timebase_save(PPCTimebase *tb)
      */
     tb->guest_timebase = ticks + first_ppc_cpu->env.tb_env->tb_offset;
 
-    tb->runstate_paused = runstate_check(RUN_STATE_PAUSED);
+    tb->runstate_paused =
+        runstate_check(RUN_STATE_PAUSED) || runstate_check(RUN_STATE_SAVE_VM);
 }
 
 static void timebase_load(PPCTimebase *tb)
@@ -1088,7 +1089,7 @@ static int timebase_pre_save(void *opaque)
 {
     PPCTimebase *tb = opaque;
 
-    /* guest_timebase won't be overridden in case of paused guest */
+    /* guest_timebase won't be overridden in case of paused guest or savevm */
     if (!tb->runstate_paused) {
         timebase_save(tb);
     }




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-6.0] hw/ppc: Do not re-read the clock on pre_save if doing savevm
  2020-12-02 17:28 [PATCH for-6.0] hw/ppc: Do not re-read the clock on pre_save if doing savevm Greg Kurz
@ 2020-12-03  2:31 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2020-12-03  2:31 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Kevin Wolf, qemu-ppc, qemu-devel, Dr. David Alan Gilbert,
	Laurent Vivier

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

On Wed, Dec 02, 2020 at 06:28:26PM +0100, Greg Kurz wrote:
> A guest with enough RAM, eg. 128G, is likely to detect savevm downtime
> and to complain about stalled CPUs. This happens because we re-read
> the timebase just before migrating it and we thus don't account for
> all the time between VM stop and pre-save.
> 
> A very similar situation was already addressed for live migration of
> paused guests (commit d14f33976282). Extend the logic to do the same
> with savevm.
> 
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1893787
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-6.0, thanks.

> ---
>  hw/ppc/ppc.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
> index 1b9827207676..5cbbff1f8d0c 100644
> --- a/hw/ppc/ppc.c
> +++ b/hw/ppc/ppc.c
> @@ -1027,7 +1027,8 @@ static void timebase_save(PPCTimebase *tb)
>       */
>      tb->guest_timebase = ticks + first_ppc_cpu->env.tb_env->tb_offset;
>  
> -    tb->runstate_paused = runstate_check(RUN_STATE_PAUSED);
> +    tb->runstate_paused =
> +        runstate_check(RUN_STATE_PAUSED) || runstate_check(RUN_STATE_SAVE_VM);
>  }
>  
>  static void timebase_load(PPCTimebase *tb)
> @@ -1088,7 +1089,7 @@ static int timebase_pre_save(void *opaque)
>  {
>      PPCTimebase *tb = opaque;
>  
> -    /* guest_timebase won't be overridden in case of paused guest */
> +    /* guest_timebase won't be overridden in case of paused guest or savevm */
>      if (!tb->runstate_paused) {
>          timebase_save(tb);
>      }
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-03  2:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-02 17:28 [PATCH for-6.0] hw/ppc: Do not re-read the clock on pre_save if doing savevm Greg Kurz
2020-12-03  2:31 ` David Gibson

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).