diff --git a/cpu-all.h b/cpu-all.h
index 52a1817..767ff18 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -765,9 +765,6 @@ CPUState *qemu_get_cpu(int cpu);
 void cpu_dump_state(CPUState *env, FILE *f,
                     int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
                     int flags);
-void cpu_dump_statistics (CPUState *env, FILE *f,
-                          int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
-                          int flags);

 void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
     __attribute__ ((__format__ (__printf__, 2, 3)));
diff --git a/monitor.c b/monitor.c
index eed1026..89ed723 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1012,16 +1012,6 @@ static void do_info_history(Monitor *mon)
     }
 }

-#if defined(TARGET_PPC)
-/* XXX: not implemented in other targets */
-static void do_info_cpu_stats(Monitor *mon)
-{
-    CPUState *env;
-
-    env = mon_get_cpu();
-    cpu_dump_statistics(env, (FILE *)mon, &monitor_fprintf, 0);
-}
-#endif

 /**
  * do_quit(): Quit QEMU execution
@@ -2731,15 +2721,6 @@ static const mon_cmd_t info_cmds[] = {
         .user_print = do_info_uuid_print,
         .mhandler.info_new = do_info_uuid,
     },
-#if defined(TARGET_PPC)
-    {
-        .name       = "cpustats",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show CPU statistics",
-        .mhandler.info = do_info_cpu_stats,
-    },
-#endif
 #if defined(CONFIG_SLIRP)
     {
         .name       = "usernet",
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 37c733f..5e38bd0 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -100,8 +100,6 @@ show the vnc server status
 show the current VM name
 @item info uuid
 show the current VM UUID
-@item info cpustats
-show CPU statistics
 @item info usernet
 show user network stack connection states
 @item info migrate
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 2ad4486..088d2cd 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -848,6 +848,8 @@ static inline void cpu_clone_regs(CPUState *env,
target_ulong newsp)
 }
 #endif

+void register_stats_handler(const char *name, CPUState *env1);
+
 #include "cpu-all.h"
 #include "exec-all.h"

diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index a5479c4..133ece9 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -2825,6 +2825,10 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model)
     env->cpu_model_str = cpu_model;
     cpu_ppc_register_internal(env, def);

+#if !defined(CONFIG_USER_ONLY)
+    register_stats_handler(cpu_model, env);
+#endif
+
     qemu_init_vcpu(env);

     return env;
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 86cca51..2d44e7d 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -28,6 +28,7 @@
 #include "tcg-op.h"
 #include "qemu-common.h"
 #include "host-utils.h"
+#include "monitor.h"

 #include "helper.h"
 #define GEN_HELPER 1
@@ -8896,11 +8897,11 @@ void cpu_dump_state (CPUState *env, FILE *f,
 #undef RFPL
 }

-void cpu_dump_statistics (CPUState *env, FILE*f,
-                          int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
-                          int flags)
+#if !defined(CONFIG_USER_ONLY)
+static void cpu_dump_statistics(Monitor *mon, void *opaque)
 {
 #if defined(DO_PPC_STATISTICS)
+    CPUState *env = opaque;
     opc_handler_t **t1, **t2, **t3, *handler;
     int op1, op2, op3;

@@ -8917,32 +8918,46 @@ void cpu_dump_statistics (CPUState *env, FILE*f,
                         handler = t3[op3];
                         if (handler->count == 0)
                             continue;
-                        cpu_fprintf(f, "%02x %02x %02x (%02x %04d) %16s: "
-                                    "%016llx %lld\n",
-                                    op1, op2, op3, op1, (op3 << 5) | op2,
-                                    handler->oname,
-                                    handler->count, handler->count);
+                        monitor_printf(mon, "%02x %02x %02x (%02x %04d) %16s: "
+                                       "%016" PRIx64 " %" PRId64 "\n",
+                                       op1, op2, op3, op1, (op3 << 5) | op2,
+                                       handler->oname,
+                                       handler->count, handler->count);
                     }
                 } else {
                     if (handler->count == 0)
                         continue;
-                    cpu_fprintf(f, "%02x %02x    (%02x %04d) %16s: "
-                                "%016llx %lld\n",
-                                op1, op2, op1, op2, handler->oname,
-                                handler->count, handler->count);
+                    monitor_printf(mon, "%02x %02x    (%02x %04d) %16s: "
+                                   "%016" PRIx64 " %" PRId64 "\n",
+                                   op1, op2, op1, op2, handler->oname,
+                                   handler->count, handler->count);
                 }
             }
         } else {
             if (handler->count == 0)
                 continue;
-            cpu_fprintf(f, "%02x       (%02x     ) %16s: %016llx %lld\n",
-                        op1, op1, handler->oname,
-                        handler->count, handler->count);
+            monitor_printf(mon, "%02x       (%02x     ) %16s: %016" PRIx64
+                           " %" PRId64 "\n",
+                           op1, op1, handler->oname,
+                           handler->count, handler->count);
         }
     }
+#else
+    monitor_printf(mon, "CPU statistics not compiled\n");
 #endif
 }

+static const struct MonDevInfo cpu_statistics_info = {
+    .dev_name = "cpu.stats",
+    .dev_info_cb = cpu_dump_statistics,
+};
+
+void register_stats_handler(const char *name, CPUState *env1)
+{
+    monitor_register_device_info(&cpu_statistics_info, env1);
+}
+#endif
+
 /*****************************************************************************/
 static inline void gen_intermediate_code_internal(CPUState *env,
                                                   TranslationBlock *tb,
