qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06
@ 2014-08-07 13:34 Paolo Bonzini
  2014-08-07 13:34 ` [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit' Paolo Bonzini
  2014-08-08  9:42 ` [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Peter Maydell
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-08-07 13:34 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 41a1a9c42c4e0fb5f1b94aa8b72e42f66ebde3d9:

  po: Update German translation (2014-07-28 23:37:17 +0200)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to eddedd546a68f6ac864b71d50dd8d39b939b724b:

  target-mips: Ignore unassigned accesses with KVM (2014-08-07 15:09:48 +0200)

----------------------------------------------------------------
KVM changes include a MIPS patch and the testdev backend used by the
ARM kvm-unit-tests.  icount include the first part of reverse execution
and Sebastian Tanase's patches to slow down -icount execution to the
desired speed of the target.

v1->v2: fix dump_drift_info to print nothing outside icount mode,
        and to compile on 32-bit architectures

----------------------------------------------------------------
James Hogan (1):
      target-mips: Ignore unassigned accesses with KVM

KONRAD Frederic (3):
      icount: put icount variables into TimerState.
      migration: migrate icount fields.
      timer: add cpu_icount_to_ns function.

Paolo Bonzini (1):
      backends: Introduce chr-testdev

Sebastian Tanase (6):
      icount: Fix virtual clock start value on ARM
      icount: Add QemuOpts for icount
      icount: Add align option to icount
      cpu-exec: Add sleeping algorithm
      cpu-exec: Print to console if the guest is late
      monitor: Add drift info to 'info jit'

 backends/Makefile.objs  |   2 +-
 backends/testdev.c      | 131 ++++++++++++++++++++++++++++++++++++++++++++++++
 cpu-exec.c              | 116 ++++++++++++++++++++++++++++++++++++++++++
 cpus.c                  | 118 ++++++++++++++++++++++++++++++++++++-------
 include/qemu-common.h   |   8 ++-
 include/qemu/timer.h    |   2 +
 include/sysemu/char.h   |   3 ++
 monitor.c               |   1 +
 qapi-schema.json        |   3 +-
 qemu-char.c             |   4 ++
 qemu-options.hx         |  17 +++++--
 qtest.c                 |  13 ++++-
 stubs/Makefile.objs     |   1 +
 stubs/chr-testdev.c     |   7 +++
 target-mips/op_helper.c |  11 ++++
 vl.c                    |  39 +++++++++++---
 16 files changed, 444 insertions(+), 32 deletions(-)
 create mode 100644 backends/testdev.c
 create mode 100644 stubs/chr-testdev.c
-- 
1.8.3.1

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

* [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit'
  2014-08-07 13:34 [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Paolo Bonzini
@ 2014-08-07 13:34 ` Paolo Bonzini
  2014-08-08 15:37   ` Sebastian Tanase
  2014-08-08  9:42 ` [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Peter Maydell
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2014-08-07 13:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sebastian Tanase

From: Sebastian Tanase <sebastian.tanase@openwide.fr>

Show in 'info jit' the current delay between the host clock
and the guest clock. In addition, print the maximum advance
and delay of the guest compared to the host.

Signed-off-by: Sebastian Tanase <sebastian.tanase@openwide.fr>
Tested-by: Camille Bégué <camille.begue@openwide.fr>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 cpu-exec.c            |  6 ++++++
 cpus.c                | 19 +++++++++++++++++++
 include/qemu-common.h |  4 ++++
 monitor.c             |  1 +
 4 files changed, 30 insertions(+)

diff --git a/cpu-exec.c b/cpu-exec.c
index 3c14502..cbc8067 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -105,6 +105,12 @@ static void init_delay_params(SyncClocks *sc,
                    sc->realtime_clock +
                    cpu_get_clock_offset();
     sc->last_cpu_icount = cpu->icount_extra + cpu->icount_decr.u16.low;
+    if (sc->diff_clk < max_delay) {
+        max_delay = sc->diff_clk;
+    }
+    if (sc->diff_clk > max_advance) {
+        max_advance = sc->diff_clk;
+    }
 
     /* Print every 2s max if the guest is late. We limit the number
        of printed messages to NB_PRINT_MAX(currently 100) */
diff --git a/cpus.c b/cpus.c
index 19245e9..2b5c0bd 100644
--- a/cpus.c
+++ b/cpus.c
@@ -64,6 +64,8 @@
 #endif /* CONFIG_LINUX */
 
 static CPUState *next_cpu;
+int64_t max_delay;
+int64_t max_advance;
 
 bool cpu_is_stopped(CPUState *cpu)
 {
@@ -1552,3 +1554,20 @@ void qmp_inject_nmi(Error **errp)
     error_set(errp, QERR_UNSUPPORTED);
 #endif
 }
+
+void dump_drift_info(FILE *f, fprintf_function cpu_fprintf)
+{
+    if (!use_icount) {
+        return;
+    }
+
+    cpu_fprintf(f, "Host - Guest clock  %"PRIi64" ms\n",
+                (cpu_get_clock() - cpu_get_icount())/SCALE_MS);
+    if (icount_align_option) {
+        cpu_fprintf(f, "Max guest delay     %"PRIi64" ms\n", -max_delay/SCALE_MS);
+        cpu_fprintf(f, "Max guest advance   %"PRIi64" ms\n", max_advance/SCALE_MS);
+    } else {
+        cpu_fprintf(f, "Max guest delay     NA\n");
+        cpu_fprintf(f, "Max guest advance   NA\n");
+    }
+}
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 5d10ac2..bcf7a6a 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -109,6 +109,10 @@ static inline char *realpath(const char *path, char *resolved_path)
 void configure_icount(QemuOpts *opts, Error **errp);
 extern int use_icount;
 extern int icount_align_option;
+/* drift information for info jit command */
+extern int64_t max_delay;
+extern int64_t max_advance;
+void dump_drift_info(FILE *f, fprintf_function cpu_fprintf);
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
diff --git a/monitor.c b/monitor.c
index 5bc70a6..cdbaa60 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1047,6 +1047,7 @@ static void do_info_registers(Monitor *mon, const QDict *qdict)
 static void do_info_jit(Monitor *mon, const QDict *qdict)
 {
     dump_exec_info((FILE *)mon, monitor_fprintf);
+    dump_drift_info((FILE *)mon, monitor_fprintf);
 }
 
 static void do_info_history(Monitor *mon, const QDict *qdict)
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06
  2014-08-07 13:34 [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Paolo Bonzini
  2014-08-07 13:34 ` [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit' Paolo Bonzini
@ 2014-08-08  9:42 ` Peter Maydell
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-08-08  9:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 7 August 2014 14:34, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 41a1a9c42c4e0fb5f1b94aa8b72e42f66ebde3d9:
>
>   po: Update German translation (2014-07-28 23:37:17 +0200)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to eddedd546a68f6ac864b71d50dd8d39b939b724b:
>
>   target-mips: Ignore unassigned accesses with KVM (2014-08-07 15:09:48 +0200)
>
> ----------------------------------------------------------------
> KVM changes include a MIPS patch and the testdev backend used by the
> ARM kvm-unit-tests.  icount include the first part of reverse execution
> and Sebastian Tanase's patches to slow down -icount execution to the
> desired speed of the target.
>
> v1->v2: fix dump_drift_info to print nothing outside icount mode,
>         and to compile on 32-bit architectures
>
> ----------------------------------------------------------------
> James Hogan (1):
>       target-mips: Ignore unassigned accesses with KVM
>
> KONRAD Frederic (3):
>       icount: put icount variables into TimerState.
>       migration: migrate icount fields.
>       timer: add cpu_icount_to_ns function.
>
> Paolo Bonzini (1):
>       backends: Introduce chr-testdev
>
> Sebastian Tanase (6):
>       icount: Fix virtual clock start value on ARM
>       icount: Add QemuOpts for icount
>       icount: Add align option to icount
>       cpu-exec: Add sleeping algorithm
>       cpu-exec: Print to console if the guest is late
>       monitor: Add drift info to 'info jit'

Applied, thanks.

-- PMM

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

* Re: [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit'
  2014-08-07 13:34 ` [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit' Paolo Bonzini
@ 2014-08-08 15:37   ` Sebastian Tanase
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Tanase @ 2014-08-08 15:37 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel



----- Mail original -----
> De: "Paolo Bonzini" <pbonzini@redhat.com>
> À: qemu-devel@nongnu.org
> Cc: "Sebastian Tanase" <sebastian.tanase@openwide.fr>
> Envoyé: Jeudi 7 Août 2014 15:34:49
> Objet: [PULL v2 10/11] monitor: Add drift info to 'info jit'
> 
> From: Sebastian Tanase <sebastian.tanase@openwide.fr>
> 
> Show in 'info jit' the current delay between the host clock
> and the guest clock. In addition, print the maximum advance
> and delay of the guest compared to the host.
> 
> Signed-off-by: Sebastian Tanase <sebastian.tanase@openwide.fr>
> Tested-by: Camille Bégué <camille.begue@openwide.fr>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  cpu-exec.c            |  6 ++++++
>  cpus.c                | 19 +++++++++++++++++++
>  include/qemu-common.h |  4 ++++
>  monitor.c             |  1 +
>  4 files changed, 30 insertions(+)
> 
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 3c14502..cbc8067 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -105,6 +105,12 @@ static void init_delay_params(SyncClocks *sc,
>                     sc->realtime_clock +
>                     cpu_get_clock_offset();
>      sc->last_cpu_icount = cpu->icount_extra +
>      cpu->icount_decr.u16.low;
> +    if (sc->diff_clk < max_delay) {
> +        max_delay = sc->diff_clk;
> +    }
> +    if (sc->diff_clk > max_advance) {
> +        max_advance = sc->diff_clk;
> +    }
>  
>      /* Print every 2s max if the guest is late. We limit the number
>         of printed messages to NB_PRINT_MAX(currently 100) */
> diff --git a/cpus.c b/cpus.c
> index 19245e9..2b5c0bd 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -64,6 +64,8 @@
>  #endif /* CONFIG_LINUX */
>  
>  static CPUState *next_cpu;
> +int64_t max_delay;
> +int64_t max_advance;
>  
>  bool cpu_is_stopped(CPUState *cpu)
>  {
> @@ -1552,3 +1554,20 @@ void qmp_inject_nmi(Error **errp)
>      error_set(errp, QERR_UNSUPPORTED);
>  #endif
>  }
> +
> +void dump_drift_info(FILE *f, fprintf_function cpu_fprintf)
> +{
> +    if (!use_icount) {
> +        return;
> +    }
> +
> +    cpu_fprintf(f, "Host - Guest clock  %"PRIi64" ms\n",
> +                (cpu_get_clock() - cpu_get_icount())/SCALE_MS);
> +    if (icount_align_option) {
> +        cpu_fprintf(f, "Max guest delay     %"PRIi64" ms\n",
> -max_delay/SCALE_MS);
> +        cpu_fprintf(f, "Max guest advance   %"PRIi64" ms\n",
> max_advance/SCALE_MS);
> +    } else {
> +        cpu_fprintf(f, "Max guest delay     NA\n");
> +        cpu_fprintf(f, "Max guest advance   NA\n");
> +    }
> +}

Thank you very much for fixing this.
I must have missed it somehow.

Best regards,

Sebastian

> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index 5d10ac2..bcf7a6a 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -109,6 +109,10 @@ static inline char *realpath(const char *path,
> char *resolved_path)
>  void configure_icount(QemuOpts *opts, Error **errp);
>  extern int use_icount;
>  extern int icount_align_option;
> +/* drift information for info jit command */
> +extern int64_t max_delay;
> +extern int64_t max_advance;
> +void dump_drift_info(FILE *f, fprintf_function cpu_fprintf);
>  
>  #include "qemu/osdep.h"
>  #include "qemu/bswap.h"
> diff --git a/monitor.c b/monitor.c
> index 5bc70a6..cdbaa60 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1047,6 +1047,7 @@ static void do_info_registers(Monitor *mon,
> const QDict *qdict)
>  static void do_info_jit(Monitor *mon, const QDict *qdict)
>  {
>      dump_exec_info((FILE *)mon, monitor_fprintf);
> +    dump_drift_info((FILE *)mon, monitor_fprintf);
>  }
>  
>  static void do_info_history(Monitor *mon, const QDict *qdict)
> --
> 1.8.3.1
> 

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

end of thread, other threads:[~2014-08-08 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 13:34 [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Paolo Bonzini
2014-08-07 13:34 ` [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit' Paolo Bonzini
2014-08-08 15:37   ` Sebastian Tanase
2014-08-08  9:42 ` [Qemu-devel] [PULL v2 00/11] KVM, icount changes for 2014-08-06 Peter Maydell

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