Clean up and simplify around fprintf_function
Subsystems (2)
v2 cover Clean up and simplify around fprintf_function
We pass around fprintf_function callbacks together a FILE * argument. Three cases:
* We pass fprintf() and stdout, stderr or qemu_log_file. Okay.
* We pass monitor_fprintf() together with the current monitor cast to FILE *. The type-punning is ugly.
* We pass monitor_printf() cast to fprintf_function together with the current monitor cast to FILE *. Even uglier.
All but two instances can be replaced by using qemu_printf() directly instead of printing through a callback.
One more can be replace by using new qemu_fprintf() directly.
The last one can use qemu_fprintf() to at least avoid the type-punning.
Based-on: <[email protected]>
v2:
* PATCH 08: Commit message pasto [Dave]
* PATCH 09: Commit message typo [Dave]
* PATCH 14: Drop spurious change to x86_cpu_dump_local_apic_state() [Dave]
Markus Armbruster (17):
include: Include fprintf-fn.h only where needed
trace: Simplify how st_print_trace_file_status() prints
tcg: Simplify how dump_opcount_info() prints
tcg: Simplify how dump_exec_info() prints
tcg: Simplify how dump_drift_info() prints
qsp: Simplify how qsp_report() prints
block/qapi: Clean up how we print to monitor or stdout
memory: Clean up how mtree_info() prints
target: Simplify how the TARGET_cpu_list() print
target: Clean up how the dump_mmu() print
target/i386: Simplify how x86_cpu_dump_local_apic_state() prints qom/cpu: Simplify how CPUClass::dump_statistics() prints
qemu-print: New qemu_fprintf(), qemu_vfprintf() qom/cpu: Simplify how CPUClass:cpu_dump_state() prints
monitor: Clean up how monitor_disas() funnels output to monitor
disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h
include: Move fprintf_function to disas/
accel/kvm/kvm-all.c | 4 +-
accel/tcg/translate-all.c | 49 ++--
block/qapi.c | 120 +++++-----
bsd-user/main.c | 4 +-
cpus.c | 21 +-
disas.c | 5 +-
disas/alpha.c | 2 +-
disas/arm-a64.cc | 2 +-
disas/arm.c | 2 +-
disas/cris.c | 2 +-
disas/hppa.c | 2 +-
disas/i386.c | 2 +-
disas/lm32.c | 2 +-
disas/m68k.c | 2 +-
disas/microblaze.c | 2 +-
disas/mips.c | 2 +-
disas/moxie.c | 2 +-
disas/nanomips.cpp | 2 +-
disas/nios2.c | 2 +-
disas/ppc.c | 2 +-
disas/riscv.c | 2 +-
disas/s390.c | 2 +-
disas/sh4.c | 2 +-
disas/sparc.c | 2 +-
disas/tci.c | 2 +-
disas/xtensa.c | 2 +-
exec.c | 42 ++--
hmp.c | 12 +-
include/block/qapi.h | 9 +-
include/disas/{bfd.h => dis-asm.h} | 5 +-
include/exec/cpu-all.h | 4 +-
include/exec/cpu-common.h | 13 --
include/exec/log.h | 2 +-
include/exec/memory-internal.h | 3 +-
include/exec/memory.h | 3 +-
include/monitor/monitor.h | 1 -
include/qemu-common.h | 2 -
include/qemu/cutils.h | 2 -
include/qemu/fprintf-fn.h | 14 --
include/qemu/qemu-print.h | 4 +
include/qemu/qsp.h | 6 +-
include/qom/cpu.h | 24 +-
include/sysemu/cpus.h | 4 +-
linux-user/alpha/cpu_loop.c | 2 +-
linux-user/cpu_loop-common.h | 2 +-
linux-user/cris/cpu_loop.c | 2 +-
linux-user/main.c | 2 +-
linux-user/microblaze/cpu_loop.c | 4 +-
linux-user/s390x/cpu_loop.c | 4 +-
linux-user/sh4/cpu_loop.c | 2 +-
linux-user/sparc/cpu_loop.c | 2 +-
memory.c | 156 ++++++-------
monitor.c | 30 +--
qemu-img.c | 6 +-
qemu-io-cmds.c | 2 +-
qom/cpu.c | 11 +-
target/alpha/cpu.c | 15 +-
target/alpha/cpu.h | 5 +-
target/alpha/helper.c | 24 +-
target/arm/arm-semi.c | 2 +-
target/arm/cpu.c | 1 -
target/arm/cpu.h | 5 +-
target/arm/helper.c | 15 +-
target/arm/translate-a64.c | 82 +++----
target/arm/translate.c | 58 ++---
target/arm/translate.h | 7 +-
target/cris/cpu.c | 14 +-
target/cris/cpu.h | 5 +-
target/cris/helper.c | 2 +-
target/cris/translate.c | 36 +--
target/hppa/cpu.c | 14 +-
target/hppa/cpu.h | 4 +-
target/hppa/helper.c | 24 +-
target/i386/cpu.c | 29 +--
target/i386/cpu.h | 8 +-
target/i386/hax-all.c | 4 +-
target/i386/helper.c | 356 ++++++++++++++---------------
target/i386/monitor.c | 3 +-
target/lm32/cpu.c | 14 +-
target/lm32/cpu.h | 5 +-
target/lm32/translate.c | 36 +--
target/m68k/cpu.h | 8 +-
target/m68k/helper.c | 129 +++++------
target/m68k/monitor.c | 2 +-
target/m68k/translate.c | 86 +++----
target/microblaze/cpu.h | 3 +-
target/microblaze/helper.c | 2 +-
target/microblaze/translate.c | 39 ++--
target/mips/cpu.h | 2 +-
target/mips/internal.h | 3 +-
target/mips/translate.c | 77 ++++---
target/mips/translate_init.inc.c | 5 +-
target/moxie/cpu.h | 3 +-
target/moxie/helper.c | 2 +-
target/moxie/translate.c | 22 +-
target/nios2/cpu.h | 5 +-
target/nios2/helper.c | 2 +-
target/nios2/mmu.c | 7 +-
target/nios2/monitor.c | 2 +-
target/nios2/translate.c | 24 +-
target/openrisc/cpu.c | 15 +-
target/openrisc/cpu.h | 5 +-
target/openrisc/disas.c | 2 +-
target/openrisc/translate.c | 11 +-
target/ppc/cpu.h | 10 +-
target/ppc/mmu-hash64.c | 7 +-
target/ppc/mmu-hash64.h | 2 +-
target/ppc/mmu_helper.c | 70 +++---
target/ppc/monitor.c | 2 +-
target/ppc/translate.c | 170 +++++++-------
target/ppc/translate_init.inc.c | 28 +--
target/riscv/cpu.c | 54 ++---
target/riscv/cpu.h | 2 +-
target/s390x/cpu.h | 2 +-
target/s390x/cpu_models.c | 21 +-
target/s390x/helper.c | 42 ++--
target/s390x/internal.h | 3 +-
target/sh4/cpu.c | 17 +-
target/sh4/cpu.h | 5 +-
target/sh4/translate.c | 27 +--
target/sparc/cpu.c | 133 ++++++-----
target/sparc/cpu.h | 7 +-
target/sparc/ldst_helper.c | 18 +-
target/sparc/mmu_helper.c | 97 ++++----
target/sparc/monitor.c | 2 +-
target/tilegx/cpu.c | 14 +-
target/tricore/cpu.h | 5 +-
target/tricore/helper.c | 15 +-
target/tricore/translate.c | 26 +--
target/unicore32/cpu.h | 3 +-
target/unicore32/translate.c | 39 ++--
target/xtensa/cpu.h | 7 +-
target/xtensa/helper.c | 7 +-
target/xtensa/mmu_helper.c | 24 +-
target/xtensa/monitor.c | 2 +-
target/xtensa/translate.c | 40 ++--
tcg/tcg.c | 50 ++--
tcg/tcg.h | 4 +-
trace/simple.c | 7 +-
trace/simple.h | 2 +-
util/qemu-print.c | 27 +++
util/qsp.c | 21 +-
vl.c | 2 +-
143 files changed, 1353 insertions(+), 1503 deletions(-)
rename include/disas/{bfd.h => dis-asm.h} (99%)
delete mode 100644 include/qemu/fprintf-fn.hSignature · 1 line
2.17.2
PATCH v2 1/17 include: Include fprintf-fn.h only where needed
--- include/qemu-common.h | 2 -- include/qemu/cutils.h | 2 -- include/sysemu/cpus.h | 1 + 3 files changed, 1 insertion(+), 4 deletions(-)
include/qemu-common.h +0 -2
@@ -12,8 +12,6 @@#ifndef QEMU_COMMON_H #define QEMU_COMMON_H -#include "qemu/fprintf-fn.h" -#define TFR (expr) do { if ((expr) != -1) break; } while (errno == EINTR)/* Copyright string for -version arguments, About dialogs, etc */
include/qemu/cutils.h +0 -2
@@ -1,8 +1,6 @@#ifndef QEMU_CUTILS_H #define QEMU_CUTILS_H -#include "qemu/fprintf-fn.h" -/** * pstrcpy: * @buf: buffer to copy string into
include/sysemu/cpus.h +1 -0
@@ -1,6 +1,7 @@#ifndef QEMU_CPUS_H #define QEMU_CPUS_H +#include "qemu/fprintf-fn.h" #include "qemu/timer.h" /* cpus.c */
Signature · 1 line
2.17.2
PATCH v2 2/17 trace: Simplify how st_print_trace_file_status() prints
In reply to Markus Armbrusterst_print_trace_file_status() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_trace_file() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- monitor.c | 2 +- trace/simple.c | 7 ++++--- trace/simple.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
monitor.c +1 -1
@@ -1056,7 +1056,7 @@ static void hmp_trace_file(Monitor *mon, const QDict *qdict)const char *arg =qdict_get_try_str (qdict,"arg" );if (!op) { -st_print_trace_file_status ((FILE *)mon, &monitor_fprintf); +st_print_trace_file_status (); }else if (!strcmp (op,"on" )) {st_set_trace_file_enabled (true); }else if (!strcmp (op,"off" )) {
trace/simple.c +4 -3
@@ -16,6 +16,7 @@#include "trace/control.h" #include "trace/simple.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" /** Trace file header event ID, picked to avoid conflict with real event IDs */ #define HEADER_EVENT_ID (~(uint64_t)0)
@@ -363,10 +364,10 @@ void st_set_trace_file(const char *file)st_set_trace_file_enabled (true); } -void st_print_trace_file_status (FILE *stream,int (*stream_printf)(FILE *stream,const char *fmt, ...)) +void st_print_trace_file_status (void ) { -stream_printf (stream,"Trace file \"%s\" %s.\n" , - trace_file_name, trace_fp ?"on" :"off" ); +qemu_printf ("Trace file \"%s\" %s.\n" , + trace_file_name, trace_fp ?"on" :"off" ); }void st_flush_trace_buffer (void )
trace/simple.h +1 -1
@@ -11,7 +11,7 @@#ifndef TRACE_SIMPLE_H #define TRACE_SIMPLE_H -void st_print_trace_file_status (FILE *stream,fprintf_function stream_printf); +void st_print_trace_file_status (void );void st_set_trace_file_enabled (bool enable);void st_set_trace_file (const char *file);bool st_init (void );
Signature · 1 line
2.17.2
PATCH v2 3/17 tcg: Simplify how dump_opcount_info() prints
In reply to Markus Armbrusterdump_opcount_info() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_info_opcount() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- accel/tcg/translate-all.c | 4 ++-- include/exec/cpu-all.h | 2 +- monitor.c | 2 +- tcg/tcg.c | 9 +++++---- tcg/tcg.h | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-)
accel/tcg/translate-all.c +2 -2
@@ -2333,9 +2333,9 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf) tcg_dump_info(f, cpu_fprintf); } -void dump_opcount_info (FILE *f,fprintf_function cpu_fprintf) +void dump_opcount_info (void ) { -tcg_dump_op_count (f, cpu_fprintf); +tcg_dump_op_count (); }#else /* CONFIG_USER_ONLY */
include/exec/cpu-all.h +1 -1
@@ -363,7 +363,7 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) }void dump_exec_info (FILE *f,fprintf_function cpu_fprintf); -void dump_opcount_info (FILE *f,fprintf_function cpu_fprintf); +void dump_opcount_info (void );#endif /* !CONFIG_USER_ONLY */ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
monitor.c +1 -1
@@ -1324,7 +1324,7 @@ static void hmp_info_jit(Monitor *mon, const QDict *qdict)static void hmp_info_opcount (Monitor *mon,const QDict *qdict) { -dump_opcount_info ((FILE *)mon, monitor_fprintf); +dump_opcount_info (); }#endif
tcg/tcg.c +5 -4
@@ -33,6 +33,7 @@#include "qemu/error-report.h" #include "qemu/cutils.h" #include "qemu/host-utils.h" +#include "qemu/qemu-print.h" #include "qemu/timer.h" /* Note: the long term plan is to reduce the dependencies on the QEMU
@@ -3768,14 +3769,14 @@ static void tcg_profile_snapshot_table(TCGProfile *prof)tcg_profile_snapshot (prof, false, true); } -void tcg_dump_op_count (FILE *f,fprintf_function cpu_fprintf) +void tcg_dump_op_count (void ) {TCGProfile prof = {};int i;tcg_profile_snapshot_table (&prof);for (i =0 ; i <NB_OPS ; i++) { -cpu_fprintf (f,"%s %" PRId64"\n" , tcg_op_defs[i].name, +qemu_printf ("%s %" PRId64"\n" , tcg_op_defs[i].name, prof.table_op_count[i]); } }
@@ -3795,9 +3796,9 @@ int64_t tcg_cpu_exec_time(void) return ret; }#else -void tcg_dump_op_count (FILE *f,fprintf_function cpu_fprintf) +void tcg_dump_op_count (void ) { -cpu_fprintf (f,"[TCG profiler not compiled]\n" ); +qemu_printf ("[TCG profiler not compiled]\n" ); }int64_t tcg_cpu_exec_time (void )
tcg/tcg.h +1 -1
@@ -1018,7 +1018,7 @@ int tcg_check_temp_count(void);int64_t tcg_cpu_exec_time (void );void tcg_dump_info (FILE *f,fprintf_function cpu_fprintf); -void tcg_dump_op_count (FILE *f,fprintf_function cpu_fprintf); +void tcg_dump_op_count (void );#define TCG_CT_ALIAS 0x80#define TCG_CT_IALIAS 0x40
Signature · 1 line
2.17.2
PATCH v2 4/17 tcg: Simplify how dump_exec_info() prints
In reply to Markus Armbrusterdump_exec_info() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_info_jit() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- accel/tcg/translate-all.c | 45 ++++++++++++++++++++------------------- include/exec/cpu-all.h | 2 +- monitor.c | 2 +- tcg/tcg.c | 41 ++++++++++++++++++----------------- tcg/tcg.h | 2 +- 5 files changed, 47 insertions(+), 45 deletions(-)
accel/tcg/translate-all.c +23 -22
@@ -50,6 +50,7 @@#include "translate-all.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qemu/timer.h" #include "qemu/main-loop.h" #include "exec/log.h"
@@ -2214,8 +2215,7 @@ void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)tb_jmp_cache_clear_page (cpu, addr); } -static void print_qht_statistics (FILE *f,fprintf_function cpu_fprintf, -struct qht_stats hst) +static void print_qht_statistics (struct qht_stats hst) {uint32_t hgram_opts;size_t hgram_bins;
@@ -2224,7 +2224,7 @@ static void print_qht_statistics(FILE *f, fprintf_function cpu_fprintf,if (!hst.head_buckets) {return ; } -cpu_fprintf (f,"TB hash buckets %zu/%zu (%0.2f%% head buckets used)\n" , +qemu_printf ("TB hash buckets %zu/%zu (%0.2f%% head buckets used)\n" , hst.used_head_buckets, hst.head_buckets, (double )hst.used_head_buckets / hst.head_buckets *100 );
@@ -2234,7 +2234,7 @@ static void print_qht_statistics(FILE *f, fprintf_function cpu_fprintf, hgram_opts |=QDIST_PR_NODECIMAL ; } hgram =qdist_pr (&hst.occupancy,10 , hgram_opts); -cpu_fprintf (f,"TB hash occupancy %0.2f%% avg chain occ. Histogram: %s\n" , +qemu_printf ("TB hash occupancy %0.2f%% avg chain occ. Histogram: %s\n" ,qdist_avg (&hst.occupancy) *100 , hgram);g_free (hgram);
@@ -2247,7 +2247,7 @@ static void print_qht_statistics(FILE *f, fprintf_function cpu_fprintf, hgram_opts |=QDIST_PR_NODECIMAL |QDIST_PR_NOBINRANGE ; } hgram =qdist_pr (&hst.chain, hgram_bins, hgram_opts); -cpu_fprintf (f,"TB hash avg chain %0.3f buckets. Histogram: %s\n" , +qemu_printf ("TB hash avg chain %0.3f buckets. Histogram: %s\n" ,qdist_avg (&hst.chain), hgram);g_free (hgram); }
@@ -2285,7 +2285,7 @@ static gboolean tb_tree_stats_iter(gpointer key, gpointer value, gpointer data)return false; } -void dump_exec_info (FILE *f,fprintf_function cpu_fprintf) +void dump_exec_info (void ) {struct tb_tree_stats tst = {};struct qht_stats hst;
@@ -2294,43 +2294,44 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)tcg_tb_foreach (tb_tree_stats_iter, &tst); nb_tbs = tst.nb_tbs;/* XXX: avoid using doubles ? */ -cpu_fprintf (f,"Translation buffer state:\n" ); +qemu_printf ("Translation buffer state:\n" );/* * Report total code size including the padding and TB structs; * otherwise users might think "-tb-size" is not honoured. * For avg host size we use the precise numbers from tb_tree_stats though. */ -cpu_fprintf (f,"gen code size %zu/%zu\n" , +qemu_printf ("gen code size %zu/%zu\n" ,tcg_code_size (),tcg_code_capacity ()); -cpu_fprintf (f,"TB count %zu\n" , nb_tbs); -cpu_fprintf (f,"TB avg target size %zu max=%zu bytes\n" , +qemu_printf ("TB count %zu\n" , nb_tbs); +qemu_printf ("TB avg target size %zu max=%zu bytes\n" , nb_tbs ? tst.target_size / nb_tbs :0 , tst.max_target_size); -cpu_fprintf (f,"TB avg host size %zu bytes (expansion ratio: %0.1f)\n" , +qemu_printf ("TB avg host size %zu bytes (expansion ratio: %0.1f)\n" , nb_tbs ? tst.host_size / nb_tbs :0 , tst.target_size ? (double )tst.host_size / tst.target_size :0 ); -cpu_fprintf (f,"cross page TB count %zu (%zu%%)\n" , tst.cross_page, - nb_tbs ? (tst.cross_page *100 ) / nb_tbs :0 ); -cpu_fprintf (f,"direct jump count %zu (%zu%%) (2 jumps=%zu %zu%%)\n" , +qemu_printf ("cross page TB count %zu (%zu%%)\n" , tst.cross_page, + nb_tbs ? (tst.cross_page *100 ) / nb_tbs :0 ); +qemu_printf ("direct jump count %zu (%zu%%) (2 jumps=%zu %zu%%)\n" , tst.direct_jmp_count, nb_tbs ? (tst.direct_jmp_count *100 ) / nb_tbs :0 , tst.direct_jmp2_count, nb_tbs ? (tst.direct_jmp2_count *100 ) / nb_tbs :0 );qht_statistics_init (&tb_ctx.htable, &hst); -print_qht_statistics (f, cpu_fprintf, hst); +print_qht_statistics (hst);qht_statistics_destroy (&hst); -cpu_fprintf (f,"\nStatistics:\n" ); -cpu_fprintf (f,"TB flush count %u\n" , +qemu_printf ("\nStatistics:\n" ); +qemu_printf ("TB flush count %u\n" ,atomic_read (&tb_ctx.tb_flush_count)); -cpu_fprintf (f,"TB invalidate count %zu\n" ,tcg_tb_phys_invalidate_count ()); +qemu_printf ("TB invalidate count %zu\n" , +tcg_tb_phys_invalidate_count ());tlb_flush_counts (&flush_full, &flush_part, &flush_elide); -cpu_fprintf (f,"TLB full flushes %zu\n" , flush_full); -cpu_fprintf (f,"TLB partial flushes %zu\n" , flush_part); -cpu_fprintf (f,"TLB elided flushes %zu\n" , flush_elide); -tcg_dump_info (f, cpu_fprintf); +qemu_printf ("TLB full flushes %zu\n" , flush_full); +qemu_printf ("TLB partial flushes %zu\n" , flush_part); +qemu_printf ("TLB elided flushes %zu\n" , flush_elide); +tcg_dump_info (); }void dump_opcount_info (void )
include/exec/cpu-all.h +1 -1
@@ -362,7 +362,7 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) return tlb_hit_page(tlb_addr, addr & TARGET_PAGE_MASK); } -void dump_exec_info (FILE *f,fprintf_function cpu_fprintf); +void dump_exec_info (void );void dump_opcount_info (void );#endif /* !CONFIG_USER_ONLY */
monitor.c +1 -1
@@ -1318,7 +1318,7 @@ static void hmp_info_jit(Monitor *mon, const QDict *qdict)return ; } -dump_exec_info ((FILE *)mon, monitor_fprintf); +dump_exec_info ();dump_drift_info ((FILE *)mon, monitor_fprintf); }
tcg/tcg.c +21 -20
80 lines not on this page · raw message
tcg/tcg.h +1 -1
@@ -1017,7 +1017,7 @@ int tcg_check_temp_count(void);#endif int64_t tcg_cpu_exec_time (void ); -void tcg_dump_info (FILE *f,fprintf_function cpu_fprintf); +void tcg_dump_info (void );void tcg_dump_op_count (void );#define TCG_CT_ALIAS 0x80
Signature · 1 line
2.17.2
PATCH v2 5/17 tcg: Simplify how dump_drift_info() prints
In reply to Markus Armbrusterdump_drift_info() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_info_jit() passes monitor_fprintf() and a Monitor
* cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- cpus.c | 15 +++++++++------ include/sysemu/cpus.h | 2 +- monitor.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-)
cpus.c +9 -6
@@ -31,6 +31,7 @@#include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "sysemu/sysemu.h" #include "sysemu/block-backend.h" #include "exec/gdbstub.h"
@@ -2454,19 +2455,21 @@ void qmp_inject_nmi(Error **errp)nmi_monitor_handle (monitor_get_cpu_index (), errp); } -void dump_drift_info (FILE *f,fprintf_function cpu_fprintf) +void dump_drift_info (void ) {if (!use_icount) {return ; } -cpu_fprintf (f,"Host - Guest clock %" PRIi64" ms\n" , +qemu_printf ("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 ); +qemu_printf ("Max guest delay %" PRIi64" ms\n" , + -max_delay /SCALE_MS ); +qemu_printf ("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" ); +qemu_printf ("Max guest delay NA\n" ); +qemu_printf ("Max guest advance NA\n" ); } }
include/sysemu/cpus.h +1 -1
@@ -19,7 +19,7 @@ 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); +void dump_drift_info (void );/* Unblock cpu */ void qemu_cpu_kick_self (void );
monitor.c +1 -1
@@ -1319,7 +1319,7 @@ static void hmp_info_jit(Monitor *mon, const QDict *qdict) }dump_exec_info (); -dump_drift_info ((FILE *)mon, monitor_fprintf); +dump_drift_info (); }static void hmp_info_opcount (Monitor *mon,const QDict *qdict)
Signature · 1 line
2.17.2
PATCH v2 6/17 qsp: Simplify how qsp_report() prints
In reply to Markus Armbrusterqsp_report() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_sync_profile() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- include/block/qapi.h | 1 + include/qemu/qsp.h | 6 ++---- monitor.c | 2 +- util/qsp.c | 21 +++++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-)
include/block/qapi.h +1 -0
@@ -27,6 +27,7 @@#include "block/block.h" #include "block/snapshot.h" +#include "qemu/fprintf-fn.h" BlockDeviceInfo *bdrv_block_device_info (BlockBackend *blk,BlockDriverState *bs,Error **errp);
include/qemu/qsp.h +2 -4
@@ -11,15 +11,13 @@#ifndef QEMU_QSP_H #define QEMU_QSP_H -#include "qemu/fprintf-fn.h" -enum QSPSortBy {QSP_SORT_BY_TOTAL_WAIT_TIME ,QSP_SORT_BY_AVG_WAIT_TIME , }; -void qsp_report (FILE *f,fprintf_function cpu_fprintf,size_t max, -enum QSPSortBy sort_by,bool callsite_coalesce); +void qsp_report (size_t max,enum QSPSortBy sort_by, +bool callsite_coalesce);bool qsp_is_enabled (void );void qsp_enable (void );
monitor.c +1 -1
@@ -1336,7 +1336,7 @@ static void hmp_info_sync_profile(Monitor *mon, const QDict *qdict)enum QSPSortBy sort_by; sort_by = mean ?QSP_SORT_BY_AVG_WAIT_TIME :QSP_SORT_BY_TOTAL_WAIT_TIME ; -qsp_report ((FILE *)mon, monitor_fprintf, max, sort_by, coalesce); +qsp_report (max, sort_by, coalesce); }static void hmp_info_history (Monitor *mon,const QDict *qdict)
util/qsp.c +11 -10
@@ -56,7 +56,9 @@* Critical-Section Execution to Improve the Performance of Multithreaded * Applications", USENIX ATC'12. */ +#include "qemu/osdep.h" +#include "qemu/qemu-print.h" #include "qemu/thread.h" #include "qemu/timer.h" #include "qemu/qht.h"
@@ -678,8 +680,7 @@ static gboolean qsp_tree_report(gpointer key, gpointer value, gpointer udata)return FALSE; } -static void -pr_report (const QSPReport *rep,FILE *f,fprintf_function pr) +static void pr_report (const QSPReport *rep) {char *dashes;size_t max_len =0 ;
@@ -702,15 +703,15 @@ pr_report(const QSPReport *rep, FILE *f, fprintf_function pr)/* white space to leave to the right of "Call site" */ callsite_rspace = callsite_len -strlen ("Call site" ); -pr (f,"Type Object Call site%*s Wait Time (s) " -" Count Average (us)\n" , callsite_rspace,"" ); +qemu_printf ("Type Object Call site%*s Wait Time (s) " +" Count Average (us)\n" , callsite_rspace,"" );/* build a horizontal rule with dashes */ n_dashes =79 + callsite_rspace; dashes =g_malloc (n_dashes +1 );memset (dashes,'-' , n_dashes); dashes[n_dashes] ='\0' ; -pr (f,"%s\n" , dashes); +qemu_printf ("%s\n" , dashes);for (i =0 ; i < rep->n_entries; i++) {const QSPReportEntry *e = &rep->entries[i];
@@ -726,11 +727,11 @@ pr_report(const QSPReport *rep, FILE *f, fprintf_function pr) e->callsite_at, callsite_len - (int )strlen (e->callsite_at),"" , e->time_s, e->n_acqs, e->ns_avg * 1e-3); -pr (f,"%s" , s->str); +qemu_printf ("%s" , s->str);g_string_free (s, TRUE); } -pr (f,"%s\n" , dashes); +qemu_printf ("%s\n" , dashes);g_free (dashes); }
@@ -746,8 +747,8 @@ static void report_destroy(QSPReport *rep)g_free (rep->entries); } -void qsp_report (FILE *f,fprintf_function cpu_fprintf,size_t max, -enum QSPSortBy sort_by,bool callsite_coalesce) +void qsp_report (size_t max,enum QSPSortBy sort_by, +bool callsite_coalesce) {GTree *tree =g_tree_new_full (qsp_tree_cmp, &sort_by, g_free,NULL );QSPReport rep;
@@ -762,7 +763,7 @@ void qsp_report(FILE *f, fprintf_function cpu_fprintf, size_t max,g_tree_foreach (tree, qsp_tree_report, &rep);g_tree_destroy (tree); -pr_report (&rep, f, cpu_fprintf); +pr_report (&rep);report_destroy (&rep); }
Signature · 1 line
2.17.2
PATCH v2 7/17 block/qapi: Clean up how we print to monitor or stdout
In reply to Markus Armbrusterbdrv_snapshot_dump(), bdrv_image_info_specific_dump(), bdrv_image_info_dump() and their helpers take an fprintf()-like callback and a FILE * to pass to it.
hmp.c passes monitor_printf() cast to fprintf_function and the current monitor cast to FILE *.
qemu-img.c and qemu-io-cmds.c pass fprintf and stdout.
The type-punning is technically undefined behaviour, but works in practice. Clean up: drop the callback, and call qemu_printf() instead.
--- block/qapi.c | 120 ++++++++++++++++++++----------------------- hmp.c | 12 ++--- include/block/qapi.h | 10 ++-- qemu-img.c | 6 +-- qemu-io-cmds.c | 2 +- 5 files changed, 67 insertions(+), 83 deletions(-)
block/qapi.c +55 -65
@@ -36,6 +36,7 @@#include "qapi/qmp/qlist.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" +#include "qemu/qemu-print.h" #include "sysemu/block-backend.h" #include "qemu/cutils.h"
@@ -660,8 +661,7 @@ static char *get_human_readable_size(char *buf, int buf_size, int64_t size)return buf; } -void bdrv_snapshot_dump (fprintf_function func_fprintf,void *f, -QEMUSnapshotInfo *sn) +void bdrv_snapshot_dump (QEMUSnapshotInfo *sn) {char buf1[128 ], date_buf[128 ], clock_buf[128 ];struct tm tm;
@@ -669,9 +669,8 @@ void bdrv_snapshot_dump(fprintf_function func_fprintf, void *f,int64_t secs;if (!sn) { -func_fprintf (f, -"%-10s%-20s%7s%20s%15s" , -"ID" ,"TAG" ,"VM SIZE" ,"DATE" ,"VM CLOCK" ); +qemu_printf ("%-10s%-20s%7s%20s%15s" , +"ID" ,"TAG" ,"VM SIZE" ,"DATE" ,"VM CLOCK" ); }else { ti = sn->date_sec;localtime_r (&ti, &tm);
@@ -684,50 +683,46 @@ void bdrv_snapshot_dump(fprintf_function func_fprintf, void *f, (int )((secs /60 ) %60 ), (int )(secs %60 ), (int)((sn->vm_clock_nsec / 1000000) % 1000)); -func_fprintf (f, -"%-10s%-20s%7s%20s%15s" , - sn->id_str, sn->name, -get_human_readable_size (buf1,sizeof (buf1), - sn->vm_state_size), - date_buf, - clock_buf); +qemu_printf ("%-10s%-20s%7s%20s%15s" , + sn->id_str, sn->name, +get_human_readable_size (buf1,sizeof (buf1), + sn->vm_state_size), + date_buf, + clock_buf); } } -static void dump_qdict (fprintf_function func_fprintf,void *f,int indentation, -QDict *dict); -static void dump_qlist (fprintf_function func_fprintf,void *f,int indentation, -QList *list); +static void dump_qdict (int indentation,QDict *dict); +static void dump_qlist (int indentation,QList *list); -static void dump_qobject (fprintf_function func_fprintf,void *f, -int comp_indent,QObject *obj) +static void dump_qobject (int comp_indent,QObject *obj) {switch (qobject_type (obj)) {case QTYPE_QNUM : {QNum *value =qobject_to (QNum, obj);char *tmp =qnum_to_string (value); -func_fprintf (f,"%s" , tmp); +qemu_printf ("%s" , tmp);g_free (tmp);break ; }case QTYPE_QSTRING : {QString *value =qobject_to (QString, obj); -func_fprintf (f,"%s" ,qstring_get_str (value)); +qemu_printf ("%s" ,qstring_get_str (value));break ; }case QTYPE_QDICT : {QDict *value =qobject_to (QDict, obj); -dump_qdict (func_fprintf, f, comp_indent, value); +dump_qdict (comp_indent, value);break ; }case QTYPE_QLIST : {QList *value =qobject_to (QList, obj); -dump_qlist (func_fprintf, f, comp_indent, value); +dump_qlist (comp_indent, value);break ; }case QTYPE_QBOOL : {QBool *value =qobject_to (QBool, obj); -func_fprintf (f,"%s" ,qbool_get_bool (value) ?"true" :"false" ); +qemu_printf ("%s" ,qbool_get_bool (value) ?"true" :"false" );break ; }default :
@@ -735,8 +730,7 @@ static void dump_qobject(fprintf_function func_fprintf, void *f, } } -static void dump_qlist (fprintf_function func_fprintf,void *f,int indentation, -QList *list) +static void dump_qlist (int indentation,QList *list) {const QListEntry *entry;int i =0 ;
@@ -744,17 +738,16 @@ static void dump_qlist(fprintf_function func_fprintf, void *f, int indentation,for (entry =qlist_first (list); entry; entry =qlist_next (entry), i++) {QType type =qobject_type (entry->value);bool composite = (type ==QTYPE_QDICT || type ==QTYPE_QLIST ); -func_fprintf (f,"%*s[%i]:%c" , indentation *4 ,"" , i, - composite ?'\n' :' ' ); -dump_qobject (func_fprintf, f, indentation +1 , entry->value); +qemu_printf ("%*s[%i]:%c" , indentation *4 ,"" , i, + composite ?'\n' :' ' ); +dump_qobject (indentation +1 , entry->value);if (!composite) { -func_fprintf (f,"\n" ); +qemu_printf ("\n" ); } } } -static void dump_qdict (fprintf_function func_fprintf,void *f,int indentation, -QDict *dict) +static void dump_qdict (int indentation,QDict *dict) {const QDictEntry *entry;
@@ -769,18 +762,17 @@ static void dump_qdict(fprintf_function func_fprintf, void *f, int indentation, key[i] = entry->key[i] =='-' ?' ' : entry->key[i]; } key[i] =0 ; -func_fprintf (f,"%*s%s:%c" , indentation *4 ,"" , key, - composite ?'\n' :' ' ); -dump_qobject (func_fprintf, f, indentation +1 , entry->value); +qemu_printf ("%*s%s:%c" , indentation *4 ,"" , key, + composite ?'\n' :' ' ); +dump_qobject (indentation +1 , entry->value);if (!composite) { -func_fprintf (f,"\n" ); +qemu_printf ("\n" ); }g_free (key); } } -void bdrv_image_info_specific_dump (fprintf_function func_fprintf,void *f, -ImageInfoSpecific *info_spec) +void bdrv_image_info_specific_dump (ImageInfoSpecific *info_spec) {QObject *obj, *data;Visitor *v =qobject_output_visitor_new (&obj);
@@ -788,13 +780,12 @@ void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,visit_type_ImageInfoSpecific (v,NULL , &info_spec, &error_abort);visit_complete (v, &obj); data =qdict_get (qobject_to (QDict, obj),"data" ); -dump_qobject (func_fprintf, f,1 , data); +dump_qobject (1 , data);qobject_unref (obj);visit_free (v); } -void bdrv_image_info_dump (fprintf_function func_fprintf,void *f, -ImageInfo *info) +void bdrv_image_info_dump (ImageInfo *info) {char size_buf[128 ], dsize_buf[128 ];if (!info->has_actual_size) {
@@ -804,49 +795,48 @@ void bdrv_image_info_dump(fprintf_function func_fprintf, void *f, info->actual_size); }get_human_readable_size (size_buf,sizeof (size_buf), info->virtual_size); -func_fprintf (f, -"image: %s\n" -"file format: %s\n" -"virtual size: %s (%" PRId64" bytes)\n" -"disk size: %s\n" , - info->filename, info->format, size_buf, - info->virtual_size, - dsize_buf); +qemu_printf ("image: %s\n" +"file format: %s\n" +"virtual size: %s (%" PRId64" bytes)\n" +"disk size: %s\n" , + info->filename, info->format, size_buf, + info->virtual_size, + dsize_buf);if (info->has_encrypted && info->encrypted) { -func_fprintf (f,"encrypted: yes\n" ); +qemu_printf ("encrypted: yes\n" ); }if (info->has_cluster_size) { -func_fprintf (f,"cluster_size: %" PRId64"\n" , - info->cluster_size); +qemu_printf ("cluster_size: %" PRId64"\n" , + info->cluster_size); }if (info->has_dirty_flag && info->dirty_flag) { -func_fprintf (f,"cleanly shut down: no\n" ); +qemu_printf ("cleanly shut down: no\n" ); }if (info->has_backing_filename) { -func_fprintf (f,"backing file: %s" , info->backing_filename); +qemu_printf ("backing file: %s" , info->backing_filename);if (!info->has_full_backing_filename) { -func_fprintf (f," (cannot determine actual path)" ); +qemu_printf (" (cannot determine actual path)" ); }else if (strcmp (info->backing_filename, info->full_backing_filename) !=0 ) { -func_fprintf (f," (actual path: %s)" , info->full_backing_filename); +qemu_printf (" (actual path: %s)" , info->full_backing_filename); } -func_fprintf (f,"\n" ); +qemu_printf ("\n" );if (info->has_backing_filename_format) { -func_fprintf (f,"backing file format: %s\n" , - info->backing_filename_format); +qemu_printf ("backing file format: %s\n" , + info->backing_filename_format); } }if (info->has_snapshots) {SnapshotInfoList *elem; -func_fprintf (f,"Snapshot list:\n" ); -bdrv_snapshot_dump (func_fprintf, f,NULL ); -func_fprintf (f,"\n" ); +qemu_printf ("Snapshot list:\n" ); +bdrv_snapshot_dump (NULL ); +qemu_printf ("\n" );/* Ideally bdrv_snapshot_dump() would operate on SnapshotInfoList but * we convert to the block layer's native QEMUSnapshotInfo for now.
@@ -862,13 +852,13 @@ void bdrv_image_info_dump(fprintf_function func_fprintf, void *f,pstrcpy (sn.id_str,sizeof (sn.id_str), elem->value->id);pstrcpy (sn.name,sizeof (sn.name), elem->value->name); -bdrv_snapshot_dump (func_fprintf, f, &sn); -func_fprintf (f,"\n" ); +bdrv_snapshot_dump (&sn); +qemu_printf ("\n" ); } }if (info->has_format_specific) { -func_fprintf (f,"Format specific information:\n" ); -bdrv_image_info_specific_dump (func_fprintf, f, info->format_specific); +qemu_printf ("Format specific information:\n" ); +bdrv_image_info_specific_dump (info->format_specific); } }
hmp.c +5 -7
@@ -580,8 +580,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,monitor_printf (mon,"\nImages:\n" ); image_info = inserted->image;while (1 ) { -bdrv_image_info_dump ((fprintf_function )monitor_printf, - mon, image_info); +bdrv_image_info_dump (image_info);if (image_info->has_backing_image) { image_info = image_info->backing_image; }else {
@@ -1586,7 +1585,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)monitor_printf (mon,"List of snapshots present on all disks:\n" );if (total >0 ) { -bdrv_snapshot_dump ((fprintf_function )monitor_printf, mon,NULL ); +bdrv_snapshot_dump (NULL );monitor_printf (mon,"\n" );for (i =0 ; i < total; i++) { sn = &sn_tab[global_snapshots[i]];
@@ -1594,7 +1593,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)* overwrite it. */ pstrcpy (sn->id_str,sizeof (sn->id_str),"--" ); -bdrv_snapshot_dump ((fprintf_function )monitor_printf, mon, sn); +bdrv_snapshot_dump (sn);monitor_printf (mon,"\n" ); } }else {
@@ -1608,11 +1607,10 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)monitor_printf (mon,"\nList of partial (non-loadable) snapshots on '%s':\n" , image_entry->imagename); -bdrv_snapshot_dump ((fprintf_function )monitor_printf, mon,NULL ); +bdrv_snapshot_dump (NULL );monitor_printf (mon,"\n" ); QTAILQ_FOREACH(snapshot_entry, &image_entry->snapshots, next) { -bdrv_snapshot_dump ((fprintf_function )monitor_printf, mon, - &snapshot_entry->sn); +bdrv_snapshot_dump (&snapshot_entry->sn);monitor_printf (mon,"\n" ); } }
include/block/qapi.h +3 -7
@@ -27,7 +27,6 @@#include "block/block.h" #include "block/snapshot.h" -#include "qemu/fprintf-fn.h" BlockDeviceInfo *bdrv_block_device_info (BlockBackend *blk,BlockDriverState *bs,Error **errp);
@@ -38,10 +37,7 @@ void bdrv_query_image_info(BlockDriverState *bs, ImageInfo **p_info, Error **errp); -void bdrv_snapshot_dump (fprintf_function func_fprintf,void *f, -QEMUSnapshotInfo *sn); -void bdrv_image_info_specific_dump (fprintf_function func_fprintf,void *f, -ImageInfoSpecific *info_spec); -void bdrv_image_info_dump (fprintf_function func_fprintf,void *f, -ImageInfo *info); +void bdrv_snapshot_dump (QEMUSnapshotInfo *sn); +void bdrv_image_info_specific_dump (ImageInfoSpecific *info_spec); +void bdrv_image_info_dump (ImageInfo *info);#endif
qemu-img.c +3 -3
@@ -2483,11 +2483,11 @@ static void dump_snapshots(BlockDriverState *bs)if (nb_sns <=0 )return ;printf ("Snapshot list:\n" ); -bdrv_snapshot_dump (fprintf, stdout,NULL ); +bdrv_snapshot_dump (NULL );printf ("\n" );for (i =0 ; i < nb_sns; i++) { sn = &sn_tab[i]; -bdrv_snapshot_dump (fprintf, stdout, sn); +bdrv_snapshot_dump (sn);printf ("\n" ); }g_free (sn_tab);
@@ -2536,7 +2536,7 @@ static void dump_human_image_info_list(ImageInfoList *list) } delim = true; -bdrv_image_info_dump (fprintf, stdout, elem->value); +bdrv_image_info_dump (elem->value); } }
qemu-io-cmds.c +1 -1
@@ -1699,7 +1699,7 @@ static int info_f(BlockBackend *blk, int argc, char **argv) }if (spec_info) {printf ("Format specific information:\n" ); -bdrv_image_info_specific_dump (fprintf, stdout, spec_info); +bdrv_image_info_specific_dump (spec_info);qapi_free_ImageInfoSpecific (spec_info); }
Signature · 1 line
2.17.2
PATCH v2 8/17 memory: Clean up how mtree_info() prints
In reply to Markus Armbrustermtree_info() takes an fprintf()-like callback and a FILE * to pass to it, and so do its helper functions. Passing around callback and argument is rather tiresome.
Its only caller hmp_info_mtree() passes monitor_printf() cast to fprintf_function and the current monitor cast to FILE *.
The type-punning is technically undefined behaviour, but works in practice. Clean up: drop the callback, and call qemu_printf() instead.
--- exec.c | 40 ++++----- include/exec/memory-internal.h | 3 +- include/exec/memory.h | 3 +- memory.c | 156 ++++++++++++++++----------------- monitor.c | 3 +- 5 files changed, 98 insertions(+), 107 deletions(-)
exec.c +20 -20
@@ -35,6 +35,7 @@#include "qemu/timer.h" #include "qemu/config-file.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #if defined(CONFIG_USER_ONLY )#include "qemu.h" #else /* !CONFIG_USER_ONLY */
@@ -4117,42 +4118,41 @@ void page_size_init(void)#if !defined(CONFIG_USER_ONLY ) -static void mtree_print_phys_entries (fprintf_function mon,void *f, -int start,int end,int skip,int ptr) +static void mtree_print_phys_entries (int start,int end,int skip,int ptr) {if (start == end -1 ) { -mon (f,"\t%3d " , start); +qemu_printf ("\t%3d " , start); }else { -mon (f,"\t%3d..%-3d " , start, end -1 ); +qemu_printf ("\t%3d..%-3d " , start, end -1 ); } -mon (f," skip=%d " , skip); +qemu_printf (" skip=%d " , skip);if (ptr ==PHYS_MAP_NODE_NIL ) { -mon (f," ptr=NIL" ); +qemu_printf (" ptr=NIL" ); }else if (!skip) { -mon (f," ptr=#%d" , ptr); +qemu_printf (" ptr=#%d" , ptr); }else { -mon (f," ptr=[%d]" , ptr); +qemu_printf (" ptr=[%d]" , ptr); } -mon (f,"\n" ); +qemu_printf ("\n" ); }#define MR_SIZE (size) (int128_nz(size) ? (hwaddr)int128_get64( \ int128_sub((size), int128_one())) : 0) -void mtree_print_dispatch (fprintf_function mon,void *f, -AddressSpaceDispatch *d,MemoryRegion *root) +void mtree_print_dispatch (AddressSpaceDispatch *d,MemoryRegion *root) {int i; -mon (f," Dispatch\n" ); -mon (f," Physical sections\n" ); +qemu_printf (" Dispatch\n" ); +qemu_printf (" Physical sections\n" );for (i =0 ; i < d->map.sections_nb; ++i) {MemoryRegionSection *s = d->map.sections + i;const char *names[] = {" [unassigned]" ," [not dirty]" ," [ROM]" ," [watch]" }; - mon(f, " #%d @" TARGET_FMT_plx ".." TARGET_FMT_plx " %s%s%s%s%s", + qemu_printf(" #%d @" TARGET_FMT_plx ".." TARGET_FMT_plx + " %s%s%s%s%s", i, s->offset_within_address_space, s->offset_within_address_space + MR_SIZE(s->mr->size),
@@ -4163,20 +4163,20 @@ void mtree_print_dispatch(fprintf_function mon, void *f, s->mr->is_iommu ? " [iommu]" : "");if (s->mr->alias) { -mon (f," alias=%s" , s->mr->alias->name ? +qemu_printf (" alias=%s" , s->mr->alias->name ? s->mr->alias->name :"noname" ); } -mon (f,"\n" ); +qemu_printf ("\n" ); } -mon (f," Nodes (%d bits per level, %d levels) ptr=[%d] skip=%d\n" , +qemu_printf (" Nodes (%d bits per level, %d levels) ptr=[%d] skip=%d\n" ,P_L2_BITS ,P_L2_LEVELS , d->phys_map.ptr, d->phys_map.skip);for (i =0 ; i < d->map.nodes_nb; ++i) {int j, jprev;PhysPageEntry prev;Node *n = d->map.nodes + i; -mon (f," [%d]\n" , i); +qemu_printf (" [%d]\n" , i);for (j =0 , jprev =0 , prev = *n[0 ]; j <ARRAY_SIZE (*n); ++j) {PhysPageEntry *pe = *n + j;
@@ -4185,14 +4185,14 @@ void mtree_print_dispatch(fprintf_function mon, void *f,continue ; } -mtree_print_phys_entries (mon, f, jprev, j, prev.skip, prev.ptr); +mtree_print_phys_entries (jprev, j, prev.skip, prev.ptr); jprev = j; prev = *pe; }if (jprev !=ARRAY_SIZE (*n)) { -mtree_print_phys_entries (mon, f, jprev, j, prev.skip, prev.ptr); +mtree_print_phys_entries (jprev, j, prev.skip, prev.ptr); } } }
include/exec/memory-internal.h +1 -2
@@ -45,8 +45,7 @@ AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);void address_space_dispatch_compact (AddressSpaceDispatch *d);void address_space_dispatch_free (AddressSpaceDispatch *d); -void mtree_print_dispatch (fprintf_function mon,void *f, -struct AddressSpaceDispatch *d, +void mtree_print_dispatch (struct AddressSpaceDispatch *d,MemoryRegion *root);struct page_collection ;
include/exec/memory.h +1 -2
@@ -1720,8 +1720,7 @@ void memory_global_dirty_log_start(void);*/ void memory_global_dirty_log_stop (void ); -void mtree_info (fprintf_function mon_printf,void *f,bool flatview, -bool dispatch_tree,bool owner); +void mtree_info (bool flatview,bool dispatch_tree,bool owner);/** * memory_region_dispatch_read: perform a read directly to the specified
memory.c +75 -81
293 lines not on this page · raw message
monitor.c +1 -2
@@ -1907,8 +1907,7 @@ static void hmp_info_mtree(Monitor *mon, const QDict *qdict)bool dispatch_tree =qdict_get_try_bool (qdict,"dispatch_tree" , false);bool owner =qdict_get_try_bool (qdict,"owner" , false); -mtree_info ((fprintf_function )monitor_printf, mon, flatview, dispatch_tree, - owner); +mtree_info (flatview, dispatch_tree, owner); }static void hmp_info_numa (Monitor *mon,const QDict *qdict)
Signature · 1 line
2.17.2
PATCH v2 9/17 target: Simplify how the TARGET_cpu_list() print
In reply to Markus ArmbrusterThe various TARGET_cpu_list() take an fprintf()-like callback and a FILE * to pass to it. Their callers (vl.c's main() via list_cpus(), bsd-user/main.c's main(), linux-user/main.c's main()) all pass fprintf() and stdout. Thus, the flexibility provided by the (rather tiresome) indirection isn't actually used.
Drop the callback, and call qemu_printf() instead.
Calling printf() would also work, but would make the code unsuitable for monitor context without making it simpler.
--- bsd-user/main.c | 2 +- cpus.c | 4 +-- include/exec/cpu-common.h | 13 --------- include/sysemu/cpus.h | 3 +- linux-user/main.c | 2 +- target/alpha/cpu.c | 15 ++++------ target/alpha/cpu.h | 2 +- target/arm/cpu.c | 1 - target/arm/cpu.h | 2 +- target/arm/helper.c | 15 ++++------ target/cris/cpu.c | 14 ++++----- target/cris/cpu.h | 2 +- target/hppa/cpu.c | 14 ++++----- target/hppa/cpu.h | 2 +- target/i386/cpu.c | 29 ++++++++----------- target/i386/cpu.h | 2 +- target/lm32/cpu.c | 14 ++++----- target/lm32/cpu.h | 2 +- target/m68k/cpu.h | 2 +- target/m68k/helper.c | 14 +++------ target/mips/cpu.h | 2 +- target/mips/translate.c | 1 + target/mips/translate_init.inc.c | 5 ++-- target/openrisc/cpu.c | 15 ++++------ target/openrisc/cpu.h | 2 +- target/ppc/cpu.h | 2 +- target/ppc/translate_init.inc.c | 26 +++++++---------- target/riscv/cpu.c | 17 +++-------- target/riscv/cpu.h | 2 +- target/s390x/cpu.h | 2 +- target/s390x/cpu_models.c | 21 ++++++-------- target/sh4/cpu.c | 17 +++-------- target/sh4/cpu.h | 2 +- target/sparc/cpu.c | 49 +++++++++++++++----------------- target/sparc/cpu.h | 2 +- target/tricore/cpu.h | 2 +- target/tricore/helper.c | 15 ++++------ target/xtensa/cpu.h | 2 +- target/xtensa/helper.c | 7 +++-- vl.c | 2 +- 40 files changed, 129 insertions(+), 218 deletions(-)
bsd-user/main.c +1 -1
@@ -819,7 +819,7 @@ int main(int argc, char **argv)if (is_help_option (cpu_model)) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (stdout, &fprintf); +cpu_list ();#endif exit (1 ); }
cpus.c +2 -2
@@ -2181,11 +2181,11 @@ int vm_stop_force_state(RunState state) } } -void list_cpus (FILE *f,fprintf_function cpu_fprintf,const char *optarg) +void list_cpus (const char *optarg) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (f, cpu_fprintf); +cpu_list ();#endif }
include/exec/cpu-common.h +0 -13
@@ -9,19 +9,6 @@#include "qemu/bswap.h" #include "qemu/queue.h" -#include "qemu/fprintf-fn.h" - -/** -* CPUListState: -* @cpu_fprintf: Print function. -* @file: File to print to using @cpu_fprint. -* -* State commonly used for iterating over CPU models. -*/ -typedef struct CPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}CPUListState ;/* The CPU list lock nests outside page_(un)lock or mmap_(un)lock */ void qemu_init_cpu_list (void );
include/sysemu/cpus.h +1 -2
@@ -1,7 +1,6 @@#ifndef QEMU_CPUS_H #define QEMU_CPUS_H -#include "qemu/fprintf-fn.h" #include "qemu/timer.h" /* cpus.c */
@@ -39,7 +38,7 @@ extern int smp_cores;extern int smp_threads;#endif -void list_cpus (FILE *f,fprintf_function cpu_fprintf,const char *optarg); +void list_cpus (const char *optarg);void qemu_tcg_configure (QemuOpts *opts,Error **errp);
linux-user/main.c +1 -1
@@ -317,7 +317,7 @@ static void handle_arg_cpu(const char *arg)if (cpu_model ==NULL ||is_help_option (cpu_model)) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (stdout, &fprintf); +cpu_list ();#endif exit (EXIT_FAILURE ); }
target/alpha/cpu.c +5 -10
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "exec/exec-all.h"
@@ -74,23 +75,17 @@ static void alpha_cpu_realizefn(DeviceState *dev, Error **errp)static void alpha_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data; - (*s->cpu_fprintf)(s->file," %s\n" , -object_class_get_name (oc)); +qemu_printf (" %s\n" ,object_class_get_name (oc)); } -void alpha_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void alpha_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_ALPHA_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, alpha_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, alpha_cpu_list_entry,NULL );g_slist_free (list); }
target/alpha/cpu.h +1 -1
@@ -470,7 +470,7 @@ void alpha_translate_init(void);#define ALPHA_CPU_TYPE_NAME (model) model ALPHA_CPU_TYPE_SUFFIX#define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU -void alpha_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void alpha_cpu_list (void );/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */
target/arm/cpu.c +0 -1
@@ -20,7 +20,6 @@#include "qemu/osdep.h" #include "target/arm/idau.h" -#include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu.h"
target/arm/cpu.h +1 -1
@@ -1936,7 +1936,7 @@ static inline bool access_secure_reg(CPUARMState *env) (arm_is_secure(_env) && !arm_el_is_aa64((_env), 3)), \ (_val)) -void arm_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void arm_cpu_list (void );uint32_t arm_phys_excp_target_el (CPUState *cs,uint32_t excp_idx,uint32_t cur_el,bool secure);
target/arm/helper.c +5 -10
@@ -10,6 +10,7 @@#include "sysemu/sysemu.h" #include "qemu/bitops.h" #include "qemu/crc32c.h" +#include "qemu/qemu-print.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "arm_ldst.h"
@@ -6724,29 +6725,23 @@ static gint arm_cpu_list_compare(gconstpointer a, gconstpointer b)static void arm_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_ARM_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void arm_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void arm_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_ARM_CPU , false); list =g_slist_sort (list, arm_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, arm_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, arm_cpu_list_entry,NULL );g_slist_free (list); }
target/cris/cpu.c +5 -9
@@ -23,6 +23,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "mmu.h"
@@ -103,27 +104,22 @@ static gint cris_cpu_list_compare(gconstpointer a, gconstpointer b)static void cris_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename =object_class_get_name (oc);char *name; name =g_strndup (typename,strlen (typename) -strlen (CRIS_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file," %s\n" , name); +qemu_printf (" %s\n" , name);g_free (name); } -void cris_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void cris_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_CRIS_CPU , false); list =g_slist_sort (list, cris_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, cris_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, cris_cpu_list_entry,NULL );g_slist_free (list); }
target/cris/cpu.h +1 -1
@@ -308,6 +308,6 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *env, target_ulong *pc, }#define cpu_list cris_cpu_list -void cris_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void cris_cpu_list (void );#endif
target/hppa/cpu.c +5 -9
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "exec/exec-all.h"
@@ -113,22 +114,17 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp)static void hppa_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data; - (*s->cpu_fprintf)(s->file," %s\n" ,object_class_get_name (oc)); +qemu_printf (" %s\n" ,object_class_get_name (oc)); } -void hppa_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void hppa_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_HPPA_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, hppa_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, hppa_cpu_list_entry,NULL );g_slist_free (list); }
target/hppa/cpu.h +1 -1
@@ -272,7 +272,7 @@ void hppa_translate_init(void);#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU -void hppa_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void hppa_cpu_list (void );static inline target_ulong hppa_form_gva_psw (target_ureg psw,uint64_t spc,target_ureg off)
target/i386/cpu.c +12 -17
@@ -21,6 +21,7 @@#include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/bitops.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "exec/exec-all.h"
@@ -3671,7 +3672,7 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,/* Print all cpuid feature names in featureset */ -static void listflags (FILE *f,fprintf_function print,GList *features) +static void listflags (GList *features) {size_t len =0 ;GList *tmp;
@@ -3679,13 +3680,13 @@ static void listflags(FILE *f, fprintf_function print, GList *features)for (tmp = features; tmp; tmp = tmp->next) {const char *name = tmp->data;if ((len +strlen (name) +1 ) >=75 ) { -"\n" ); +qemu_printf ("\n" ); len =0 ; } -"%s%s" , len ==0 ?" " :" " , name); +qemu_printf ("%s%s" , len ==0 ?" " :" " , name); len +=strlen (name) +1 ; } -"\n" ); +qemu_printf ("\n" ); }/* Sort alphabetically by type name, respecting X86CPUClass::ordering. */
@@ -3721,32 +3722,26 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data) {ObjectClass *oc = data;X86CPUClass *cc =X86_CPU_CLASS (oc); -CPUListState *s = user_data;char *name =x86_cpu_class_get_model_name (cc);const char *desc = cc->model_description;if (!desc && cc->cpu_def) { desc = cc->cpu_def->model_id; } - (*s->cpu_fprintf)(s->file,"x86 %-20s %-48s\n" , - name, desc); +qemu_printf ("x86 %-20s %-48s\n" , name, desc);g_free (name); }/* list available CPU models and flags */ -void x86_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void x86_cpu_list (void ) {int i, j; -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list;GList *names =NULL ; - (*cpu_fprintf)(f,"Available CPUs:\n" ); +qemu_printf ("Available CPUs:\n" ); list =get_sorted_cpu_model_list (); -g_slist_foreach (list, x86_cpu_list_entry, &s); +g_slist_foreach (list, x86_cpu_list_entry,NULL );g_slist_free (list); names =NULL ;
@@ -3761,9 +3756,9 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf) names =g_list_sort (names, (GCompareFunc )strcmp); - (*cpu_fprintf)(f,"\nRecognized CPUID flags:\n" ); -listflags (f, cpu_fprintf, names); - (*cpu_fprintf)(f,"\n" ); +qemu_printf ("\nRecognized CPUID flags:\n" ); +listflags (names); +qemu_printf ("\n" );g_list_free (names); }
target/i386/cpu.h +1 -1
@@ -1532,7 +1532,7 @@ int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);void x86_cpu_exec_enter (CPUState *cpu);void x86_cpu_exec_exit (CPUState *cpu); -void x86_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void x86_cpu_list (void );int cpu_x86_support_mca_broadcast (CPUX86State *env);int cpu_get_pic_interrupt (CPUX86State *s);
target/lm32/cpu.c +5 -9
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h"
@@ -34,27 +35,22 @@ static void lm32_cpu_set_pc(CPUState *cs, vaddr value)static void lm32_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename =object_class_get_name (oc);char *name; name =g_strndup (typename,strlen (typename) -strlen (LM32_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file," %s\n" , name); +qemu_printf (" %s\n" , name);g_free (name); } -void lm32_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void lm32_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_LM32_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, lm32_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, lm32_cpu_list_entry,NULL );g_slist_free (list); }
target/lm32/cpu.h +1 -1
@@ -243,7 +243,7 @@ static inline lm32_wp_t lm32_wp_type(uint32_t dc, int idx)is returned if the signal was handled by the virtual CPU. */ int cpu_lm32_signal_handler (int host_signum,void *pinfo,void *puc); -void lm32_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void lm32_cpu_list (void );void lm32_translate_init (void );void cpu_lm32_set_phys_msb_ignore (CPULM32State *env,int value); void QEMU_NORETURN raise_exception(CPULM32State *env, int index);
target/m68k/cpu.h +1 -1
@@ -499,7 +499,7 @@ static inline int m68k_feature(CPUM68KState *env, int feature)return (env->features & (1u << feature)) !=0 ; } -void m68k_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void m68k_cpu_list (void );void register_m68k_insns (CPUM68KState *env);
target/m68k/helper.c +4 -10
@@ -22,9 +22,9 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" -#include "exec/helper-proto.h" #include "fpu/softfloat.h" +#include "qemu/qemu-print.h" #define SIGNBIT (1u << 31)
@@ -49,28 +49,22 @@ static gint m68k_cpu_list_compare(gconstpointer a, gconstpointer b)static void m68k_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *c = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (c); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_M68K_CPU )); - (*s->cpu_fprintf)(s->file,"%s\n" , - name); +qemu_printf ("%s\n" , name);g_free (name); } -void m68k_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void m68k_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_M68K_CPU , false); list =g_slist_sort (list, m68k_cpu_list_compare); -g_slist_foreach (list, m68k_cpu_list_entry, &s); +g_slist_foreach (list, m68k_cpu_list_entry,NULL );g_slist_free (list); }
target/mips/cpu.h +1 -1
@@ -1065,7 +1065,7 @@ static inline MIPSCPU *mips_env_get_cpu(CPUMIPSState *env)#define ENV_OFFSET offsetof(MIPSCPU, env) -void mips_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void mips_cpu_list (void );#define cpu_signal_handler cpu_mips_signal_handler#define cpu_list mips_cpu_list
target/mips/translate.c +1 -0
@@ -38,6 +38,7 @@#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" +#include "qemu/qemu-print.h" #define MIPS_DEBUG_DISAS 0
target/mips/translate_init.inc.c +2 -3
@@ -835,13 +835,12 @@ const mips_def_t mips_defs[] = };const int mips_defs_number =ARRAY_SIZE (mips_defs); -void mips_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void mips_cpu_list (void ) {int i;for (i =0 ; i <ARRAY_SIZE (mips_defs); i++) { - (*cpu_fprintf)(f,"MIPS '%s'\n" , - mips_defs[i].name); +qemu_printf ("MIPS '%s'\n" , mips_defs[i].name); } }
target/openrisc/cpu.c +5 -10
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h"
@@ -180,30 +181,24 @@ static gint openrisc_cpu_list_compare(gconstpointer a, gconstpointer b)static void openrisc_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_OPENRISC_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void cpu_openrisc_list (FILE *f,fprintf_function cpu_fprintf) +void cpu_openrisc_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_OPENRISC_CPU , false); list =g_slist_sort (list, openrisc_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, openrisc_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, openrisc_cpu_list_entry,NULL );g_slist_free (list); }
target/openrisc/cpu.h +1 -1
@@ -336,7 +336,7 @@ static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env)#define ENV_OFFSET offsetof(OpenRISCCPU, env) -void cpu_openrisc_list (FILE *f,fprintf_function cpu_fprintf); +void cpu_openrisc_list (void );void openrisc_cpu_do_interrupt (CPUState *cpu);bool openrisc_cpu_exec_interrupt (CPUState *cpu,int int_req); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f,
target/ppc/cpu.h +1 -1
@@ -1308,7 +1308,7 @@ void ppc_store_ptcr(CPUPPCState *env, target_ulong value);#endif /* !defined(CONFIG_USER_ONLY) */ void ppc_store_msr (CPUPPCState *env,target_ulong value); -void ppc_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void ppc_cpu_list (void );/* Time-base and decrementer management */ #ifndef NO_CPU_IO_DEFS
target/ppc/translate_init.inc.c +10 -16
@@ -28,6 +28,7 @@#include "mmu-hash32.h" #include "mmu-hash64.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qapi/error.h" #include "qapi/qmp/qnull.h" #include "qapi/visitor.h"
@@ -10215,7 +10216,6 @@ static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)static void ppc_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;PowerPCCPUClass *pcc =POWERPC_CPU_CLASS (oc);DeviceClass *family =DEVICE_CLASS (ppc_cpu_get_family_class (pcc));const char *typename =object_class_get_name (oc);
@@ -10228,8 +10228,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data) name =g_strndup (typename,strlen (typename) -strlen (POWERPC_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file,"PowerPC %-16s PVR %08x\n" , - name, pcc->pvr); +qemu_printf ("PowerPC %-16s PVR %08x\n" , name, pcc->pvr);for (i =0 ; ppc_cpu_aliases[i].alias !=NULL ; i++) {PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];ObjectClass *alias_oc =ppc_cpu_class_by_name (alias->model);
@@ -10242,33 +10241,28 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)* avoid printing the wrong alias here and use "preferred" instead */ if (strcmp (alias->alias, family->desc) ==0 ) { - (*s->cpu_fprintf)(s->file, -"PowerPC %-16s (alias for preferred %s CPU)\n" , - alias->alias, family->desc); +qemu_printf ("PowerPC %-16s (alias for preferred %s CPU)\n" , + alias->alias, family->desc); }else { - (*s->cpu_fprintf)(s->file,"PowerPC %-16s (alias for %s)\n" , - alias->alias, name); +qemu_printf ("PowerPC %-16s (alias for %s)\n" , + alias->alias, name); } }g_free (name); } -void ppc_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void ppc_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_POWERPC_CPU , false); list =g_slist_sort (list, ppc_cpu_list_compare); -g_slist_foreach (list, ppc_cpu_list_entry, &s); +g_slist_foreach (list, ppc_cpu_list_entry,NULL );g_slist_free (list);#ifdef CONFIG_KVM -cpu_fprintf (f,"\n" ); -cpu_fprintf (f,"PowerPC %-16s\n" ,"host" ); +qemu_printf ("\n" ); +qemu_printf ("PowerPC %-16s\n" ,"host" );#endif }
target/riscv/cpu.c +4 -13
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qemu/qemu-print.h" #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h"
@@ -383,11 +384,6 @@ char *riscv_isa_string(RISCVCPU *cpu)return isa_str; } -typedef struct RISCVCPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}RISCVCPUListState ; -static gint riscv_cpu_list_compare (gconstpointer a,gconstpointer b) {ObjectClass *class_a = (ObjectClass *)a;
@@ -401,24 +397,19 @@ static gint riscv_cpu_list_compare(gconstpointer a, gconstpointer b)static void riscv_cpu_list_entry (gpointer data,gpointer user_data) { -RISCVCPUListState *s = user_data;const char *typename =object_class_get_name (OBJECT_CLASS (data));int len =strlen (typename) -strlen (RISCV_CPU_TYPE_SUFFIX ); - (*s->cpu_fprintf)(s->file,"%.*s\n" , len, typename); +qemu_printf ("%.*s\n" , len, typename); } -void riscv_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void riscv_cpu_list (void ) { -RISCVCPUListState s = { - .cpu_fprintf = cpu_fprintf, - .file = f, - };GSList *list; list =object_class_get_list (TYPE_RISCV_CPU , false); list =g_slist_sort (list, riscv_cpu_list_compare); -g_slist_foreach (list, riscv_cpu_list_entry, &s); +g_slist_foreach (list, riscv_cpu_list_entry,NULL );g_slist_free (list); }
target/riscv/cpu.h +1 -1
@@ -264,7 +264,7 @@ void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,int riscv_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx);char *riscv_isa_string (RISCVCPU *cpu); -void riscv_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void riscv_cpu_list (void );#define cpu_signal_handler riscv_cpu_signal_handler#define cpu_list riscv_cpu_list
target/s390x/cpu.h +1 -1
@@ -753,7 +753,7 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)/* cpu_models.c */ -void s390_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void s390_cpu_list (void );#define cpu_list s390_cpu_listvoid s390_set_qemu_cpu_model (uint16_t type,uint8_t gen,uint8_t ec_ga,const S390FeatInit feat_init);
target/s390x/cpu_models.c +8 -13
@@ -18,6 +18,7 @@#include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qapi/qmp/qerror.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qmp/qdict.h"
@@ -308,7 +309,6 @@ const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,static void s390_print_cpu_model_list_entry (gpointer data,gpointer user_data) { -CPUListState *s = user_data;const S390CPUClass *scc =S390_CPU_CLASS ((ObjectClass *)data);char *name =g_strdup (object_class_get_name ((ObjectClass *)data));const char *details ="" ;
@@ -321,8 +321,7 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)/* strip off the -s390x-cpu */ g_strrstr (name,"-" TYPE_S390_CPU )[0 ] =0 ; - (*s->cpu_fprintf)(s->file,"s390 %-15s %-35s %s\n" , name, scc->desc, - details); +qemu_printf ("s390 %-15s %-35s %s\n" , name, scc->desc, details);g_free (name); }
@@ -360,33 +359,29 @@ static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b)return cc_a->is_static ?-1 :1 ; } -void s390_cpu_list (FILE *f,fprintf_function print) +void s390_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = print, - };S390FeatGroup group;S390Feat feat;GSList *list; list =object_class_get_list (TYPE_S390_CPU , false); list =g_slist_sort (list, s390_cpu_list_compare); -g_slist_foreach (list, s390_print_cpu_model_list_entry, &s); +g_slist_foreach (list, s390_print_cpu_model_list_entry,NULL );g_slist_free (list); - (*print)(f,"\nRecognized feature flags:\n" ); +qemu_printf ("\nRecognized feature flags:\n" );for (feat =0 ; feat <S390_FEAT_MAX ; feat++) {const S390FeatDef *def =s390_feat_def (feat); - (*print)(f,"%-20s %-50s\n" , def->name, def->desc); +qemu_printf ("%-20s %-50s\n" , def->name, def->desc); } - (*print)(f,"\nRecognized feature groups:\n" ); +qemu_printf ("\nRecognized feature groups:\n" );for (group =0 ; group <S390_FEAT_GROUP_MAX ; group++) {const S390FeatGroupDef *def =s390_feat_group_def (group); - (*print)(f,"%-20s %-50s\n" , def->name, def->desc); +qemu_printf ("%-20s %-50s\n" , def->name, def->desc); } }
target/sh4/cpu.c +4 -13
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h"
@@ -79,30 +80,20 @@ static void superh_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) info->print_insn = print_insn_sh; } -typedef struct SuperHCPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}SuperHCPUListState ; -static void superh_cpu_list_entry (gpointer data,gpointer user_data) { -SuperHCPUListState *s = user_data;const char *typename =object_class_get_name (OBJECT_CLASS (data));int len =strlen (typename) -strlen (SUPERH_CPU_TYPE_SUFFIX ); - (*s->cpu_fprintf)(s->file,"%.*s\n" , len, typename); +qemu_printf ("%.*s\n" , len, typename); } -void sh4_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void sh4_cpu_list (void ) { -SuperHCPUListState s = { - .cpu_fprintf = cpu_fprintf, - .file = f, - };GSList *list; list =object_class_get_list_sorted (TYPE_SUPERH_CPU , false); -g_slist_foreach (list, superh_cpu_list_entry, &s); +g_slist_foreach (list, superh_cpu_list_entry,NULL );g_slist_free (list); }
target/sh4/cpu.h +1 -1
@@ -247,7 +247,7 @@ int cpu_sh4_signal_handler(int host_signum, void *pinfo,int superh_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx); -void sh4_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void sh4_cpu_list (void );#if !defined(CONFIG_USER_ONLY )void cpu_sh4_invalidate_tlb (CPUSH4State *s); uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s,
target/sparc/cpu.c +23 -26
77 lines not on this page · raw message
target/sparc/cpu.h +1 -1
@@ -578,7 +578,7 @@ void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN;#ifndef NO_CPU_IO_DEFS /* cpu_init.c */ void cpu_sparc_set_id (CPUSPARCState *env,unsigned int cpu); -void sparc_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void sparc_cpu_list (void );/* mmu_helper.c */ int sparc_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx);
target/tricore/cpu.h +1 -1
@@ -375,7 +375,7 @@ void fpu_set_state(CPUTriCoreState *env);#define MMU_USER_IDX 2 -void tricore_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void tricore_cpu_list (void );#define cpu_signal_handler cpu_tricore_signal_handler#define cpu_list tricore_cpu_list
target/tricore/helper.c +5 -10
@@ -20,6 +20,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "fpu/softfloat.h" +#include "qemu/qemu-print.h" enum {TLBRET_DIRTY =-4 ,
@@ -82,28 +83,22 @@ int cpu_tricore_handle_mmu_fault(CPUState *cs, target_ulong address,static void tricore_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_TRICORE_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void tricore_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void tricore_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_TRICORE_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, tricore_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, tricore_cpu_list_entry,NULL );g_slist_free (list); }
target/xtensa/cpu.h +1 -1
@@ -600,7 +600,7 @@ void xtensa_irq_init(CPUXtensaState *env);qemu_irq *xtensa_get_extints (CPUXtensaState *env);qemu_irq xtensa_get_runstall (CPUXtensaState *env);int cpu_xtensa_signal_handler (int host_signum,void *pinfo,void *puc); -void xtensa_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void xtensa_cpu_list (void );void xtensa_sync_window_from_phys (CPUXtensaState *env);void xtensa_sync_phys_from_window (CPUXtensaState *env);void xtensa_rotate_window (CPUXtensaState *env,uint32_t delta);
target/xtensa/helper.c +4 -3
@@ -31,6 +31,7 @@#include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qemu/host-utils.h" static struct XtensaConfigList *xtensa_cores;
@@ -228,12 +229,12 @@ void xtensa_breakpoint_handler(CPUState *cs) } } -void xtensa_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void xtensa_cpu_list (void ) {XtensaConfigList *core = xtensa_cores; -cpu_fprintf (f,"Available CPUs:\n" ); +qemu_printf ("Available CPUs:\n" );for (; core; core = core->next) { -cpu_fprintf (f," %s\n" , core->config->name); +qemu_printf (" %s\n" , core->config->name); } }
vl.c +1 -1
@@ -4051,7 +4051,7 @@ int main(int argc, char **argv, char **envp) }if (cpu_model &&is_help_option (cpu_model)) { -list_cpus (stdout, &fprintf, cpu_model); +list_cpus (cpu_model);exit (0 ); }
Signature · 1 line
2.17.2
Re: [Qemu-devel] [PATCH v2 09/17] target: Simplify how the TARGET_cpu_list() print
Quoted 6 lines · * Markus Armbruster ([email protected]) wrote:
The various
TARGET_cpu_list()take an fprintf()-like callback and a FILE * to pass to it. Their callers (vl.c'smain()vialist_cpus(), bsd-user/main.c'smain(), linux-user/main.c'smain()) all passfprintf()and stdout. Thus, the flexibility provided by the (rather tiresome) indirection isn't actually used.
Quoted 6 lines
Drop the callback, and call
qemu_printf()instead.Calling
printf()would also work, but would make the code unsuitable for monitor context without making it simpler.Signed-off-by Markus Armbruster <[email protected]>
Quoted 1,190 lines
--- bsd-user/main.c | 2 +- cpus.c | 4 +-- include/exec/cpu-common.h | 13 --------- include/sysemu/cpus.h | 3 +- linux-user/main.c | 2 +- target/alpha/cpu.c | 15 ++++------ target/alpha/cpu.h | 2 +- target/arm/cpu.c | 1 - target/arm/cpu.h | 2 +- target/arm/helper.c | 15 ++++------ target/cris/cpu.c | 14 ++++----- target/cris/cpu.h | 2 +- target/hppa/cpu.c | 14 ++++----- target/hppa/cpu.h | 2 +- target/i386/cpu.c | 29 ++++++++----------- target/i386/cpu.h | 2 +- target/lm32/cpu.c | 14 ++++----- target/lm32/cpu.h | 2 +- target/m68k/cpu.h | 2 +- target/m68k/helper.c | 14 +++------ target/mips/cpu.h | 2 +- target/mips/translate.c | 1 + target/mips/translate_init.inc.c | 5 ++-- target/openrisc/cpu.c | 15 ++++------ target/openrisc/cpu.h | 2 +- target/ppc/cpu.h | 2 +- target/ppc/translate_init.inc.c | 26 +++++++---------- target/riscv/cpu.c | 17 +++-------- target/riscv/cpu.h | 2 +- target/s390x/cpu.h | 2 +- target/s390x/cpu_models.c | 21 ++++++-------- target/sh4/cpu.c | 17 +++-------- target/sh4/cpu.h | 2 +- target/sparc/cpu.c | 49 +++++++++++++++----------------- target/sparc/cpu.h | 2 +- target/tricore/cpu.h | 2 +- target/tricore/helper.c | 15 ++++------ target/xtensa/cpu.h | 2 +- target/xtensa/helper.c | 7 +++-- vl.c | 2 +- 40 files changed, 129 insertions(+), 218 deletions(-)bsd-user/main.c +1
-1@@ -819,7 +819,7 @@ int main(int argc, char **argv)if (is_help_option (cpu_model)) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (stdout, &fprintf); +cpu_list ();#endif exit (1 ); }cpus.c +2
-2@@ -2181,11 +2181,11 @@ int vm_stop_force_state(RunState state) } } -void list_cpus (FILE *f,fprintf_function cpu_fprintf,const char *optarg) +void list_cpus (const char *optarg) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (f, cpu_fprintf); +cpu_list ();#endif }include/exec/cpu-common.h +0
-13@@ -9,19 +9,6 @@#include "qemu/bswap.h" #include "qemu/queue.h" -#include "qemu/fprintf-fn.h" - -/** -* CPUListState: -* @cpu_fprintf: Print function. -* @file: File to print to using @cpu_fprint. -* -* State commonly used for iterating over CPU models. -*/ -typedef struct CPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}CPUListState ;/* The CPU list lock nests outside page_(un)lock or mmap_(un)lock */ void qemu_init_cpu_list (void );include/sysemu/cpus.h +1
-2@@ -1,7 +1,6 @@#ifndef QEMU_CPUS_H #define QEMU_CPUS_H -#include "qemu/fprintf-fn.h" #include "qemu/timer.h" /* cpus.c */ @@ -39,7 +38,7 @@ extern int smp_cores;extern int smp_threads;#endif -void list_cpus (FILE *f,fprintf_function cpu_fprintf,const char *optarg); +void list_cpus (const char *optarg);void qemu_tcg_configure (QemuOpts *opts,Error **errp);linux-user/main.c +1
-1@@ -317,7 +317,7 @@ static void handle_arg_cpu(const char *arg)if (cpu_model ==NULL ||is_help_option (cpu_model)) {/* XXX: implement xxx_cpu_list for targets that still miss it */ #if defined(cpu_list) -cpu_list (stdout, &fprintf); +cpu_list ();#endif exit (EXIT_FAILURE ); }target/alpha/cpu.c +5
-10@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "exec/exec-all.h" @@ -74,23 +75,17 @@ static void alpha_cpu_realizefn(DeviceState *dev, Error **errp)static void alpha_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data; - (*s->cpu_fprintf)(s->file," %s\n" , -object_class_get_name (oc)); +qemu_printf (" %s\n" ,object_class_get_name (oc)); } -void alpha_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void alpha_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_ALPHA_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, alpha_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, alpha_cpu_list_entry,NULL );g_slist_free (list); }target/alpha/cpu.h +1
-1@@ -470,7 +470,7 @@ void alpha_translate_init(void);#define ALPHA_CPU_TYPE_NAME (model) model ALPHA_CPU_TYPE_SUFFIX#define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU -void alpha_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void alpha_cpu_list (void );/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ target/arm/cpu.c +0
-1@@ -20,7 +20,6 @@#include "qemu/osdep.h" #include "target/arm/idau.h" -#include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu.h" target/arm/cpu.h +1
-1@@ -1936,7 +1936,7 @@ static inline bool access_secure_reg(CPUARMState *env) (arm_is_secure(_env) && !arm_el_is_aa64((_env), 3)), \ (_val)) -void arm_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void arm_cpu_list (void );uint32_t arm_phys_excp_target_el (CPUState *cs,uint32_t excp_idx,uint32_t cur_el,bool secure);target/arm/helper.c +5
-10@@ -10,6 +10,7 @@#include "sysemu/sysemu.h" #include "qemu/bitops.h" #include "qemu/crc32c.h" +#include "qemu/qemu-print.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "arm_ldst.h" @@ -6724,29 +6725,23 @@ static gint arm_cpu_list_compare(gconstpointer a, gconstpointer b)static void arm_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_ARM_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void arm_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void arm_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_ARM_CPU , false); list =g_slist_sort (list, arm_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, arm_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, arm_cpu_list_entry,NULL );g_slist_free (list); }target/cris/cpu.c +5
-9@@ -23,6 +23,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "mmu.h" @@ -103,27 +104,22 @@ static gint cris_cpu_list_compare(gconstpointer a, gconstpointer b)static void cris_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename =object_class_get_name (oc);char *name; name =g_strndup (typename,strlen (typename) -strlen (CRIS_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file," %s\n" , name); +qemu_printf (" %s\n" , name);g_free (name); } -void cris_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void cris_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_CRIS_CPU , false); list =g_slist_sort (list, cris_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, cris_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, cris_cpu_list_entry,NULL );g_slist_free (list); }target/cris/cpu.h +1
-1@@ -308,6 +308,6 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *env, target_ulong *pc, }#define cpu_list cris_cpu_list -void cris_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void cris_cpu_list (void );#endif target/hppa/cpu.c +5
-9@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "exec/exec-all.h" @@ -113,22 +114,17 @@ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp)static void hppa_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data; - (*s->cpu_fprintf)(s->file," %s\n" ,object_class_get_name (oc)); +qemu_printf (" %s\n" ,object_class_get_name (oc)); } -void hppa_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void hppa_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_HPPA_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, hppa_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, hppa_cpu_list_entry,NULL );g_slist_free (list); }target/hppa/cpu.h +1
-1@@ -272,7 +272,7 @@ void hppa_translate_init(void);#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU -void hppa_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void hppa_cpu_list (void );static inline target_ulong hppa_form_gva_psw (target_ureg psw,uint64_t spc,target_ureg off)target/i386/cpu.c +12
-17@@ -21,6 +21,7 @@#include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/bitops.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "exec/exec-all.h" @@ -3671,7 +3672,7 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,/* Print all cpuid feature names in featureset */ -static void listflags (FILE *f,fprintf_function print,GList *features) +static void listflags (GList *features) {size_t len =0 ;GList *tmp;@@ -3679,13 +3680,13 @@ static void listflags(FILE *f, fprintf_function print, GList *features)for (tmp = features; tmp; tmp = tmp->next) {const char *name = tmp->data;if ((len +strlen (name) +1 ) >=75 ) { -"\n" ); +qemu_printf ("\n" ); len =0 ; } -"%s%s" , len ==0 ?" " :" " , name); +qemu_printf ("%s%s" , len ==0 ?" " :" " , name); len +=strlen (name) +1 ; } -"\n" ); +qemu_printf ("\n" ); }/* Sort alphabetically by type name, respecting X86CPUClass::ordering. */ @@ -3721,32 +3722,26 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data) {ObjectClass *oc = data;X86CPUClass *cc =X86_CPU_CLASS (oc); -CPUListState *s = user_data;char *name =x86_cpu_class_get_model_name (cc);const char *desc = cc->model_description;if (!desc && cc->cpu_def) { desc = cc->cpu_def->model_id; } - (*s->cpu_fprintf)(s->file,"x86 %-20s %-48s\n" , - name, desc); +qemu_printf ("x86 %-20s %-48s\n" , name, desc);g_free (name); }/* list available CPU models and flags */ -void x86_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void x86_cpu_list (void ) {int i, j; -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list;GList *names =NULL ; - (*cpu_fprintf)(f,"Available CPUs:\n" ); +qemu_printf ("Available CPUs:\n" ); list =get_sorted_cpu_model_list (); -g_slist_foreach (list, x86_cpu_list_entry, &s); +g_slist_foreach (list, x86_cpu_list_entry,NULL );g_slist_free (list); names =NULL ;@@ -3761,9 +3756,9 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf) names =g_list_sort (names, (GCompareFunc )strcmp); - (*cpu_fprintf)(f,"\nRecognized CPUID flags:\n" ); -listflags (f, cpu_fprintf, names); - (*cpu_fprintf)(f,"\n" ); +qemu_printf ("\nRecognized CPUID flags:\n" ); +listflags (names); +qemu_printf ("\n" );g_list_free (names); }target/i386/cpu.h +1
-1@@ -1532,7 +1532,7 @@ int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);void x86_cpu_exec_enter (CPUState *cpu);void x86_cpu_exec_exit (CPUState *cpu); -void x86_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void x86_cpu_list (void );int cpu_x86_support_mca_broadcast (CPUX86State *env);int cpu_get_pic_interrupt (CPUX86State *s);target/lm32/cpu.c +5
-9@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" @@ -34,27 +35,22 @@ static void lm32_cpu_set_pc(CPUState *cs, vaddr value)static void lm32_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename =object_class_get_name (oc);char *name; name =g_strndup (typename,strlen (typename) -strlen (LM32_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file," %s\n" , name); +qemu_printf (" %s\n" , name);g_free (name); } -void lm32_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void lm32_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_LM32_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, lm32_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, lm32_cpu_list_entry,NULL );g_slist_free (list); }target/lm32/cpu.h +1
-1@@ -243,7 +243,7 @@ static inline lm32_wp_t lm32_wp_type(uint32_t dc, int idx)is returned if the signal was handled by the virtual CPU. */ int cpu_lm32_signal_handler (int host_signum,void *pinfo,void *puc); -void lm32_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void lm32_cpu_list (void );void lm32_translate_init (void );void cpu_lm32_set_phys_msb_ignore (CPULM32State *env,int value); void QEMU_NORETURN raise_exception(CPULM32State *env, int index);target/m68k/cpu.h +1
-1@@ -499,7 +499,7 @@ static inline int m68k_feature(CPUM68KState *env, int feature)return (env->features & (1u << feature)) !=0 ; } -void m68k_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void m68k_cpu_list (void );void register_m68k_insns (CPUM68KState *env);target/m68k/helper.c +4
-10@@ -22,9 +22,9 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" -#include "exec/helper-proto.h" #include "fpu/softfloat.h" +#include "qemu/qemu-print.h" #define SIGNBIT (1u << 31)@@ -49,28 +49,22 @@ static gint m68k_cpu_list_compare(gconstpointer a, gconstpointer b)static void m68k_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *c = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (c); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_M68K_CPU )); - (*s->cpu_fprintf)(s->file,"%s\n" , - name); +qemu_printf ("%s\n" , name);g_free (name); } -void m68k_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void m68k_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_M68K_CPU , false); list =g_slist_sort (list, m68k_cpu_list_compare); -g_slist_foreach (list, m68k_cpu_list_entry, &s); +g_slist_foreach (list, m68k_cpu_list_entry,NULL );g_slist_free (list); }target/mips/cpu.h +1
-1@@ -1065,7 +1065,7 @@ static inline MIPSCPU *mips_env_get_cpu(CPUMIPSState *env)#define ENV_OFFSET offsetof(MIPSCPU, env) -void mips_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void mips_cpu_list (void );#define cpu_signal_handler cpu_mips_signal_handler#define cpu_list mips_cpu_listtarget/mips/translate.c +1
-0@@ -38,6 +38,7 @@#include "trace-tcg.h" #include "exec/translator.h" #include "exec/log.h" +#include "qemu/qemu-print.h" #define MIPS_DEBUG_DISAS 0target/mips/translate_init.inc.c +2
-3@@ -835,13 +835,12 @@ const mips_def_t mips_defs[] = };const int mips_defs_number =ARRAY_SIZE (mips_defs); -void mips_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void mips_cpu_list (void ) {int i;for (i =0 ; i <ARRAY_SIZE (mips_defs); i++) { - (*cpu_fprintf)(f,"MIPS '%s'\n" , - mips_defs[i].name); +qemu_printf ("MIPS '%s'\n" , mips_defs[i].name); } }target/openrisc/cpu.c +5
-10@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" @@ -180,30 +181,24 @@ static gint openrisc_cpu_list_compare(gconstpointer a, gconstpointer b)static void openrisc_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_OPENRISC_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void cpu_openrisc_list (FILE *f,fprintf_function cpu_fprintf) +void cpu_openrisc_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_OPENRISC_CPU , false); list =g_slist_sort (list, openrisc_cpu_list_compare); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, openrisc_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, openrisc_cpu_list_entry,NULL );g_slist_free (list); }target/openrisc/cpu.h +1
-1@@ -336,7 +336,7 @@ static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env)#define ENV_OFFSET offsetof(OpenRISCCPU, env) -void cpu_openrisc_list (FILE *f,fprintf_function cpu_fprintf); +void cpu_openrisc_list (void );void openrisc_cpu_do_interrupt (CPUState *cpu);bool openrisc_cpu_exec_interrupt (CPUState *cpu,int int_req); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f,target/ppc/cpu.h +1
-1@@ -1308,7 +1308,7 @@ void ppc_store_ptcr(CPUPPCState *env, target_ulong value);#endif /* !defined(CONFIG_USER_ONLY) */ void ppc_store_msr (CPUPPCState *env,target_ulong value); -void ppc_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void ppc_cpu_list (void );/* Time-base and decrementer management */ #ifndef NO_CPU_IO_DEFS target/ppc/translate_init.inc.c +10
-16@@ -28,6 +28,7 @@#include "mmu-hash32.h" #include "mmu-hash64.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qapi/error.h" #include "qapi/qmp/qnull.h" #include "qapi/visitor.h" @@ -10215,7 +10216,6 @@ static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)static void ppc_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;PowerPCCPUClass *pcc =POWERPC_CPU_CLASS (oc);DeviceClass *family =DEVICE_CLASS (ppc_cpu_get_family_class (pcc));const char *typename =object_class_get_name (oc);@@ -10228,8 +10228,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data) name =g_strndup (typename,strlen (typename) -strlen (POWERPC_CPU_TYPE_SUFFIX )); - (*s->cpu_fprintf)(s->file,"PowerPC %-16s PVR %08x\n" , - name, pcc->pvr); +qemu_printf ("PowerPC %-16s PVR %08x\n" , name, pcc->pvr);for (i =0 ; ppc_cpu_aliases[i].alias !=NULL ; i++) {PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];ObjectClass *alias_oc =ppc_cpu_class_by_name (alias->model);@@ -10242,33 +10241,28 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)* avoid printing the wrong alias here and use "preferred" instead */ if (strcmp (alias->alias, family->desc) ==0 ) { - (*s->cpu_fprintf)(s->file, -"PowerPC %-16s (alias for preferred %s CPU)\n" , - alias->alias, family->desc); +qemu_printf ("PowerPC %-16s (alias for preferred %s CPU)\n" , + alias->alias, family->desc); }else { - (*s->cpu_fprintf)(s->file,"PowerPC %-16s (alias for %s)\n" , - alias->alias, name); +qemu_printf ("PowerPC %-16s (alias for %s)\n" , + alias->alias, name); } }g_free (name); } -void ppc_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void ppc_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list (TYPE_POWERPC_CPU , false); list =g_slist_sort (list, ppc_cpu_list_compare); -g_slist_foreach (list, ppc_cpu_list_entry, &s); +g_slist_foreach (list, ppc_cpu_list_entry,NULL );g_slist_free (list);#ifdef CONFIG_KVM -cpu_fprintf (f,"\n" ); -cpu_fprintf (f,"PowerPC %-16s\n" ,"host" ); +qemu_printf ("\n" ); +qemu_printf ("PowerPC %-16s\n" ,"host" );#endif }target/riscv/cpu.c +4
-13@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qemu/qemu-print.h" #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" @@ -383,11 +384,6 @@ char *riscv_isa_string(RISCVCPU *cpu)return isa_str; } -typedef struct RISCVCPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}RISCVCPUListState ; -static gint riscv_cpu_list_compare (gconstpointer a,gconstpointer b) {ObjectClass *class_a = (ObjectClass *)a;@@ -401,24 +397,19 @@ static gint riscv_cpu_list_compare(gconstpointer a, gconstpointer b)static void riscv_cpu_list_entry (gpointer data,gpointer user_data) { -RISCVCPUListState *s = user_data;const char *typename =object_class_get_name (OBJECT_CLASS (data));int len =strlen (typename) -strlen (RISCV_CPU_TYPE_SUFFIX ); - (*s->cpu_fprintf)(s->file,"%.*s\n" , len, typename); +qemu_printf ("%.*s\n" , len, typename); } -void riscv_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void riscv_cpu_list (void ) { -RISCVCPUListState s = { - .cpu_fprintf = cpu_fprintf, - .file = f, - };GSList *list; list =object_class_get_list (TYPE_RISCV_CPU , false); list =g_slist_sort (list, riscv_cpu_list_compare); -g_slist_foreach (list, riscv_cpu_list_entry, &s); +g_slist_foreach (list, riscv_cpu_list_entry,NULL );g_slist_free (list); }target/riscv/cpu.h +1
-1@@ -264,7 +264,7 @@ void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,int riscv_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx);char *riscv_isa_string (RISCVCPU *cpu); -void riscv_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void riscv_cpu_list (void );#define cpu_signal_handler riscv_cpu_signal_handler#define cpu_list riscv_cpu_listtarget/s390x/cpu.h +1
-1@@ -753,7 +753,7 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)/* cpu_models.c */ -void s390_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void s390_cpu_list (void );#define cpu_list s390_cpu_listvoid s390_set_qemu_cpu_model (uint16_t type,uint8_t gen,uint8_t ec_ga,const S390FeatInit feat_init);target/s390x/cpu_models.c +8
-13@@ -18,6 +18,7 @@#include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qapi/qmp/qerror.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qmp/qdict.h" @@ -308,7 +309,6 @@ const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,static void s390_print_cpu_model_list_entry (gpointer data,gpointer user_data) { -CPUListState *s = user_data;const S390CPUClass *scc =S390_CPU_CLASS ((ObjectClass *)data);char *name =g_strdup (object_class_get_name ((ObjectClass *)data));const char *details ="" ;@@ -321,8 +321,7 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)/* strip off the -s390x-cpu */ g_strrstr (name,"-" TYPE_S390_CPU )[0 ] =0 ; - (*s->cpu_fprintf)(s->file,"s390 %-15s %-35s %s\n" , name, scc->desc, - details); +qemu_printf ("s390 %-15s %-35s %s\n" , name, scc->desc, details);g_free (name); }@@ -360,33 +359,29 @@ static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b)return cc_a->is_static ?-1 :1 ; } -void s390_cpu_list (FILE *f,fprintf_function print) +void s390_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = print, - };S390FeatGroup group;S390Feat feat;GSList *list; list =object_class_get_list (TYPE_S390_CPU , false); list =g_slist_sort (list, s390_cpu_list_compare); -g_slist_foreach (list, s390_print_cpu_model_list_entry, &s); +g_slist_foreach (list, s390_print_cpu_model_list_entry,NULL );g_slist_free (list); - (*print)(f,"\nRecognized feature flags:\n" ); +qemu_printf ("\nRecognized feature flags:\n" );for (feat =0 ; feat <S390_FEAT_MAX ; feat++) {const S390FeatDef *def =s390_feat_def (feat); - (*print)(f,"%-20s %-50s\n" , def->name, def->desc); +qemu_printf ("%-20s %-50s\n" , def->name, def->desc); } - (*print)(f,"\nRecognized feature groups:\n" ); +qemu_printf ("\nRecognized feature groups:\n" );for (group =0 ; group <S390_FEAT_GROUP_MAX ; group++) {const S390FeatGroupDef *def =s390_feat_group_def (group); - (*print)(f,"%-20s %-50s\n" , def->name, def->desc); +qemu_printf ("%-20s %-50s\n" , def->name, def->desc); } }target/sh4/cpu.c +4
-13@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" @@ -79,30 +80,20 @@ static void superh_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) info->print_insn = print_insn_sh; } -typedef struct SuperHCPUListState { -fprintf_function cpu_fprintf; -FILE *file; -}SuperHCPUListState ; -static void superh_cpu_list_entry (gpointer data,gpointer user_data) { -SuperHCPUListState *s = user_data;const char *typename =object_class_get_name (OBJECT_CLASS (data));int len =strlen (typename) -strlen (SUPERH_CPU_TYPE_SUFFIX ); - (*s->cpu_fprintf)(s->file,"%.*s\n" , len, typename); +qemu_printf ("%.*s\n" , len, typename); } -void sh4_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void sh4_cpu_list (void ) { -SuperHCPUListState s = { - .cpu_fprintf = cpu_fprintf, - .file = f, - };GSList *list; list =object_class_get_list_sorted (TYPE_SUPERH_CPU , false); -g_slist_foreach (list, superh_cpu_list_entry, &s); +g_slist_foreach (list, superh_cpu_list_entry,NULL );g_slist_free (list); }target/sh4/cpu.h +1
-1@@ -247,7 +247,7 @@ int cpu_sh4_signal_handler(int host_signum, void *pinfo,int superh_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx); -void sh4_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void sh4_cpu_list (void );#if !defined(CONFIG_USER_ONLY )void cpu_sh4_invalidate_tlb (CPUSH4State *s); uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s,target/sparc/cpu.c +23
-26@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "cpu.h" -#include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "qapi/visitor.h" @@ -556,47 +556,44 @@ static const char * const feature_name[] = { "gl", }; -static void print_features (FILE *f,fprintf_function cpu_fprintf, -uint32_t features,const char *prefix) +static void print_features (uint32_t features,const char *prefix) {unsigned int i;for (i =0 ; i <ARRAY_SIZE (feature_name); i++) {if (feature_name[i] && (features & (1 << i))) {if (prefix) { - (*cpu_fprintf)(f,"%s" , prefix); +qemu_printf ("%s" , prefix); } - (*cpu_fprintf)(f,"%s " , feature_name[i]); +qemu_printf ("%s " , feature_name[i]); } } } -void sparc_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void sparc_cpu_list (void ) {unsigned int i;for (i =0 ; i <ARRAY_SIZE (sparc_defs); i++) { - (*cpu_fprintf)(f,"Sparc %16s IU " TARGET_FMT_lx -" FPU %08x MMU %08x NWINS %d " , - sparc_defs[i].name, - sparc_defs[i].iu_version, - sparc_defs[i].fpu_version, - sparc_defs[i].mmu_version, - sparc_defs[i].nwindows); -print_features (f, cpu_fprintf,CPU_DEFAULT_FEATURES & - ~sparc_defs[i].features,"-" ); -print_features (f, cpu_fprintf, ~CPU_DEFAULT_FEATURES & - sparc_defs[i].features,"+" ); - (*cpu_fprintf)(f,"\n" ); +qemu_printf ("Sparc %16s IU " TARGET_FMT_lx +" FPU %08x MMU %08x NWINS %d " , + sparc_defs[i].name, + sparc_defs[i].iu_version, + sparc_defs[i].fpu_version, + sparc_defs[i].mmu_version, + sparc_defs[i].nwindows); +print_features (CPU_DEFAULT_FEATURES & ~sparc_defs[i].features,"-" ); +print_features (~CPU_DEFAULT_FEATURES & sparc_defs[i].features,"+" ); +qemu_printf ("\n" ); } - (*cpu_fprintf)(f,"Default CPU feature flags (use '-' to remove): " ); -print_features (f, cpu_fprintf,CPU_DEFAULT_FEATURES ,NULL ); - (*cpu_fprintf)(f,"\n" ); - (*cpu_fprintf)(f,"Available CPU feature flags (use '+' to add): " ); -print_features (f, cpu_fprintf, ~CPU_DEFAULT_FEATURES ,NULL ); - (*cpu_fprintf)(f,"\n" ); - (*cpu_fprintf)(f,"Numerical features (use '=' to set): iu_version " -"fpu_version mmu_version nwindows\n" ); +qemu_printf ("Default CPU feature flags (use '-' to remove): " ); +print_features (CPU_DEFAULT_FEATURES ,NULL ); +qemu_printf ("\n" ); +qemu_printf ("Available CPU feature flags (use '+' to add): " ); +print_features (~CPU_DEFAULT_FEATURES ,NULL ); +qemu_printf ("\n" ); +qemu_printf ("Numerical features (use '=' to set): iu_version " +"fpu_version mmu_version nwindows\n" ); } static void cpu_print_cc(FILE *f, fprintf_function cpu_fprintf,target/sparc/cpu.h +1
-1@@ -578,7 +578,7 @@ void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN;#ifndef NO_CPU_IO_DEFS /* cpu_init.c */ void cpu_sparc_set_id (CPUSPARCState *env,unsigned int cpu); -void sparc_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void sparc_cpu_list (void );/* mmu_helper.c */ int sparc_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx);target/tricore/cpu.h +1
-1@@ -375,7 +375,7 @@ void fpu_set_state(CPUTriCoreState *env);#define MMU_USER_IDX 2 -void tricore_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void tricore_cpu_list (void );#define cpu_signal_handler cpu_tricore_signal_handler#define cpu_list tricore_cpu_listtarget/tricore/helper.c +5
-10@@ -20,6 +20,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "fpu/softfloat.h" +#include "qemu/qemu-print.h" enum {TLBRET_DIRTY =-4 ,@@ -82,28 +83,22 @@ int cpu_tricore_handle_mmu_fault(CPUState *cs, target_ulong address,static void tricore_cpu_list_entry (gpointer data,gpointer user_data) {ObjectClass *oc = data; -CPUListState *s = user_data;const char *typename;char *name; typename =object_class_get_name (oc); name =g_strndup (typename,strlen (typename) -strlen ("-" TYPE_TRICORE_CPU )); - (*s->cpu_fprintf)(s->file," %s\n" , - name); +qemu_printf (" %s\n" , name);g_free (name); } -void tricore_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void tricore_cpu_list (void ) { -CPUListState s = { - .file = f, - .cpu_fprintf = cpu_fprintf, - };GSList *list; list =object_class_get_list_sorted (TYPE_TRICORE_CPU , false); - (*cpu_fprintf)(f,"Available CPUs:\n" ); -g_slist_foreach (list, tricore_cpu_list_entry, &s); +qemu_printf ("Available CPUs:\n" ); +g_slist_foreach (list, tricore_cpu_list_entry,NULL );g_slist_free (list); }target/xtensa/cpu.h +1
-1@@ -600,7 +600,7 @@ void xtensa_irq_init(CPUXtensaState *env);qemu_irq *xtensa_get_extints (CPUXtensaState *env);qemu_irq xtensa_get_runstall (CPUXtensaState *env);int cpu_xtensa_signal_handler (int host_signum,void *pinfo,void *puc); -void xtensa_cpu_list (FILE *f,fprintf_function cpu_fprintf); +void xtensa_cpu_list (void );void xtensa_sync_window_from_phys (CPUXtensaState *env);void xtensa_sync_phys_from_window (CPUXtensaState *env);void xtensa_rotate_window (CPUXtensaState *env,uint32_t delta);target/xtensa/helper.c +4
-3@@ -31,6 +31,7 @@#include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "qemu/host-utils.h" static struct XtensaConfigList *xtensa_cores;@@ -228,12 +229,12 @@ void xtensa_breakpoint_handler(CPUState *cs) } } -void xtensa_cpu_list (FILE *f,fprintf_function cpu_fprintf) +void xtensa_cpu_list (void ) {XtensaConfigList *core = xtensa_cores; -cpu_fprintf (f,"Available CPUs:\n" ); +qemu_printf ("Available CPUs:\n" );for (; core; core = core->next) { -cpu_fprintf (f," %s\n" , core->config->name); +qemu_printf (" %s\n" , core->config->name); } }vl.c +1
-1@@ -4051,7 +4051,7 @@ int main(int argc, char **argv, char **envp) }if (cpu_model &&is_help_option (cpu_model)) { -list_cpus (stdout, &fprintf, cpu_model); +list_cpus (cpu_model);exit (0 ); }Signature · 1 line
2.17.2
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
PATCH v2 10/17 target: Clean up how the dump_mmu() print
In reply to Markus ArmbrusterThe various dump_mmu() take an fprintf()-like callback and a FILE * to pass to it, and so do their helper functions. Passing around callback and argument is rather tiresome.
Most dump_mmu() are called only by the target's hmp_info_tlb(). These all pass monitor_printf() cast to fprintf_function and the current monitor cast to FILE *.
SPARC's dump_mmu() gets also called from target/sparc/ldst_helper.c a few times #ifdef DEBUG_MMU. These calls pass fprintf() and stdout.
The type-punning is technically undefined behaviour, but works in practice. Clean up: drop the callback, and call qemu_printf() instead.
--- target/m68k/cpu.h | 3 +- target/m68k/helper.c | 115 ++++++++++++++++++------------------- target/m68k/monitor.c | 2 +- target/nios2/cpu.h | 2 +- target/nios2/mmu.c | 7 ++- target/nios2/monitor.c | 2 +- target/ppc/cpu.h | 2 +- target/ppc/mmu-hash64.c | 7 ++- target/ppc/mmu-hash64.h | 2 +- target/ppc/mmu_helper.c | 70 +++++++++++----------- target/ppc/monitor.c | 2 +- target/sparc/cpu.h | 2 +- target/sparc/ldst_helper.c | 18 +++--- target/sparc/mmu_helper.c | 97 +++++++++++++++---------------- target/sparc/monitor.c | 2 +- target/xtensa/cpu.h | 2 +- target/xtensa/mmu_helper.c | 24 ++++---- target/xtensa/monitor.c | 2 +- 18 files changed, 178 insertions(+), 183 deletions(-)
target/m68k/cpu.h +2 -1
@@ -573,5 +573,6 @@ static inline void cpu_get_tb_cpu_state(CPUM68KState *env, target_ulong *pc, } } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUM68KState *env); +void dump_mmu (CPUM68KState *env); +#endif
target/m68k/helper.c +56 -59
219 lines not on this page · raw message
target/m68k/monitor.c +1 -1
@@ -19,7 +19,7 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)return ; } -dump_mmu ((FILE *)mon, (fprintf_function )monitor_printf, env1); +dump_mmu (env1); }static const MonitorDef monitor_defs[] = {
target/nios2/cpu.h +1 -1
@@ -212,7 +212,7 @@ static inline Nios2CPU *nios2_env_get_cpu(CPUNios2State *env)void nios2_tcg_init (void );void nios2_cpu_do_interrupt (CPUState *cs);int cpu_nios2_signal_handler (int host_signum,void *pinfo,void *puc); -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUNios2State *env); +void dump_mmu (CPUNios2State *env);void nios2_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf,int flags);hwaddr nios2_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);
target/nios2/mmu.c +4 -3
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "exec/exec-all.h" #include "mmu.h"
@@ -264,18 +265,18 @@ void mmu_init(CPUNios2State *env) mmu->tlb =g_new0 (Nios2TLBEntry, cpu->tlb_num_entries); } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUNios2State *env) +void dump_mmu (CPUNios2State *env) {Nios2CPU *cpu =nios2_env_get_cpu (env);int i; -cpu_fprintf (f,"MMU: ways %d, entries %d, pid bits %d\n" , +qemu_printf ("MMU: ways %d, entries %d, pid bits %d\n" , cpu->tlb_num_ways, cpu->tlb_num_entries, cpu->pid_num_bits);for (i =0 ; i < cpu->tlb_num_entries; i++) {Nios2TLBEntry *entry = &env->mmu.tlb[i]; - cpu_fprintf(f, "TLB[%d] = %08X %08X %c VPN %05X " + qemu_printf("TLB[%d] = %08X %08X %c VPN %05X " "PID %02X %c PFN %05X %c%c%c%c\n", i, entry->tag, entry->data, (entry->tag & (1 << 10)) ? 'V' : '-',
target/nios2/monitor.c +1 -1
@@ -31,5 +31,5 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) {CPUArchState *env1 =mon_get_cpu_env (); -dump_mmu ((FILE *)mon, (fprintf_function )monitor_printf, env1); +dump_mmu (env1); }
target/ppc/cpu.h +1 -1
@@ -2629,7 +2629,7 @@ static inline ppc_avr_t *cpu_avr_ptr(CPUPPCState *env, int i) return (ppc_avr_t *)((uintptr_t)env + avr_full_offset(i)); } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUPPCState *env); +void dump_mmu (CPUPPCState *env);void ppc_maybe_bswap_register (CPUPPCState *env,uint8_t *mem_buf,int len);#endif /* PPC_CPU_H */
target/ppc/mmu-hash64.c +4 -3
@@ -22,6 +22,7 @@#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "sysemu/hw_accel.h" #include "kvm_ppc.h" #include "mmu-hash64.h"
@@ -71,7 +72,7 @@ static ppc_slb_t *slb_lookup(PowerPCCPU *cpu, target_ulong eaddr)return NULL ; } -void dump_slb (FILE *f,fprintf_function cpu_fprintf,PowerPCCPU *cpu) +void dump_slb (PowerPCCPU *cpu) {CPUPPCState *env = &cpu->env;int i;
@@ -79,14 +80,14 @@ void dump_slb(FILE *f, fprintf_function cpu_fprintf, PowerPCCPU *cpu)cpu_synchronize_state (CPU (cpu)); -cpu_fprintf (f,"SLB\tESID\t\t\tVSID\n" ); +qemu_printf ("SLB\tESID\t\t\tVSID\n" );for (i =0 ; i < cpu->hash64_opts->slb_size; i++) { slbe = env->slb[i].esid; slbv = env->slb[i].vsid;if (slbe ==0 && slbv ==0 ) {continue ; } -cpu_fprintf (f,"%d\t0x%016" PRIx64"\t0x%016" PRIx64"\n" , +qemu_printf ("%d\t0x%016" PRIx64"\t0x%016" PRIx64"\n" , i, slbe, slbv); } }
target/ppc/mmu-hash64.h +1 -1
@@ -4,7 +4,7 @@#ifndef CONFIG_USER_ONLY #ifdef TARGET_PPC64 -void dump_slb (FILE *f,fprintf_function cpu_fprintf,PowerPCCPU *cpu); +void dump_slb (PowerPCCPU *cpu);int ppc_store_slb (PowerPCCPU *cpu,target_ulong slot,target_ulong esid,target_ulong vsid);hwaddr ppc_hash64_get_phys_page_debug (PowerPCCPU *cpu,target_ulong addr);
target/ppc/mmu_helper.c +33 -37
203 lines not on this page · raw message
target/ppc/monitor.c +1 -1
@@ -66,7 +66,7 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)monitor_printf (mon,"No CPU available\n" );return ; } -dump_mmu ((FILE *)mon, (fprintf_function )monitor_printf, env1); +dump_mmu (env1); }const MonitorDef monitor_defs[] = {
target/sparc/cpu.h +1 -1
@@ -583,7 +583,7 @@ void sparc_cpu_list(void);int sparc_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int mmu_idx);target_ulong mmu_probe (CPUSPARCState *env,target_ulong address,int mmulev); -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUSPARCState *env); +void dump_mmu (CPUSPARCState *env);#if !defined(TARGET_SPARC64 ) && !defined(CONFIG_USER_ONLY ) int sparc_cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
target/sparc/ldst_helper.c +9 -9
@@ -198,7 +198,7 @@ static void demap_tlb(SparcTLBEntry *tlb, target_ulong demap_addr,replace_tlb_entry (&tlb[i],0 ,0 , env1);#ifdef DEBUG_MMU DPRINTF_MMU ("%s demap invalidated entry [%02u]\n" , strmmu, i); -dump_mmu (stdout, fprintf, env1); +dump_mmu (env1);#endif } }
@@ -260,7 +260,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb,replace_tlb_entry (&tlb[i], tlb_tag, tlb_tte, env1);#ifdef DEBUG_MMU DPRINTF_MMU ("%s lru replaced invalid entry [%i]\n" , strmmu, i); -dump_mmu (stdout, fprintf, env1); +dump_mmu (env1);#endif return ; }
@@ -279,7 +279,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb,#ifdef DEBUG_MMU DPRINTF_MMU ("%s lru replaced unlocked %s entry [%i]\n" , strmmu, (replace_used ?"used" :"unused" ), i); -dump_mmu (stdout, fprintf, env1); +dump_mmu (env1);#endif return ; }
@@ -886,7 +886,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, uint64_t val,break ; }#ifdef DEBUG_MMU -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif }break ;
@@ -941,7 +941,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, uint64_t val, reg, oldreg, env->mmuregs[reg]); }#ifdef DEBUG_MMU -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif }break ;
@@ -1634,7 +1634,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, PRIx64 "\n", reg, oldreg, env->immuregs[reg]); }#ifdef DEBUG_MMU -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif return ; }
@@ -1658,7 +1658,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, }#ifdef DEBUG_MMU DPRINTF_MMU ("immu data access replaced entry [%i]\n" , i); -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif return ; }
@@ -1718,7 +1718,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, PRIx64 "\n", reg, oldreg, env->dmmuregs[reg]); }#ifdef DEBUG_MMU -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif return ; }
@@ -1740,7 +1740,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, }#ifdef DEBUG_MMU DPRINTF_MMU ("dmmu data access replaced entry [%i]\n" , i); -dump_mmu (stdout, fprintf, env); +dump_mmu (env);#endif return ; }
target/sparc/mmu_helper.c +49 -48
156 lines not on this page · raw message
target/sparc/monitor.c +1 -1
@@ -36,7 +36,7 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)monitor_printf (mon,"No CPU available\n" );return ; } -dump_mmu ((FILE *)mon, (fprintf_function )monitor_printf, env1); +dump_mmu (env1); }#ifndef TARGET_SPARC64
target/xtensa/cpu.h +1 -1
@@ -673,7 +673,7 @@ int xtensa_get_physical_addr(CPUXtensaState *env, bool update_tlb, uint32_t vaddr, int is_write, int mmu_idx, uint32_t *paddr, uint32_t *page_size, unsigned *access);void reset_mmu (CPUXtensaState *env); -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUXtensaState *env); +void dump_mmu (CPUXtensaState *env);static inline MemoryRegion *xtensa_get_er_region (CPUXtensaState *env) {
target/xtensa/mmu_helper.c +11 -13
@@ -27,6 +27,7 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" +#include "qemu/qemu-print.h" #include "qemu/units.h" #include "cpu.h" #include "exec/helper-proto.h"
@@ -740,8 +741,7 @@ int xtensa_get_physical_addr(CPUXtensaState *env, bool update_tlb, } } -static void dump_tlb (FILE *f,fprintf_function cpu_fprintf, -CPUXtensaState *env,bool dtlb) +static void dump_tlb (CPUXtensaState *env,bool dtlb) {unsigned wi, ei; const xtensa_tlb *conf =
@@ -780,13 +780,11 @@ static void dump_tlb(FILE *f, fprintf_function cpu_fprintf,if (print_header) { print_header = false; -cpu_fprintf (f,"Way %u (%d %s)\n" , wi, sz, sz_text); -cpu_fprintf (f, -"\tVaddr Paddr ASID Attr RWX Cache\n" +qemu_printf ("Way %u (%d %s)\n" , wi, sz, sz_text); +qemu_printf ("\tVaddr Paddr ASID Attr RWX Cache\n" "\t---------- ---------- ---- ---- --- -------\n" ); } - cpu_fprintf(f, - "\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %-7s\n", + qemu_printf("\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %-7s\n", entry->vaddr, entry->paddr, entry->asid,
@@ -801,18 +799,18 @@ static void dump_tlb(FILE *f, fprintf_function cpu_fprintf, } } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUXtensaState *env) +void dump_mmu (CPUXtensaState *env) {if (xtensa_option_bits_enabled (env->config,XTENSA_OPTION_BIT (XTENSA_OPTION_REGION_PROTECTION ) |XTENSA_OPTION_BIT (XTENSA_OPTION_REGION_TRANSLATION ) |XTENSA_OPTION_BIT (XTENSA_OPTION_MMU ))) { -cpu_fprintf (f,"ITLB:\n" ); -dump_tlb (f, cpu_fprintf, env, false); -cpu_fprintf (f,"\nDTLB:\n" ); -dump_tlb (f, cpu_fprintf, env, true); +qemu_printf ("ITLB:\n" ); +dump_tlb (env, false); +qemu_printf ("\nDTLB:\n" ); +dump_tlb (env, true); }else { -cpu_fprintf (f,"No TLB for this CPU core\n" ); +qemu_printf ("No TLB for this CPU core\n" ); } }
target/xtensa/monitor.c +1 -1
@@ -35,5 +35,5 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)monitor_printf (mon,"No CPU available\n" );return ; } -dump_mmu ((FILE *)mon, (fprintf_function )monitor_printf, env1); +dump_mmu (env1); }
Signature · 1 line
2.17.2
PATCH v2 11/17 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints
In reply to Markus Armbrusterx86_cpu_dump_local_apic_state() takes an fprintf()-like callback and a FILE * to pass to it, and so do its helper functions.
Its only caller hmp_info_local_apic() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- target/i386/cpu.h | 3 +- target/i386/helper.c | 79 ++++++++++++++++++++----------------------- target/i386/monitor.c | 3 +- 3 files changed, 39 insertions(+), 46 deletions(-)
target/i386/cpu.h +1 -2
@@ -1924,8 +1924,7 @@ void enable_compat_apic_id_mode(void);#define APIC_DEFAULT_ADDRESS 0xfee00000#define APIC_SPACE_SIZE 0x100000 -void x86_cpu_dump_local_apic_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags); +void x86_cpu_dump_local_apic_state (CPUState *cs,int flags);/* cpu.c */ bool cpu_is_bsp (X86CPU *cpu);
target/i386/helper.c +37 -42
184 lines not on this page · raw message
target/i386/monitor.c +1 -2
@@ -664,8 +664,7 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qdict)monitor_printf (mon,"No CPU available\n" );return ; } -x86_cpu_dump_local_apic_state (cs, (FILE *)mon, monitor_fprintf, -CPU_DUMP_FPU ); +x86_cpu_dump_local_apic_state (cs,CPU_DUMP_FPU ); }void hmp_info_io_apic (Monitor *mon,const QDict *qdict)
Signature · 1 line
2.17.2
PATCH v2 12/17 qom/cpu: Simplify how CPUClass::dump_statistics() prints
In reply to Markus ArmbrusterCPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it.
Its only caller hmp_info_cpustats() (via cpu_dump_statistics()) passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
Drop the callback, and call qemu_printf() instead.
--- include/qom/cpu.h | 11 ++++------- monitor.c | 2 +- qom/cpu.c | 5 ++--- target/ppc/cpu.h | 3 +-- target/ppc/translate.c | 9 ++++----- 5 files changed, 12 insertions(+), 18 deletions(-)
include/qom/cpu.h +4 -7
@@ -184,8 +184,7 @@ typedef struct CPUClass {void (*dump_state)(CPUState *cpu,FILE *f,fprintf_function cpu_fprintf,int flags); GuestPanicInformation* (*get_crash_info)(CPUState *cpu); -void (*dump_statistics)(CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void (*dump_statistics)(CPUState *cpu,int flags);int64_t (*get_arch_id)(CPUState *cpu);bool (*get_paging_enabled)(const CPUState *cpu); void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list,
@@ -576,14 +575,12 @@ void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,/** * cpu_dump_statistics: * @cpu: The CPU whose state is to be dumped. -* @f: File to dump to. -* @cpu_fprintf: Function to dump with. * @flags: Flags what to dump. * -* Dumps CPU statistics. +* Dump CPU statistics to the current monitor if we have one, else to +* stdout. */ -void cpu_dump_statistics (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void cpu_dump_statistics (CPUState *cpu,int flags);#ifndef CONFIG_USER_ONLY /**
monitor.c +1 -1
@@ -1364,7 +1364,7 @@ static void hmp_info_cpustats(Monitor *mon, const QDict *qdict)monitor_printf (mon,"No CPU available\n" );return ; } -cpu_dump_statistics (cs, (FILE *)mon, &monitor_fprintf,0 ); +cpu_dump_statistics (cs,0 ); }static void hmp_info_trace_events (Monitor *mon,const QDict *qdict)
qom/cpu.c +2 -3
@@ -230,13 +230,12 @@ void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, } } -void cpu_dump_statistics (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags) +void cpu_dump_statistics (CPUState *cpu,int flags) {CPUClass *cc =CPU_GET_CLASS (cpu);if (cc->dump_statistics) { - cc->dump_statistics (cpu, f, cpu_fprintf, flags); + cc->dump_statistics (cpu, flags); } }
target/ppc/cpu.h +1 -2
@@ -1270,8 +1270,7 @@ void ppc_cpu_do_interrupt(CPUState *cpu);bool ppc_cpu_exec_interrupt (CPUState *cpu,int int_req);void ppc_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf,int flags); -void ppc_cpu_dump_statistics (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void ppc_cpu_dump_statistics (CPUState *cpu,int flags);hwaddr ppc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int ppc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int ppc_cpu_gdb_read_register_apple (CPUState *cpu,uint8_t *buf,int reg);
target/ppc/translate.c +4 -5
@@ -7593,8 +7593,7 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,#undef RFPL } -void ppc_cpu_dump_statistics (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void ppc_cpu_dump_statistics (CPUState *cs,int flags) {#if defined(DO_PPC_STATISTICS )PowerPCCPU *cpu =POWERPC_CPU (cs);
@@ -7614,7 +7613,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f, handler = t3[op3];if (handler->count ==0 )continue ; - cpu_fprintf(f, "%02x %02x %02x (%02x %04d) %16s: " + qemu_printf("%02x %02x %02x (%02x %04d) %16s: " "%016" PRIx64 " %" PRId64 "\n", op1, op2, op3, op1, (op3 << 5) | op2, handler->oname,
@@ -7623,7 +7622,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f, }else {if (handler->count ==0 )continue ; -cpu_fprintf (f,"%02x %02x (%02x %04d) %16s: " +qemu_printf ("%02x %02x (%02x %04d) %16s: " "%016" PRIx64" %" PRId64"\n" , op1, op2, op1, op2, handler->oname, handler->count, handler->count);
@@ -7632,7 +7631,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f, }else {if (handler->count ==0 )continue ; -cpu_fprintf (f,"%02x (%02x ) %16s: %016" PRIx64 +qemu_printf ("%02x (%02x ) %16s: %016" PRIx64" %" PRId64"\n" , op1, op1, handler->oname, handler->count, handler->count);
Signature · 1 line
2.17.2
PATCH v2 13/17 qemu-print: New qemu_fprintf(), qemu_vfprintf()
In reply to Markus ArmbrusterCode that doesn't want to know about current monitor vs. stdout vs. stderr takes an fprintf_function callback and a FILE * argument to pass to it. Actual arguments are either fprintf() and stdout or stderr, or monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly.
New qemu_fprintf() and qemu_vprintf() address this need without type
punning: they are like fprintf() and vfprintf(), except they print to the current monitor when passed a null FILE *. The next commits will put them to use.
--- include/qemu/qemu-print.h | 4 ++++ util/qemu-print.c | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+)
include/qemu/qemu-print.h +4 -0
@@ -16,4 +16,8 @@ int qemu_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); int qemu_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap) + GCC_FMT_ATTR(2, 0); +int qemu_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +#endif
util/qemu-print.c +27 -0
@@ -40,3 +40,30 @@ int qemu_printf(const char *fmt, ...)va_end (ap);return ret; } + +/* +* Print like vfprintf() +* Print to @stream if non-null, else to current monitor. +*/ +int qemu_vfprintf (FILE *stream,const char *fmt,va_list ap) +{ +if (!stream) { +return monitor_vprintf (cur_mon, fmt, ap); + } +return vfprintf (stream, fmt, ap); +} + +/* +* Print like fprintf(). +* Print to @stream if non-null, else to current monitor. +*/ +int qemu_fprintf (FILE *stream,const char *fmt, ...) +{ +va_list ap; +int ret; + +va_start (ap, fmt); + ret =qemu_vfprintf (stream, fmt, ap); +va_end (ap); +return ret; +}
Signature · 1 line
2.17.2
PATCH v2 14/17 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints
In reply to Markus ArmbrusterCPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it. Most callers pass fprintf() and stderr. log_cpu_state() passes fprintf() and qemu_log_file. hmp_info_registers() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf().
The callback gets passed around a lot, which is tiresome. The type-punning around monitor_fprintf() is ugly.
Drop the callback, and call qemu_fprintf() instead. Also gets rid of the type-punning, since qemu_fprintf() takes NULL instead of the current monitor cast to FILE *.
--- accel/kvm/kvm-all.c | 4 +- bsd-user/main.c | 2 +- cpus.c | 2 +- exec.c | 2 +- include/exec/log.h | 2 +- include/qom/cpu.h | 11 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/cpu_loop-common.h | 2 +- linux-user/cris/cpu_loop.c | 2 +- linux-user/microblaze/cpu_loop.c | 4 +- linux-user/s390x/cpu_loop.c | 4 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- monitor.c | 4 +- qom/cpu.c | 6 +- target/alpha/cpu.h | 3 +- target/alpha/helper.c | 24 +-- target/arm/arm-semi.c | 2 +- target/arm/cpu.h | 3 +- target/arm/translate-a64.c | 82 ++++----- target/arm/translate.c | 58 +++---- target/arm/translate.h | 7 +- target/cris/cpu.h | 3 +- target/cris/helper.c | 2 +- target/cris/translate.c | 36 ++-- target/hppa/cpu.h | 2 +- target/hppa/helper.c | 24 +-- target/i386/cpu.h | 3 +- target/i386/hax-all.c | 4 +- target/i386/helper.c | 277 +++++++++++++++---------------- target/lm32/cpu.h | 3 +- target/lm32/translate.c | 36 ++-- target/m68k/cpu.h | 3 +- target/m68k/translate.c | 86 +++++----- target/microblaze/cpu.h | 3 +- target/microblaze/helper.c | 2 +- target/microblaze/translate.c | 39 ++--- target/mips/internal.h | 3 +- target/mips/translate.c | 76 ++++----- target/moxie/cpu.h | 3 +- target/moxie/helper.c | 2 +- target/moxie/translate.c | 22 +-- target/nios2/cpu.h | 3 +- target/nios2/helper.c | 2 +- target/nios2/translate.c | 24 +-- target/openrisc/cpu.h | 3 +- target/openrisc/translate.c | 11 +- target/ppc/cpu.h | 3 +- target/ppc/translate.c | 161 +++++++++--------- target/riscv/cpu.c | 37 ++--- target/s390x/helper.c | 42 ++--- target/s390x/internal.h | 3 +- target/sh4/cpu.h | 3 +- target/sh4/translate.c | 27 +-- target/sparc/cpu.c | 84 +++++----- target/sparc/cpu.h | 3 +- target/tilegx/cpu.c | 14 +- target/tricore/cpu.h | 3 +- target/tricore/translate.c | 26 +-- target/unicore32/cpu.h | 3 +- target/unicore32/translate.c | 39 +++-- target/xtensa/cpu.h | 3 +- target/xtensa/translate.c | 40 ++--- 63 files changed, 682 insertions(+), 711 deletions(-)
accel/kvm/kvm-all.c +2 -2
@@ -1798,7 +1798,7 @@ static int kvm_handle_internal_error(CPUState *cpu, struct kvm_run *run)if (run->internal.suberror ==KVM_INTERNAL_ERROR_EMULATION ) {fprintf (stderr,"emulation failure\n" );if (!kvm_arch_stop_on_emulation_error (cpu)) { -cpu_dump_state (cpu, stderr, fprintf,CPU_DUMP_CODE ); +cpu_dump_state (cpu, stderr,CPU_DUMP_CODE );return EXCP_INTERRUPT ; } }
@@ -2089,7 +2089,7 @@ int kvm_cpu_exec(CPUState *cpu)qemu_mutex_lock_iothread ();if (ret <0 ) { -cpu_dump_state (cpu, stderr, fprintf,CPU_DUMP_CODE ); +cpu_dump_state (cpu, stderr,CPU_DUMP_CODE );vm_stop (RUN_STATE_INTERNAL_ERROR ); }
bsd-user/main.c +1 -1
@@ -640,7 +640,7 @@ void cpu_loop(CPUSPARCState *env) badtrap:#endif printf ("Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (1 ); }process_pending_signals (env);
cpus.c +1 -1
@@ -1010,7 +1010,7 @@ void hw_error(const char *fmt, ...)fprintf (stderr,"\n" );CPU_FOREACH (cpu) {fprintf (stderr,"CPU #%d:\n" , cpu->cpu_index); -cpu_dump_state (cpu, stderr, fprintf,CPU_DUMP_FPU ); +cpu_dump_state (cpu, stderr,CPU_DUMP_FPU ); }va_end (ap);abort ();
exec.c +1 -1
@@ -1256,7 +1256,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)fprintf (stderr,"qemu: fatal: " );vfprintf (stderr, fmt, ap);fprintf (stderr,"\n" ); -cpu_dump_state (cpu, stderr, fprintf,CPU_DUMP_FPU |CPU_DUMP_CCOP ); +cpu_dump_state (cpu, stderr,CPU_DUMP_FPU |CPU_DUMP_CCOP );if (qemu_log_separate ()) {qemu_log_lock ();qemu_log ("qemu: fatal: " );
include/exec/log.h +1 -1
@@ -16,7 +16,7 @@static inline void log_cpu_state (CPUState *cpu,int flags) {if (qemu_log_enabled ()) { -cpu_dump_state (cpu, qemu_logfile, fprintf, flags); +cpu_dump_state (cpu, qemu_logfile, flags); } }
include/qom/cpu.h +3 -8
@@ -26,7 +26,6 @@#include "exec/memattrs.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" -#include "qemu/fprintf-fn.h" #include "qemu/rcu_queue.h" #include "qemu/queue.h" #include "qemu/thread.h"
@@ -181,8 +180,7 @@ typedef struct CPUClass {bool (*virtio_is_big_endian)(CPUState *cpu);int (*memory_rw_debug)(CPUState *cpu,vaddr addr,uint8_t *buf,int len,bool is_write); -void (*dump_state)(CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void (*dump_state)(CPUState *cpu,FILE *,int flags); GuestPanicInformation* (*get_crash_info)(CPUState *cpu);void (*dump_statistics)(CPUState *cpu,int flags);int64_t (*get_arch_id)(CPUState *cpu);
@@ -563,14 +561,11 @@ enum CPUDumpFlags {/** * cpu_dump_state: * @cpu: The CPU whose state is to be dumped. -* @f: File to dump to. -* @cpu_fprintf: Function to dump with. -* @flags: Flags what to dump. +* @f: If non-null, dump to this stream, else to current print sink. * * Dumps CPU state. */ -void cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void cpu_dump_state (CPUState *cpu,FILE *f,int flags);/** * cpu_dump_statistics:
linux-user/alpha/cpu_loop.c +1 -1
@@ -193,7 +193,7 @@ void cpu_loop(CPUAlphaState *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
linux-user/cpu_loop-common.h +1 -1
@@ -26,7 +26,7 @@ do { \ CPUState *cs = ENV_GET_CPU(env); \ fprintf(stderr, fmt , ## __VA_ARGS__); \ - cpu_dump_state(cs, stderr, fprintf, 0); \ + cpu_dump_state(cs, stderr, 0); \ if (qemu_log_separate()) { \ qemu_log(fmt, ## __VA_ARGS__); \ log_cpu_state(cs, 0); \
linux-user/cris/cpu_loop.c +1 -1
@@ -74,7 +74,7 @@ void cpu_loop(CPUCRISState *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
linux-user/microblaze/cpu_loop.c +2 -2
@@ -107,7 +107,7 @@ void cpu_loop(CPUMBState *env)default :fprintf (stderr,"Unhandled hw-exception: 0x%" PRIx64"\n" , env->sregs[SR_ESR ] &ESR_EC_MASK ); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE );break ; }
@@ -123,7 +123,7 @@ void cpu_loop(CPUMBState *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
linux-user/s390x/cpu_loop.c +2 -2
@@ -124,7 +124,7 @@ void cpu_loop(CPUS390XState *env)default :fprintf (stderr,"Unhandled program exception: %#x\n" , n); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }break ;
@@ -144,7 +144,7 @@ void cpu_loop(CPUS390XState *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
linux-user/sh4/cpu_loop.c +1 -1
@@ -76,7 +76,7 @@ void cpu_loop(CPUSH4State *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
linux-user/sparc/cpu_loop.c +1 -1
@@ -278,7 +278,7 @@ void cpu_loop (CPUSPARCState *env)break ;default :fprintf (stderr,"Unhandled trap: 0x%x\n" , trapnr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );exit (EXIT_FAILURE ); }process_pending_signals (env);
monitor.c +2 -2
@@ -1296,7 +1296,7 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict)if (all_cpus) {CPU_FOREACH (cs) {monitor_printf (mon,"\nCPU#%d\n" , cs->cpu_index); -cpu_dump_state (cs, (FILE *)mon, monitor_fprintf,CPU_DUMP_FPU ); +cpu_dump_state (cs,NULL ,CPU_DUMP_FPU ); } }else { cs =mon_get_cpu ();
@@ -1306,7 +1306,7 @@ static void hmp_info_registers(Monitor *mon, const QDict *qdict)return ; } -cpu_dump_state (cs, (FILE *)mon, monitor_fprintf,CPU_DUMP_FPU ); +cpu_dump_state (cs,NULL ,CPU_DUMP_FPU ); } }
qom/cpu.c +3 -3
@@ -28,6 +28,7 @@#include "exec/log.h" #include "exec/cpu-common.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "sysemu/sysemu.h" #include "hw/boards.h" #include "hw/qdev-properties.h"
@@ -219,14 +220,13 @@ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)return res; } -void cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags) +void cpu_dump_state (CPUState *cpu,FILE *f,int flags) {CPUClass *cc =CPU_GET_CLASS (cpu);if (cc->dump_state) {cpu_synchronize_state (cpu); - cc->dump_state (cpu, f, cpu_fprintf, flags); + cc->dump_state (cpu, f, flags); } }
target/alpha/cpu.h +1 -2
@@ -311,8 +311,7 @@ extern const struct VMStateDescription vmstate_alpha_cpu;void alpha_cpu_do_interrupt (CPUState *cpu);bool alpha_cpu_exec_interrupt (CPUState *cpu,int int_req); -void alpha_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); +void alpha_cpu_dump_state (CPUState *cs,FILE *f,int flags);hwaddr alpha_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int alpha_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int alpha_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/alpha/helper.c +12 -12
@@ -23,6 +23,7 @@#include "exec/exec-all.h" #include "fpu/softfloat.h" #include "exec/helper-proto.h" +#include "qemu/qemu-print.h" #define CONVERT_BIT (X ,SRC ,DST ) \
@@ -426,8 +427,7 @@ bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)return false; } -void alpha_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void alpha_cpu_dump_state (CPUState *cs,FILE *f,int flags) {static const char *linux_reg_names[] = {"v0 " ,"t0 " ,"t1 " ,"t2 " ,"t3 " ,"t4 " ,"t5 " ,"t6 " ,
@@ -439,24 +439,24 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,CPUAlphaState *env = &cpu->env;int i; -cpu_fprintf (f," PC " TARGET_FMT_lx" PS %02x\n" , - env->pc,extract32 (env->flags,ENV_FLAG_PS_SHIFT ,8 )); +qemu_fprintf (f," PC " TARGET_FMT_lx" PS %02x\n" , + env->pc,extract32 (env->flags,ENV_FLAG_PS_SHIFT ,8 ));for (i =0 ; i <31 ; i++) { -cpu_fprintf (f,"IR%02d %s " TARGET_FMT_lx"%c" , i, - linux_reg_names[i],cpu_alpha_load_gr (env, i), - (i %3 ) ==2 ?'\n' :' ' ); +qemu_fprintf (f,"IR%02d %s " TARGET_FMT_lx"%c" , i, + linux_reg_names[i],cpu_alpha_load_gr (env, i), + (i %3 ) ==2 ?'\n' :' ' ); } -cpu_fprintf (f,"lock_a " TARGET_FMT_lx" lock_v " TARGET_FMT_lx"\n" , - env->lock_addr, env->lock_value); +qemu_fprintf (f,"lock_a " TARGET_FMT_lx" lock_v " TARGET_FMT_lx"\n" , + env->lock_addr, env->lock_value);if (flags &CPU_DUMP_FPU ) {for (i =0 ; i <31 ; i++) { -cpu_fprintf (f,"FIR%02d %016" PRIx64"%c" , i, env->fir[i], - (i %3 ) ==2 ?'\n' :' ' ); +qemu_fprintf (f,"FIR%02d %016" PRIx64"%c" , i, env->fir[i], + (i %3 ) ==2 ?'\n' :' ' ); } } -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); }/* This should only be called from translate, via gen_excp.
target/arm/arm-semi.c +1 -1
@@ -650,7 +650,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)/* fall through -- invalid for A32/T32 */ default :fprintf (stderr,"qemu: Unsupported SemiHosting SWI 0x%02x\n" , nr); -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );abort (); } }
target/arm/cpu.h +1 -2
@@ -935,8 +935,7 @@ void arm_cpu_do_interrupt(CPUState *cpu);void arm_v7m_cpu_do_interrupt (CPUState *cpu);bool arm_cpu_exec_interrupt (CPUState *cpu,int int_req); -void arm_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); +void arm_cpu_dump_state (CPUState *cs,FILE *f,int flags);hwaddr arm_cpu_get_phys_page_attrs_debug (CPUState *cpu,vaddr addr,MemTxAttrs *attrs);
target/arm/translate-a64.c +41 -41
154 lines not on this page · raw message
target/arm/translate.c +29 -29
101 lines not on this page · raw message
target/arm/translate.h +2 -5
@@ -166,8 +166,7 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn)#ifdef TARGET_AARCH64 void a64_translate_init (void );void gen_a64_set_pc_im (uint64_t val); -void aarch64_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags); +void aarch64_cpu_dump_state (CPUState *cs,FILE *f,int flags);extern const TranslatorOps aarch64_translator_ops;#else static inline void a64_translate_init (void )
@@ -178,9 +177,7 @@ static inline void gen_a64_set_pc_im(uint64_t val) { } -static inline void aarch64_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf, -int flags) +static inline void aarch64_cpu_dump_state (CPUState *cs,FILE *f,int flags) { }#endif
target/cris/cpu.h +1 -2
@@ -207,8 +207,7 @@ void cris_cpu_do_interrupt(CPUState *cpu);void crisv10_cpu_do_interrupt (CPUState *cpu);bool cris_cpu_exec_interrupt (CPUState *cpu,int int_req); -void cris_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); +void cris_cpu_dump_state (CPUState *cs,FILE *f,int flags);hwaddr cris_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);
target/cris/helper.c +1 -1
@@ -60,7 +60,7 @@ int cris_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw, cs->exception_index =0xaa ; cpu->env.pregs[PR_EDA ] = address; -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );return 1 ; }
target/cris/translate.c +18 -18
@@ -33,6 +33,7 @@#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "crisv32-decode.h" +#include "qemu/qemu-print.h" #include "exec/helper-gen.h"
@@ -3299,8 +3300,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)#endif } -void cris_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void cris_cpu_dump_state (CPUState *cs,FILE *f,int flags) {CRISCPU *cpu =CRIS_CPU (cs);CPUCRISState *env = &cpu->env;
@@ -3308,7 +3308,7 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,const char **pregnames;int i; -if (!env || !f) { +if (!env) {return ; }if (env->pregs[PR_VR ] <32 ) {
@@ -3319,40 +3319,40 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, regnames = regnames_v32; } -cpu_fprintf (f,"PC=%x CCS=%x btaken=%d btarget=%x\n" -"cc_op=%d cc_src=%d cc_dest=%d cc_result=%x cc_mask=%x\n" , - env->pc, env->pregs[PR_CCS ], env->btaken, env->btarget, - env->cc_op, - env->cc_src, env->cc_dest, env->cc_result, env->cc_mask); +qemu_fprintf (f,"PC=%x CCS=%x btaken=%d btarget=%x\n" +"cc_op=%d cc_src=%d cc_dest=%d cc_result=%x cc_mask=%x\n" , + env->pc, env->pregs[PR_CCS ], env->btaken, env->btarget, + env->cc_op, + env->cc_src, env->cc_dest, env->cc_result, env->cc_mask);for (i =0 ; i <16 ; i++) { -cpu_fprintf (f,"%s=%8.8x " , regnames[i], env->regs[i]); +qemu_fprintf (f,"%s=%8.8x " , regnames[i], env->regs[i]);if ((i +1 ) %4 ==0 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } } -cpu_fprintf (f,"\nspecial regs:\n" ); +qemu_fprintf (f,"\nspecial regs:\n" );for (i =0 ; i <16 ; i++) { -cpu_fprintf (f,"%s=%8.8x " , pregnames[i], env->pregs[i]); +qemu_fprintf (f,"%s=%8.8x " , pregnames[i], env->pregs[i]);if ((i +1 ) %4 ==0 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } }if (env->pregs[PR_VR ] >=32 ) {uint32_t srs = env->pregs[PR_SRS ]; -cpu_fprintf (f,"\nsupport function regs bank %x:\n" , srs); +qemu_fprintf (f,"\nsupport function regs bank %x:\n" , srs);if (srs <ARRAY_SIZE (env->sregs)) {for (i =0 ; i <16 ; i++) { -cpu_fprintf (f,"s%2.2d=%8.8x " , - i, env->sregs[srs][i]); +qemu_fprintf (f,"s%2.2d=%8.8x " , + i, env->sregs[srs][i]);if ((i +1 ) %4 ==0 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } } } } -cpu_fprintf (f,"\n\n" ); +qemu_fprintf (f,"\n\n" ); }
target/hppa/cpu.h +1 -1
@@ -359,7 +359,7 @@ int hppa_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);int hppa_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);void hppa_cpu_do_interrupt (CPUState *cpu);bool hppa_cpu_exec_interrupt (CPUState *cpu,int int_req); -void hppa_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function ,int ); +void hppa_cpu_dump_state (CPUState *cs,FILE *f,int );#ifdef CONFIG_USER_ONLY int hppa_cpu_handle_mmu_fault (CPUState *cpu,vaddr address,int size,int rw,int midx);
target/hppa/helper.c +12 -12
@@ -23,6 +23,7 @@#include "fpu/softfloat.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "qemu/qemu-print.h" target_ureg cpu_hppa_get_psw (CPUHPPAState *env) {
@@ -76,8 +77,7 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) } } -void hppa_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void hppa_cpu_dump_state (CPUState *cs,FILE *f,int flags) {HPPACPU *cpu =HPPA_CPU (cs);CPUHPPAState *env = &cpu->env;
@@ -86,9 +86,9 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f,char psw_c[20 ];int i; -cpu_fprintf (f,"IA_F " TARGET_FMT_lx" IA_B " TARGET_FMT_lx"\n" , -hppa_form_gva_psw (psw, env->iasq_f, env->iaoq_f), -hppa_form_gva_psw (psw, env->iasq_b, env->iaoq_b)); +qemu_fprintf (f,"IA_F " TARGET_FMT_lx" IA_B " TARGET_FMT_lx"\n" , +hppa_form_gva_psw (psw, env->iasq_f, env->iaoq_f), +hppa_form_gva_psw (psw, env->iasq_b, env->iaoq_b)); psw_c[0 ] = (psw &PSW_W ?'W' :'-' ); psw_c[1 ] = (psw &PSW_E ?'E' :'-' );
@@ -111,20 +111,20 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, psw_c[18 ] ='\0' ; psw_cb = ((env->psw_cb >>4 ) &0x01111111 ) | (env->psw_cb_msb <<28 ); -cpu_fprintf (f,"PSW " TREG_FMT_lx" CB " TREG_FMT_lx" %s\n" , - psw, psw_cb, psw_c); +qemu_fprintf (f,"PSW " TREG_FMT_lx" CB " TREG_FMT_lx" %s\n" , + psw, psw_cb, psw_c);for (i =0 ; i <32 ; i++) { -cpu_fprintf (f,"GR%02d " TREG_FMT_lx"%c" , i, env->gr[i], - (i &3 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f,"GR%02d " TREG_FMT_lx"%c" , i, env->gr[i], + (i &3 ) ==3 ?'\n' :' ' ); }#ifndef CONFIG_USER_ONLY for (i =0 ; i <8 ; i++) { -cpu_fprintf (f,"SR%02d %08x%c" , i, (uint32_t )(env->sr[i] >>32 ), - (i &3 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f,"SR%02d %08x%c" , i, (uint32_t )(env->sr[i] >>32 ), + (i &3 ) ==3 ?'\n' :' ' ); }#endif -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" );/* ??? FR */ }
target/i386/cpu.h +1 -2
@@ -1521,8 +1521,7 @@ int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,void x86_cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list,Error **errp); -void x86_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); +void x86_cpu_dump_state (CPUState *cs,FILE *f,int flags);hwaddr x86_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);
target/i386/hax-all.c +2 -2
@@ -540,7 +540,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) ht->_exit_reason);qemu_system_reset_request (SHUTDOWN_CAUSE_GUEST_RESET );hax_vcpu_sync_state (env,0 ); -cpu_dump_state (cpu, stderr, fprintf,0 ); +cpu_dump_state (cpu, stderr,0 ); ret =-1 ;break ;case HAX_EXIT_HLT :
@@ -571,7 +571,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env)fprintf (stderr,"Unknown exit %x from HAX\n" , ht->_exit_status);qemu_system_reset_request (SHUTDOWN_CAUSE_GUEST_RESET );hax_vcpu_sync_state (env,0 ); -cpu_dump_state (cpu, stderr, fprintf,0 ); +cpu_dump_state (cpu, stderr,0 ); ret =1 ;break ; }
target/i386/helper.c +138 -139
378 lines not on this page · raw message
target/lm32/cpu.h +1 -2
@@ -219,8 +219,7 @@ extern const struct VMStateDescription vmstate_lm32_cpu;void lm32_cpu_do_interrupt (CPUState *cpu);bool lm32_cpu_exec_interrupt (CPUState *cs,int int_req); -void lm32_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void lm32_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr lm32_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int lm32_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int lm32_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/lm32/translate.c +18 -18
@@ -24,6 +24,7 @@#include "exec/exec-all.h" #include "exec/translator.h" #include "tcg-op.h" +#include "qemu/qemu-print.h" #include "exec/cpu_ldst.h" #include "hw/lm32/lm32_pic.h"
@@ -1161,38 +1162,37 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)#endif } -void lm32_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void lm32_cpu_dump_state (CPUState *cs,FILE *f,int flags) {LM32CPU *cpu =LM32_CPU (cs);CPULM32State *env = &cpu->env;int i; -if (!env || !f) { +if (!env) {return ; } -cpu_fprintf (f,"IN: PC=%x %s\n" , - env->pc,lookup_symbol (env->pc)); +qemu_fprintf (f,"IN: PC=%x %s\n" , + env->pc,lookup_symbol (env->pc)); -cpu_fprintf (f,"ie=%8.8x (IE=%x EIE=%x BIE=%x) im=%8.8x ip=%8.8x\n" , - env->ie, - (env->ie &IE_IE ) ?1 :0 , - (env->ie &IE_EIE ) ?1 :0 , - (env->ie &IE_BIE ) ?1 :0 , -lm32_pic_get_im (env->pic_state), -lm32_pic_get_ip (env->pic_state)); -cpu_fprintf (f,"eba=%8.8x deba=%8.8x\n" , - env->eba, - env->deba); +qemu_fprintf (f,"ie=%8.8x (IE=%x EIE=%x BIE=%x) im=%8.8x ip=%8.8x\n" , + env->ie, + (env->ie &IE_IE ) ?1 :0 , + (env->ie &IE_EIE ) ?1 :0 , + (env->ie &IE_BIE ) ?1 :0 , +lm32_pic_get_im (env->pic_state), +lm32_pic_get_ip (env->pic_state)); +qemu_fprintf (f,"eba=%8.8x deba=%8.8x\n" , + env->eba, + env->deba);for (i =0 ; i <32 ; i++) { -cpu_fprintf (f,"r%2.2d=%8.8x " , i, env->regs[i]); +qemu_fprintf (f,"r%2.2d=%8.8x " , i, env->regs[i]);if ((i +1 ) %4 ==0 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } } -cpu_fprintf (f,"\n\n" ); +qemu_fprintf (f,"\n\n" ); } void restore_state_to_opc(CPULM32State *env, TranslationBlock *tb,
target/m68k/cpu.h +1 -2
@@ -179,8 +179,7 @@ static inline M68kCPU *m68k_env_get_cpu(CPUM68KState *env)void m68k_cpu_do_interrupt (CPUState *cpu);bool m68k_cpu_exec_interrupt (CPUState *cpu,int int_req); -void m68k_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void m68k_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr m68k_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int m68k_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int m68k_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/m68k/translate.c +43 -43
125 lines not on this page · raw message
target/microblaze/cpu.h +1 -2
@@ -328,8 +328,7 @@ static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env)void mb_cpu_do_interrupt (CPUState *cs);bool mb_cpu_exec_interrupt (CPUState *cs,int int_req); -void mb_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void mb_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr mb_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int mb_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int mb_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/microblaze/helper.c +1 -1
@@ -42,7 +42,7 @@ int mb_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw, int mmu_idx) { cs->exception_index =0xaa ; -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );return 1 ; }
target/microblaze/translate.c +20 -19
@@ -28,6 +28,7 @@#include "exec/cpu_ldst.h" #include "exec/helper-gen.h" #include "exec/translator.h" +#include "qemu/qemu-print.h" #include "trace-tcg.h" #include "exec/log.h"
@@ -1785,36 +1786,36 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)assert (!dc->abort_at_next_insn); } -void mb_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void mb_cpu_dump_state (CPUState *cs,FILE *f,int flags) {MicroBlazeCPU *cpu =MICROBLAZE_CPU (cs);CPUMBState *env = &cpu->env;int i; -if (!env || !f) +if (!env) {return ; + } -cpu_fprintf (f,"IN: PC=%" PRIx64" %s\n" , - env->sregs[SR_PC ],lookup_symbol (env->sregs[SR_PC ])); -cpu_fprintf (f,"rmsr=%" PRIx64" resr=%" PRIx64" rear=%" PRIx64" " -"debug=%x imm=%x iflags=%x fsr=%" PRIx64"\n" , - env->sregs[SR_MSR ], env->sregs[SR_ESR ], env->sregs[SR_EAR ], - env->debug, env->imm, env->iflags, env->sregs[SR_FSR ]); -cpu_fprintf (f,"btaken=%d btarget=%" PRIx64" mode=%s(saved=%s) " -"eip=%d ie=%d\n" , - env->btaken, env->btarget, - (env->sregs[SR_MSR ] &MSR_UM ) ?"user" :"kernel" , - (env->sregs[SR_MSR ] &MSR_UMS ) ?"user" :"kernel" , - (bool )(env->sregs[SR_MSR ] &MSR_EIP ), - (bool )(env->sregs[SR_MSR ] &MSR_IE )); +qemu_fprintf (f,"IN: PC=%" PRIx64" %s\n" , + env->sregs[SR_PC ],lookup_symbol (env->sregs[SR_PC ])); +qemu_fprintf (f,"rmsr=%" PRIx64" resr=%" PRIx64" rear=%" PRIx64" " +"debug=%x imm=%x iflags=%x fsr=%" PRIx64"\n" , + env->sregs[SR_MSR ], env->sregs[SR_ESR ], env->sregs[SR_EAR ], + env->debug, env->imm, env->iflags, env->sregs[SR_FSR ]); +qemu_fprintf (f,"btaken=%d btarget=%" PRIx64" mode=%s(saved=%s) " +"eip=%d ie=%d\n" , + env->btaken, env->btarget, + (env->sregs[SR_MSR ] &MSR_UM ) ?"user" :"kernel" , + (env->sregs[SR_MSR ] &MSR_UMS ) ?"user" :"kernel" , + (bool )(env->sregs[SR_MSR ] &MSR_EIP ), + (bool )(env->sregs[SR_MSR ] &MSR_IE ));for (i =0 ; i <32 ; i++) { -cpu_fprintf (f,"r%2.2d=%8.8x " , i, env->regs[i]); +qemu_fprintf (f,"r%2.2d=%8.8x " , i, env->regs[i]);if ((i +1 ) %4 ==0 ) -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } -cpu_fprintf (f,"\n\n" ); +qemu_fprintf (f,"\n\n" ); }void mb_tcg_init (void )
target/mips/internal.h +1 -2
@@ -76,8 +76,7 @@ enum CPUMIPSMSADataFormat {void mips_cpu_do_interrupt (CPUState *cpu);bool mips_cpu_exec_interrupt (CPUState *cpu,int int_req); -void mips_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void mips_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr mips_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int mips_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int mips_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/mips/translate.c +38 -38
114 lines not on this page · raw message
target/moxie/cpu.h +1 -2
@@ -112,8 +112,7 @@ static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)#define ENV_OFFSET offsetof(MoxieCPU, env)void moxie_cpu_do_interrupt (CPUState *cs); -void moxie_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void moxie_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr moxie_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);void moxie_translate_init (void ); int cpu_moxie_signal_handler(int host_signum, void *pinfo,
target/moxie/helper.c +1 -1
@@ -101,7 +101,7 @@ int moxie_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, cs->exception_index =0xaa ; cpu->env.debug1 = address; -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 );return 1 ; }
target/moxie/translate.c +11 -11
@@ -28,6 +28,7 @@#include "disas/disas.h" #include "tcg-op.h" #include "exec/cpu_ldst.h" +#include "qemu/qemu-print.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
@@ -69,24 +70,23 @@ static int extract_branch_offset(int opcode)return (((signed short )((opcode & ((1 <<10 ) -1 )) <<6 )) >>6 ) <<1 ; } -void moxie_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void moxie_cpu_dump_state (CPUState *cs,FILE *f,int flags) {MoxieCPU *cpu =MOXIE_CPU (cs);CPUMoxieState *env = &cpu->env;int i; -cpu_fprintf (f,"pc=0x%08x\n" , env->pc); -cpu_fprintf (f,"$fp=0x%08x $sp=0x%08x $r0=0x%08x $r1=0x%08x\n" , - env->gregs[0 ], env->gregs[1 ], env->gregs[2 ], env->gregs[3 ]); +qemu_fprintf (f,"pc=0x%08x\n" , env->pc); +qemu_fprintf (f,"$fp=0x%08x $sp=0x%08x $r0=0x%08x $r1=0x%08x\n" , + env->gregs[0 ], env->gregs[1 ], env->gregs[2 ], env->gregs[3 ]);for (i =4 ; i <16 ; i +=4 ) { -cpu_fprintf (f,"$r%d=0x%08x $r%d=0x%08x $r%d=0x%08x $r%d=0x%08x\n" , - i-2 , env->gregs[i], i-1 , env->gregs[i +1 ], - i, env->gregs[i +2 ], i+1 , env->gregs[i +3 ]); +qemu_fprintf (f,"$r%d=0x%08x $r%d=0x%08x $r%d=0x%08x $r%d=0x%08x\n" , + i -2 , env->gregs[i], i -1 , env->gregs[i +1 ], + i, env->gregs[i +2 ], i +1 , env->gregs[i +3 ]); }for (i =4 ; i <16 ; i +=4 ) { -cpu_fprintf (f,"sr%d=0x%08x sr%d=0x%08x sr%d=0x%08x sr%d=0x%08x\n" , - i-2 , env->sregs[i], i-1 , env->sregs[i +1 ], - i, env->sregs[i +2 ], i+1 , env->sregs[i +3 ]); +qemu_fprintf (f,"sr%d=0x%08x sr%d=0x%08x sr%d=0x%08x sr%d=0x%08x\n" , + i -2 , env->sregs[i], i -1 , env->sregs[i +1 ], + i, env->sregs[i +2 ], i +1 , env->sregs[i +3 ]); } }
target/nios2/cpu.h +1 -2
@@ -213,8 +213,7 @@ void nios2_tcg_init(void);void nios2_cpu_do_interrupt (CPUState *cs);int cpu_nios2_signal_handler (int host_signum,void *pinfo,void *puc);void dump_mmu (CPUNios2State *env); -void nios2_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void nios2_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr nios2_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type,
target/nios2/helper.c +1 -1
@@ -42,7 +42,7 @@ int nios2_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, cs->exception_index =0xaa ;/* Page 0x1000 is kuser helper */ if (address <0x1000 || address >=0x2000 ) { -cpu_dump_state (cs, stderr, fprintf,0 ); +cpu_dump_state (cs, stderr,0 ); }return 1 ; }
target/nios2/translate.c +12 -12
@@ -31,6 +31,7 @@#include "exec/log.h" #include "exec/cpu_ldst.h" #include "exec/translator.h" +#include "qemu/qemu-print.h" /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0/* only pc was modified dynamically */
@@ -914,33 +915,32 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)#endif } -void nios2_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags) +void nios2_cpu_dump_state (CPUState *cs,FILE *f,int flags) {Nios2CPU *cpu =NIOS2_CPU (cs);CPUNios2State *env = &cpu->env;int i; -if (!env || !f) { +if (!env) {return ; } -cpu_fprintf (f,"IN: PC=%x %s\n" , - env->regs[R_PC ],lookup_symbol (env->regs[R_PC ])); +qemu_fprintf (f,"IN: PC=%x %s\n" , + env->regs[R_PC ],lookup_symbol (env->regs[R_PC ]));for (i =0 ; i <NUM_CORE_REGS ; i++) { -cpu_fprintf (f,"%9s=%8.8x " , regnames[i], env->regs[i]); +qemu_fprintf (f,"%9s=%8.8x " , regnames[i], env->regs[i]);if ((i +1 ) %4 ==0 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } }#if !defined(CONFIG_USER_ONLY ) -cpu_fprintf (f," mmu write: VPN=%05X PID %02X TLBACC %08X\n" , - env->mmu.pteaddr_wr &CR_PTEADDR_VPN_MASK , - (env->mmu.tlbmisc_wr &CR_TLBMISC_PID_MASK ) >>4 , - env->mmu.tlbacc_wr); +qemu_fprintf (f," mmu write: VPN=%05X PID %02X TLBACC %08X\n" , + env->mmu.pteaddr_wr &CR_PTEADDR_VPN_MASK , + (env->mmu.tlbmisc_wr &CR_TLBMISC_PID_MASK ) >>4 , + env->mmu.tlbacc_wr);#endif -cpu_fprintf (f,"\n\n" ); +qemu_fprintf (f,"\n\n" ); }void nios2_tcg_init (void )
target/openrisc/cpu.h +1 -2
@@ -339,8 +339,7 @@ static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env)void cpu_openrisc_list (void );void openrisc_cpu_do_interrupt (CPUState *cpu);bool openrisc_cpu_exec_interrupt (CPUState *cpu,int int_req); -void openrisc_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void openrisc_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr openrisc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int openrisc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int openrisc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/openrisc/translate.c +5 -6
@@ -26,6 +26,7 @@#include "qemu-common.h" #include "qemu/log.h" #include "qemu/bitops.h" +#include "qemu/qemu-print.h" #include "exec/cpu_ldst.h" #include "exec/translator.h"
@@ -1415,18 +1416,16 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)translator_loop (&openrisc_tr_ops, &ctx.base, cs, tb); } -void openrisc_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf, -int flags) +void openrisc_cpu_dump_state (CPUState *cs,FILE *f,int flags) {OpenRISCCPU *cpu =OPENRISC_CPU (cs);CPUOpenRISCState *env = &cpu->env;int i; -cpu_fprintf (f,"PC=%08x\n" , env->pc); +qemu_fprintf (f,"PC=%08x\n" , env->pc);for (i =0 ; i <32 ; ++i) { -cpu_fprintf (f,"R%02d=%08x%c" , i,cpu_get_gpr (env, i), - (i %4 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f,"R%02d=%08x%c" , i,cpu_get_gpr (env, i), + (i %4 ) ==3 ?'\n' :' ' ); } }
target/ppc/cpu.h +1 -2
@@ -1268,8 +1268,7 @@ struct PPCVirtualHypervisorClass {void ppc_cpu_do_interrupt (CPUState *cpu);bool ppc_cpu_exec_interrupt (CPUState *cpu,int int_req); -void ppc_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void ppc_cpu_dump_state (CPUState *cpu,FILE *f,int flags);void ppc_cpu_dump_statistics (CPUState *cpu,int flags);hwaddr ppc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int ppc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);
target/ppc/translate.c +80 -81
240 lines not on this page · raw message
target/riscv/cpu.c +18 -19
@@ -194,40 +194,39 @@ static ObjectClass *riscv_cpu_class_by_name(const char *cpu_model)return oc; } -static void riscv_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +static void riscv_cpu_dump_state (CPUState *cs,FILE *f,int flags) {RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env;int i; -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"pc " , env->pc); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"pc " , env->pc);#ifndef CONFIG_USER_ONLY -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mhartid " , env->mhartid); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mstatus " , env->mstatus); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mip " , - (target_ulong )atomic_read (&env->mip)); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mie " , env->mie); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mideleg " , env->mideleg); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"medeleg " , env->medeleg); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtvec " , env->mtvec); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mepc " , env->mepc); -cpu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mcause " , env->mcause); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mhartid " , env->mhartid); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mstatus " , env->mstatus); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mip " , + (target_ulong )atomic_read (&env->mip)); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mie " , env->mie); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mideleg " , env->mideleg); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"medeleg " , env->medeleg); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtvec " , env->mtvec); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mepc " , env->mepc); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mcause " , env->mcause);#endif for (i =0 ; i <32 ; i++) { -cpu_fprintf (f," %s " TARGET_FMT_lx, - riscv_int_regnames[i], env->gpr[i]); +qemu_fprintf (f," %s " TARGET_FMT_lx, + riscv_int_regnames[i], env->gpr[i]);if ((i &3 ) ==3 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } }if (flags &CPU_DUMP_FPU ) {for (i =0 ; i <32 ; i++) { -cpu_fprintf (f," %s %016" PRIx64, - riscv_fpr_regnames[i], env->fpr[i]); +qemu_fprintf (f," %s %016" PRIx64, + riscv_fpr_regnames[i], env->fpr[i]);if ((i &3 ) ==3 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); } } }
target/s390x/helper.c +21 -21
92 lines not on this page · raw message
target/s390x/internal.h +1 -2
@@ -292,8 +292,7 @@ void s390_cpu_gdb_init(CPUState *cs);/* helper.c */ -void s390_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); +void s390_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr s390_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);hwaddr s390_cpu_get_phys_addr_debug (CPUState *cpu,vaddr addr);uint64_t get_psw_mask (CPUS390XState *env);
target/sh4/cpu.h +1 -2
@@ -232,8 +232,7 @@ static inline SuperHCPU *sh_env_get_cpu(CPUSH4State *env)void superh_cpu_do_interrupt (CPUState *cpu);bool superh_cpu_exec_interrupt (CPUState *cpu,int int_req); -void superh_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void superh_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr superh_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int superh_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int superh_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/sh4/translate.c +14 -13
@@ -30,6 +30,7 @@#include "exec/translator.h" #include "trace-tcg.h" #include "exec/log.h" +#include "qemu/qemu-print.h" typedef struct DisasContext {
@@ -156,32 +157,32 @@ void sh4_translate_init(void) fregnames[i]); } -void superh_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void superh_cpu_dump_state (CPUState *cs,FILE *f,int flags) {SuperHCPU *cpu =SUPERH_CPU (cs);CPUSH4State *env = &cpu->env;int i; -cpu_fprintf (f,"pc=0x%08x sr=0x%08x pr=0x%08x fpscr=0x%08x\n" , - env->pc,cpu_read_sr (env), env->pr, env->fpscr); -cpu_fprintf (f,"spc=0x%08x ssr=0x%08x gbr=0x%08x vbr=0x%08x\n" , - env->spc, env->ssr, env->gbr, env->vbr); -cpu_fprintf (f,"sgr=0x%08x dbr=0x%08x delayed_pc=0x%08x fpul=0x%08x\n" , - env->sgr, env->dbr, env->delayed_pc, env->fpul); + +qemu_fprintf (f,"pc=0x%08x sr=0x%08x pr=0x%08x fpscr=0x%08x\n" , + env->pc,cpu_read_sr (env), env->pr, env->fpscr); +qemu_fprintf (f,"spc=0x%08x ssr=0x%08x gbr=0x%08x vbr=0x%08x\n" , + env->spc, env->ssr, env->gbr, env->vbr); +qemu_fprintf (f,"sgr=0x%08x dbr=0x%08x delayed_pc=0x%08x fpul=0x%08x\n" , + env->sgr, env->dbr, env->delayed_pc, env->fpul);for (i =0 ; i <24 ; i +=4 ) { -cpu_fprintf (f,"r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , +qemu_printf ("r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , i, env->gregs[i], i +1 , env->gregs[i +1 ], i +2 , env->gregs[i +2 ], i +3 , env->gregs[i +3 ]); }if (env->flags &DELAY_SLOT ) { -cpu_fprintf (f,"in delay slot (delayed_pc=0x%08x)\n" , +qemu_printf ("in delay slot (delayed_pc=0x%08x)\n" , env->delayed_pc); }else if (env->flags &DELAY_SLOT_CONDITIONAL ) { -cpu_fprintf (f,"in conditional delay slot (delayed_pc=0x%08x)\n" , +qemu_printf ("in conditional delay slot (delayed_pc=0x%08x)\n" , env->delayed_pc); }else if (env->flags &DELAY_SLOT_RTE ) { -cpu_fprintf (f,"in rte delay slot (delayed_pc=0x%08x)\n" , - env->delayed_pc); +qemu_fprintf (f,"in rte delay slot (delayed_pc=0x%08x)\n" , + env->delayed_pc); } }
target/sparc/cpu.c +41 -43
130 lines not on this page · raw message
target/sparc/cpu.h +1 -2
@@ -564,8 +564,7 @@ extern const struct VMStateDescription vmstate_sparc_cpu;#endif void sparc_cpu_do_interrupt (CPUState *cpu); -void sparc_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void sparc_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr sparc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);int sparc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg);int sparc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
target/tilegx/cpu.c +7 -7
@@ -24,9 +24,9 @@#include "qemu-common.h" #include "hw/qdev-properties.h" #include "linux-user/syscall_defs.h" +#include "qemu/qemu-print.h" -static void tilegx_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +static void tilegx_cpu_dump_state (CPUState *cs,FILE *f,int flags) {static const char *const reg_names[TILEGX_R_COUNT ] = {"r0" ,"r1" ,"r2" ,"r3" ,"r4" ,"r5" ,"r6" ,"r7" ,
@@ -43,12 +43,12 @@ static void tilegx_cpu_dump_state(CPUState *cs, FILE *f,int i;for (i =0 ; i <TILEGX_R_COUNT ; i++) { -cpu_fprintf (f,"%-4s" TARGET_FMT_lx"%s" , - reg_names[i], env->regs[i], - (i %4 ) ==3 ?"\n" :" " ); +qemu_fprintf (f,"%-4s" TARGET_FMT_lx"%s" , + reg_names[i], env->regs[i], + (i %4 ) ==3 ?"\n" :" " ); } -cpu_fprintf (f,"PC " TARGET_FMT_lx" CEX " TARGET_FMT_lx"\n\n" , - env->pc, env->spregs[TILEGX_SPR_CMPEXCH ]); +qemu_fprintf (f,"PC " TARGET_FMT_lx" CEX " TARGET_FMT_lx"\n\n" , + env->pc, env->spregs[TILEGX_SPR_CMPEXCH ]); }static ObjectClass *tilegx_cpu_class_by_name (const char *cpu_model)
target/tricore/cpu.h +1 -2
@@ -224,8 +224,7 @@ static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)#define ENV_OFFSET offsetof(TriCoreCPU, env)hwaddr tricore_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -void tricore_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void tricore_cpu_dump_state (CPUState *cpu,FILE *f,int flags);#define MASK_PCXI_PCPN 0xff000000
target/tricore/translate.c +13 -13
@@ -24,6 +24,7 @@#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h" +#include "qemu/qemu-print.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
@@ -88,8 +89,7 @@ enum { MODE_UU = 3, }; -void tricore_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void tricore_cpu_dump_state (CPUState *cs,FILE *f,int flags) {TriCoreCPU *cpu =TRICORE_CPU (cs);CPUTriCoreState *env = &cpu->env;
@@ -98,26 +98,26 @@ void tricore_cpu_dump_state(CPUState *cs, FILE *f, psw =psw_read (env); -cpu_fprintf (f,"PC: " TARGET_FMT_lx, env->PC); -cpu_fprintf (f," PSW: " TARGET_FMT_lx, psw); -cpu_fprintf (f," ICR: " TARGET_FMT_lx, env->ICR); -cpu_fprintf (f,"\nPCXI: " TARGET_FMT_lx, env->PCXI); -cpu_fprintf (f," FCX: " TARGET_FMT_lx, env->FCX); -cpu_fprintf (f," LCX: " TARGET_FMT_lx, env->LCX); +qemu_fprintf (f,"PC: " TARGET_FMT_lx, env->PC); +qemu_fprintf (f," PSW: " TARGET_FMT_lx, psw); +qemu_fprintf (f," ICR: " TARGET_FMT_lx, env->ICR); +qemu_fprintf (f,"\nPCXI: " TARGET_FMT_lx, env->PCXI); +qemu_fprintf (f," FCX: " TARGET_FMT_lx, env->FCX); +qemu_fprintf (f," LCX: " TARGET_FMT_lx, env->LCX);for (i =0 ; i <16 ; ++i) {if ((i &3 ) ==0 ) { -cpu_fprintf (f,"\nGPR A%02d:" , i); +qemu_fprintf (f,"\nGPR A%02d:" , i); } -cpu_fprintf (f," " TARGET_FMT_lx, env->gpr_a[i]); +qemu_fprintf (f," " TARGET_FMT_lx, env->gpr_a[i]); }for (i =0 ; i <16 ; ++i) {if ((i &3 ) ==0 ) { -cpu_fprintf (f,"\nGPR D%02d:" , i); +qemu_fprintf (f,"\nGPR D%02d:" , i); } -cpu_fprintf (f," " TARGET_FMT_lx, env->gpr_d[i]); +qemu_fprintf (f," " TARGET_FMT_lx, env->gpr_d[i]); } -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); }/*
target/unicore32/cpu.h +1 -2
@@ -97,8 +97,7 @@ static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env)void uc32_cpu_do_interrupt (CPUState *cpu);bool uc32_cpu_exec_interrupt (CPUState *cpu,int int_req); -void uc32_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void uc32_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr uc32_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);#define ASR_M (0x1f)
target/unicore32/translate.c +19 -20
@@ -17,6 +17,7 @@#include "qemu/log.h" #include "exec/cpu_ldst.h" #include "exec/translator.h" +#include "qemu/qemu-print.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
@@ -2043,8 +2044,7 @@ static const char *cpu_mode_names[16] = {#undef UCF64_DUMP_STATE#ifdef UCF64_DUMP_STATE -static void cpu_dump_state_ucf64 (CPUUniCore32State *env,FILE *f, -fprintf_function cpu_fprintf,int flags) +static void cpu_dump_state_ucf64 (CPUUniCore32State *env,int flags) {int i; union {
@@ -2064,20 +2064,19 @@ static void cpu_dump_state_ucf64(CPUUniCore32State *env, FILE *f, s0.i = d.l.lower; s1.i = d.l.upper; d0.f64 = d.d; -cpu_fprintf (f,"s%02d=%08x(%8g) s%02d=%08x(%8g)" , - i *2 , (int )s0.i, s0.s, - i *2 +1 , (int )s1.i, s1.s); -cpu_fprintf (f," d%02d=%" PRIx64"(%8g)\n" , - i, (uint64_t)d0.f64, d0.d); +qemu_fprintf (f,"s%02d=%08x(%8g) s%02d=%08x(%8g)" , + i *2 , (int )s0.i, s0.s, + i *2 +1 , (int )s1.i, s1.s); +qemu_fprintf (f," d%02d=%" PRIx64"(%8g)\n" , + i, (uint64_t)d0.f64, d0.d); } -cpu_fprintf (f,"FPSCR: %08x\n" , (int )env->ucf64.xregs[UC32_UCF64_FPSCR ]); +qemu_fprintf (f,"FPSCR: %08x\n" , (int )env->ucf64.xregs[UC32_UCF64_FPSCR ]); }#else #define cpu_dump_state_ucf64 (env, file, pr, flags) do { } while (0)#endif -void uc32_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void uc32_cpu_dump_state (CPUState *cs,FILE *f,int flags) {UniCore32CPU *cpu =UNICORE32_CPU (cs);CPUUniCore32State *env = &cpu->env;
@@ -2085,21 +2084,21 @@ void uc32_cpu_dump_state(CPUState *cs, FILE *f,uint32_t psr;for (i =0 ; i <32 ; i++) { -cpu_fprintf (f,"R%02d=%08x" , i, env->regs[i]); +qemu_fprintf (f,"R%02d=%08x" , i, env->regs[i]);if ((i %4 ) ==3 ) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" ); }else { -cpu_fprintf (f," " ); +qemu_fprintf (f," " ); } } psr =cpu_asr_read (env); -cpu_fprintf (f,"PSR=%08x %c%c%c%c %s\n" , - psr, - psr & (1 <<31 ) ?'N' :'-' , - psr & (1 <<30 ) ?'Z' :'-' , - psr & (1 <<29 ) ?'C' :'-' , - psr & (1 <<28 ) ?'V' :'-' , - cpu_mode_names[psr &0xf ]); +qemu_fprintf (f,"PSR=%08x %c%c%c%c %s\n" , + psr, + psr & (1 <<31 ) ?'N' :'-' , + psr & (1 <<30 ) ?'Z' :'-' , + psr & (1 <<29 ) ?'C' :'-' , + psr & (1 <<28 ) ?'V' :'-' , + cpu_mode_names[psr &0xf ]);if (flags &CPU_DUMP_FPU ) {cpu_dump_state_ucf64 (env, f, cpu_fprintf, flags);
target/xtensa/cpu.h +1 -2
@@ -560,8 +560,7 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); -void xtensa_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); +void xtensa_cpu_dump_state (CPUState *cpu,FILE *f,int flags);hwaddr xtensa_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);void xtensa_count_regs (const XtensaConfig *config,unsigned *n_regs,unsigned *n_core_regs);
target/xtensa/translate.c +21 -19
@@ -35,6 +35,7 @@#include "disas/disas.h" #include "tcg-op.h" #include "qemu/log.h" +#include "qemu/qemu-print.h" #include "sysemu/sysemu.h" #include "exec/cpu_ldst.h" #include "exec/semihost.h"
@@ -1640,60 +1641,61 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb)translator_loop (&xtensa_translator_ops, &dc.base, cpu, tb); } -void xtensa_cpu_dump_state (CPUState *cs,FILE *f, -fprintf_function cpu_fprintf,int flags) +void xtensa_cpu_dump_state (CPUState *cs,FILE *f,int flags) {XtensaCPU *cpu =XTENSA_CPU (cs);CPUXtensaState *env = &cpu->env;int i, j; -cpu_fprintf (f,"PC=%08x\n\n" , env->pc); +qemu_fprintf (f,"PC=%08x\n\n" , env->pc);for (i = j =0 ; i <256 ; ++i) {if (xtensa_option_bits_enabled (env->config, sregnames[i].opt_bits)) { -cpu_fprintf (f,"%12s=%08x%c" , sregnames[i].name, env->sregs[i], - (j++ %4 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f,"%12s=%08x%c" , + sregnames[i].name, env->sregs[i], + (j++ %4 ) ==3 ?'\n' :' ' ); } } -cpu_fprintf (f, (j %4 ) ==0 ?"\n" :"\n\n" ); +qemu_fprintf (f, (j %4 ) ==0 ?"\n" :"\n\n" );for (i = j =0 ; i <256 ; ++i) {if (xtensa_option_bits_enabled (env->config, uregnames[i].opt_bits)) { -cpu_fprintf (f,"%s=%08x%c" , uregnames[i].name, env->uregs[i], - (j++ %4 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f,"%s=%08x%c" , + uregnames[i].name, env->uregs[i], + (j++ %4 ) ==3 ?'\n' :' ' ); } } -cpu_fprintf (f, (j %4 ) ==0 ?"\n" :"\n\n" ); +qemu_fprintf (f, (j %4 ) ==0 ?"\n" :"\n\n" );for (i =0 ; i <16 ; ++i) { -cpu_fprintf (f," A%02d=%08x%c" , i, env->regs[i], - (i %4 ) ==3 ?'\n' :' ' ); +qemu_fprintf (f," A%02d=%08x%c" , + i, env->regs[i], (i %4 ) ==3 ?'\n' :' ' ); }xtensa_sync_phys_from_window (env); -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" );for (i =0 ; i < env->config->nareg; ++i) { -cpu_fprintf (f,"AR%02d=%08x " , i, env->phys_regs[i]); +qemu_fprintf (f,"AR%02d=%08x " , i, env->phys_regs[i]);if (i %4 ==3 ) {bool ws = (env->sregs[WINDOW_START ] & (1 << (i /4 ))) !=0 ;bool cw = env->sregs[WINDOW_BASE ] == i /4 ; -cpu_fprintf (f,"%c%c\n" , ws ?'<' :' ' , cw ?'=' :' ' ); +qemu_fprintf (f,"%c%c\n" , ws ?'<' :' ' , cw ?'=' :' ' ); } }if ((flags &CPU_DUMP_FPU ) &&xtensa_option_enabled (env->config,XTENSA_OPTION_FP_COPROCESSOR )) { -cpu_fprintf (f,"\n" ); +qemu_fprintf (f,"\n" );for (i =0 ; i <16 ; ++i) { -cpu_fprintf (f,"F%02d=%08x (%+10.8e)%c" , i, -float32_val (env->fregs[i].f32[FP_F32_LOW ]), - *(float *)(env->fregs[i].f32 +FP_F32_LOW ), - (i %2 ) ==1 ?'\n' :' ' ); +qemu_fprintf (f,"F%02d=%08x (%+10.8e)%c" , i, +float32_val (env->fregs[i].f32[FP_F32_LOW ]), + *(float *)(env->fregs[i].f32 +FP_F32_LOW ), + (i %2 ) ==1 ?'\n' :' ' ); } } }
Signature · 1 line
2.17.2
PATCH v2 15/17 monitor: Clean up how monitor_disas() funnels output to monitor
In reply to Markus ArmbrusterINIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE * to pass to it. monitor_disas() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-pinning is ugly.
Pass qemu_fprintf() and NULL instead.
monitor_fprintf() is now unused; delete it.
--- disas.c | 3 ++- include/monitor/monitor.h | 1 - monitor.c | 11 ----------- 3 files changed, 2 insertions(+), 13 deletions(-)
disas.c +2 -1
@@ -3,6 +3,7 @@#include "qemu-common.h" #include "disas/bfd.h" #include "elf.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "disas/disas.h"
@@ -609,7 +610,7 @@ void monitor_disas(Monitor *mon, CPUState *cpu,int count, i;CPUDebug s; -INIT_DISASSEMBLE_INFO (s.info, (FILE *)mon, monitor_fprintf); +INIT_DISASSEMBLE_INFO (s.info,NULL , qemu_fprintf); s.cpu = cpu; s.info.read_memory_func
include/monitor/monitor.h +0 -1
@@ -31,7 +31,6 @@ int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp); int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); int monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3);void monitor_flush (Monitor *mon);int monitor_set_cpu (int cpu_index);int monitor_get_cpu_index (void );
monitor.c +0 -11
@@ -480,17 +480,6 @@ int monitor_printf(Monitor *mon, const char *fmt, ...)return ret; } -int monitor_fprintf (FILE *stream,const char *fmt, ...) -{ -int ret; - -va_list ap; -va_start (ap, fmt); - ret =monitor_vprintf ((Monitor *)stream, fmt, ap); -va_end (ap); -return ret; -} -static void qmp_send_response (Monitor *mon,const QDict *rsp) {const QObject *data =QOBJECT (rsp);
Signature · 1 line
2.17.2
Re: [Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor
Quoted 5 lines · Markus Armbruster
INIT_DISASSEMBLE_INFO()takes an fprintf()-like callback and a FILE * to pass to it.monitor_disas()passesmonitor_fprintf()and the current monitor cast to FILE *.monitor_fprintf()casts it right back, and is otherwise identical tomonitor_printf(). The type-pinning is ugly.
For consistency with other patches in the series, s/pinning/punning/
Quoted 8 lines
Pass
qemu_fprintf()and NULL instead.
monitor_fprintf()is now unused; delete it.Signed-off-by Markus Armbruster <[email protected]>Reviewed-by Dr. David Alan Gilbert <[email protected]>---
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Re: [Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor
Quoted 8 lines · Eric Blake
Quoted 5 lines · Markus Armbruster
INIT_DISASSEMBLE_INFO()takes an fprintf()-like callback and a FILE * to pass to it.monitor_disas()passesmonitor_fprintf()and the current monitor cast to FILE *.monitor_fprintf()casts it right back, and is otherwise identical tomonitor_printf(). The type-pinning is ugly.For consistency with other patches in the series, s/pinning/punning/
Typo, will fix. Thanks!
Quoted 8 lines
Quoted 8 lines
Pass
qemu_fprintf()and NULL instead.
monitor_fprintf()is now unused; delete it.Signed-off-by Markus Armbruster <[email protected]>Reviewed-by Dr. David Alan Gilbert <[email protected]>---
PATCH v2 16/17 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h
In reply to Markus ArmbrusterCommit dc99065b5f9 (v0.1.0) added dis-asm.h from binutils.
Commit 43d4145a986 (v0.1.5) inlined bfd.h into dis-asm.h to remove the dependency on binutils.
Commit 76cad71136b (v1.4.0) moved dis-asm.h to include/disas/bfd.h. The new name is confusing when you try to match against (pre GPLv3+) binutils. Rename it back. Keep it in the same directory, of course.
---
disas.c | 2 +-
disas/alpha.c | 2 +-
disas/arm-a64.cc | 2 +-
disas/arm.c | 2 +-
disas/cris.c | 2 +-
disas/hppa.c | 2 +-
disas/i386.c | 2 +-
disas/lm32.c | 2 +-
disas/m68k.c | 2 +-
disas/microblaze.c | 2 +-
disas/mips.c | 2 +-
disas/moxie.c | 2 +-
disas/nanomips.cpp | 2 +-
disas/nios2.c | 2 +-
disas/ppc.c | 2 +-
disas/riscv.c | 2 +-
disas/s390.c | 2 +-
disas/sh4.c | 2 +-
disas/sparc.c | 2 +-
disas/tci.c | 2 +-
disas/xtensa.c | 2 +-
include/disas/{bfd.h => dis-asm.h} | 0
include/qom/cpu.h | 2 +-
target/openrisc/disas.c | 2 +-
target/ppc/translate_init.inc.c | 2 +-
25 files changed, 24 insertions(+), 24 deletions(-)
rename include/disas/{bfd.h => dis-asm.h} (100%)disas.c +1 -1
@@ -1,7 +1,7 @@/* General "disassemble this chunk" code. Used for debugging. */ #include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "elf.h" #include "qemu/qemu-print.h"
disas/alpha.c +1 -1
@@ -20,7 +20,7 @@ along with this file; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* MAX is redefined below, so remove any previous definition. */ #undef MAX
disas/arm-a64.cc +1 -1
@@ -19,7 +19,7 @@ extern "C" { #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" } #include "vixl/a64/disasm-a64.h"
disas/arm.c +1 -1
@@ -23,7 +23,7 @@for things we don't care about. */ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define ARM_EXT_V1 0#define ARM_EXT_V2 0
disas/cris.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "target/cris/opcode-cris.h" #define CONST_STRNEQ (STR1 ,STR2 ) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
disas/hppa.c +1 -1
@@ -19,7 +19,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* HP PA-RISC SOM object file format: definitions internal to BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
disas/i386.c +1 -1
@@ -32,7 +32,7 @@the Intel manual for details. */ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "qemu/cutils.h" /* include/opcode/i386.h r1.78 */
disas/lm32.c +1 -1
@@ -19,7 +19,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" typedef enum { LM32_OP_SRUI = 0, LM32_OP_NORI, LM32_OP_MULI, LM32_OP_SH, LM32_OP_LB,
disas/m68k.c +1 -1
@@ -4,7 +4,7 @@#include "qemu/osdep.h" #include <math.h> -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* **** floatformat.h from sourceware.org CVS 2005-08-14. */ /* IEEE floating point support declarations, for GDB, the GNU Debugger.
disas/microblaze.c +1 -1
@@ -577,7 +577,7 @@ static const char pvr_register_prefix[] = "rpvr";#endif /* MICROBLAZE_OPC */ -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define get_field_rd (instr) get_field(instr, RD_MASK, RD_LOW)#define get_field_r1 (instr) get_field(instr, RA_MASK, RA_LOW)
disas/mips.c +1 -1
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* mips.h. Mips opcode list for GDB, the GNU debugger. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
disas/moxie.c +1 -1
@@ -18,7 +18,7 @@#define STATIC_TABLE #define DEFINE_TABLE -#include "disas/bfd.h" +#include "disas/dis-asm.h" static void *stream;
disas/nanomips.cpp +1 -1
@@ -29,7 +29,7 @@ extern "C" { #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" } #include <cstring>
disas/nios2.c +1 -1
@@ -36,7 +36,7 @@/*#include "bfd.h"*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /****************************************************************************
disas/ppc.c +1 -1
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this file; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define BFD_DEFAULT_TARGET_SIZE 64/* ppc.h -- Header file for PowerPC opcode table
disas/riscv.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* types */
disas/s390.c +1 -1
@@ -22,7 +22,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* include/opcode/s390.h revision 1.9 */ /* s390.h -- Header file for S390 opcode table
disas/sh4.c +1 -1
@@ -16,7 +16,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define DEFINE_TABLE
disas/sparc.c +1 -1
@@ -27,7 +27,7 @@ see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* The SPARC opcode table (and other related data) is defined in the opcodes library in sparc-opc.c. If you change anything here, make
disas/tci.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "tcg/tcg.h" /* Disassemble TCI bytecode. */
disas/xtensa.c +1 -1
@@ -26,7 +26,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "hw/xtensa/xtensa-isa.h" int print_insn_xtensa (bfd_vma memaddr,struct disassemble_info *info)
include/disas/dis-asm.h renamed from include/disas/bfd.h +0 -0
include/qom/cpu.h +1 -1
@@ -21,7 +21,7 @@#define QEMU_CPU_H #include "hw/qdev-core.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "exec/hwaddr.h" #include "exec/memattrs.h" #include "qapi/qapi-types-run-state.h"
target/openrisc/disas.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "qemu/bitops.h" #include "cpu.h"
target/ppc/translate_init.inc.c +1 -1
@@ -18,7 +18,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "exec/gdbstub.h" #include "kvm_ppc.h" #include "sysemu/arch_init.h"
Signature · 1 line
2.17.2
Re: [Qemu-devel] [PATCH v2 16/17] disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h
Quoted 11 lines · * Markus Armbruster ([email protected]) wrote:
Commit
dc99065b5f9(v0.1.0) addeddis-asm.hfrom binutils.Commit
43d4145a986(v0.1.5) inlinedbfd.hintodis-asm.hto remove the dependency on binutils.Commit
76cad71136b(v1.4.0) moveddis-asm.htoinclude/disas/bfd.h. The new name is confusing when you try to match against (pre GPLv3+) binutils. Rename it back. Keep it in the same directory, of course.Cc Paolo Bonzini <[email protected]>Signed-off-by Markus Armbruster <[email protected]>
Quoted 348 lines
--- disas.c | 2 +- disas/alpha.c | 2 +- disas/arm-a64.cc | 2 +- disas/arm.c | 2 +- disas/cris.c | 2 +- disas/hppa.c | 2 +- disas/i386.c | 2 +- disas/lm32.c | 2 +- disas/m68k.c | 2 +- disas/microblaze.c | 2 +- disas/mips.c | 2 +- disas/moxie.c | 2 +- disas/nanomips.cpp | 2 +- disas/nios2.c | 2 +- disas/ppc.c | 2 +- disas/riscv.c | 2 +- disas/s390.c | 2 +- disas/sh4.c | 2 +- disas/sparc.c | 2 +- disas/tci.c | 2 +- disas/xtensa.c | 2 +- include/disas/{bfd.h => dis-asm.h} | 0 include/qom/cpu.h | 2 +- target/openrisc/disas.c | 2 +- target/ppc/translate_init.inc.c | 2 +- 25 files changed, 24 insertions(+), 24 deletions(-) rename include/disas/{bfd.h => dis-asm.h} (100%)disas.c +1
-1@@ -1,7 +1,7 @@/* General "disassemble this chunk" code. Used for debugging. */ #include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "elf.h" #include "qemu/qemu-print.h" disas/alpha.c +1
-1@@ -20,7 +20,7 @@ along with this file; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* MAX is redefined below, so remove any previous definition. */ #undef MAXdisas/arm-a64.cc +1
-1@@ -19,7 +19,7 @@ extern "C" { #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" } #include "vixl/a64/disasm-a64.h"disas/arm.c +1
-1@@ -23,7 +23,7 @@for things we don't care about. */ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define ARM_EXT_V1 0#define ARM_EXT_V2 0disas/cris.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "target/cris/opcode-cris.h" #define CONST_STRNEQ (STR1 ,STR2 ) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)disas/hppa.c +1
-1@@ -19,7 +19,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* HP PA-RISC SOM object file format: definitions internal to BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, disas/i386.c +1
-1@@ -32,7 +32,7 @@the Intel manual for details. */ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "qemu/cutils.h" /* include/opcode/i386.h r1.78 */ disas/lm32.c +1
-1@@ -19,7 +19,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" typedef enum { LM32_OP_SRUI = 0, LM32_OP_NORI, LM32_OP_MULI, LM32_OP_SH, LM32_OP_LB,disas/m68k.c +1
-1@@ -4,7 +4,7 @@#include "qemu/osdep.h" #include <math.h> -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* **** floatformat.h from sourceware.org CVS 2005-08-14. */ /* IEEE floating point support declarations, for GDB, the GNU Debugger. disas/microblaze.c +1
-1@@ -577,7 +577,7 @@ static const char pvr_register_prefix[] = "rpvr";#endif /* MICROBLAZE_OPC */ -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define get_field_rd (instr) get_field(instr, RD_MASK, RD_LOW)#define get_field_r1 (instr) get_field(instr, RA_MASK, RA_LOW)disas/mips.c +1
-1@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* mips.h. Mips opcode list for GDB, the GNU debugger. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 disas/moxie.c +1
-1@@ -18,7 +18,7 @@#define STATIC_TABLE #define DEFINE_TABLE -#include "disas/bfd.h" +#include "disas/dis-asm.h" static void *stream;disas/nanomips.cpp +1
-1@@ -29,7 +29,7 @@ extern "C" { #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" } #include <cstring>disas/nios2.c +1
-1@@ -36,7 +36,7 @@/*#include "bfd.h"*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /**************************************************************************** disas/ppc.c +1
-1@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this file; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define BFD_DEFAULT_TARGET_SIZE 64/* ppc.h -- Header file for PowerPC opcode table disas/riscv.c +1
-1@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* types */ disas/s390.c +1
-1@@ -22,7 +22,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* include/opcode/s390.h revision 1.9 */ /* s390.h -- Header file for S390 opcode table disas/sh4.c +1
-1@@ -16,7 +16,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #define DEFINE_TABLE disas/sparc.c +1
-1@@ -27,7 +27,7 @@ see <http://www.gnu.org/licenses/>. */#include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" /* The SPARC opcode table (and other related data) is defined in the opcodes library in sparc-opc.c. If you change anything here, make disas/tci.c +1
-1@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "tcg/tcg.h" /* Disassemble TCI bytecode. */ disas/xtensa.c +1
-1@@ -26,7 +26,7 @@*/ #include "qemu/osdep.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "hw/xtensa/xtensa-isa.h" int print_insn_xtensa (bfd_vma memaddr,struct disassemble_info *info)include/disas/dis-asm.h renamed from include/disas/bfd.h +0
-0include/qom/cpu.h +1
-1@@ -21,7 +21,7 @@#define QEMU_CPU_H #include "hw/qdev-core.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "exec/hwaddr.h" #include "exec/memattrs.h" #include "qapi/qapi-types-run-state.h" target/openrisc/disas.c +1
-1@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "qemu/bitops.h" #include "cpu.h" target/ppc/translate_init.inc.c +1
-1@@ -18,7 +18,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include "disas/bfd.h" +#include "disas/dis-asm.h" #include "exec/gdbstub.h" #include "kvm_ppc.h" #include "sysemu/arch_init.h" Signature · 1 line
2.17.2
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
PATCH v2 17/17 include: Move fprintf_function to disas/
In reply to Markus ArmbrusterThe previous commits have eliminated fprintf_function outside disassemblers, simplifying code and cleaning up the ugly type-punning fprintf_function seems to attract. Move fprintf_function to include/disas/dis-asm.h to reduce the temptation to abuse it.
I considered renaming it to fprintf_ftype (reverting that part of commit 6e2d864edf5, v0.14.0) to get us closer to binutils, but I figure the fork is too distant to make this worthwhile.
--- include/disas/dis-asm.h | 5 +++-- include/qemu/fprintf-fn.h | 14 -------------- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 include/qemu/fprintf-fn.h
include/disas/dis-asm.h +3 -2
@@ -9,8 +9,6 @@#ifndef DISAS_BFD_H #define DISAS_BFD_H -#include "qemu/fprintf-fn.h" -typedef void *PTR ;typedef uint64_t bfd_vma ;typedef int64_t bfd_signed_vma ;
@@ -243,6 +241,9 @@ typedef struct symbol_cache_entry } udata; } asymbol; +typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) +GCC_FMT_ATTR (2 ,3 ); +enum dis_insn_type { dis_noninsn,/* Not a valid instruction */ dis_nonbranch,/* Not a branch instruction */
include/qemu/fprintf-fn.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* -* Typedef for fprintf-alike function pointers. -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#ifndef QEMU_FPRINTF_FN_H -#define QEMU_FPRINTF_FN_H - -typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) -GCC_FMT_ATTR (2 ,3 ); - -#endif
Signature · 1 line
2.17.2
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'd406c1d4cd include: Move fprintf_function to disas/16ce7b0844 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h f8e6976645 monitor: Clean up how monitor_disas() funnels output to monitor f79afa9517 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints e1bbc178e1 qemu-print: New qemu_fprintf(), qemu_vfprintf() 7d392f9f86 qom/cpu: Simplify how CPUClass::dump_statistics() prints 090bb102c7 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints 56219b4319 target: Clean up how the dump_mmu() print4e158b35c2 target: Simplify how the TARGET_cpu_list() print 567d521da5 memory: Clean up how mtree_info() prints48a4f4d6da block/qapi: Clean up how we print to monitor or stdout f680529453 qsp: Simplify how qsp_report() prints
8112185742 tcg: Simplify how dump_drift_info() prints852634721a tcg: Simplify how dump_exec_info() printsc85405d1e6 tcg: Simplify how dump_opcount_info() prints 21ecaf197a trace: Simplify how st_print_trace_file_status() prints 092f2c47ed include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 092f2c47eda6 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 21ecaf197ac6 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit c85405d1e6e5 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 852634721a33 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 8112185742a2 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit f6805294530b (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 48a4f4d6da8d (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 567d521da590 (memory: Clean up how mtree_info() prints) 9/17 Checking commit 4e158b35c234 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit 56219b431925 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 090bb102c765 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 7d392f9f86d6 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit e1bbc178e114 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit f79afa951759 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit f8e6976645da (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 16ce7b0844dd (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit d406c1d4cd3e (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'8b142fc767 include: Move fprintf_function to disas/d69f01b1b3 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 473a1c8779 monitor: Clean up how monitor_disas() funnels output to monitor 363a8f9258 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints a2be3c05f9 qemu-print: New qemu_fprintf(), qemu_vfprintf() 1f6386c655 qom/cpu: Simplify how CPUClass::dump_statistics() prints fc33835b61 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints bea3b777db target: Clean up how the dump_mmu() print0cf22bb8f4 target: Simplify how the TARGET_cpu_list() print edae5f9c36 memory: Clean up how mtree_info() prints409b0a9ef6 block/qapi: Clean up how we print to monitor or stdout a2db2c108d qsp: Simplify how qsp_report() printseeef382c8b tcg: Simplify how dump_drift_info() prints26f0941f15 tcg: Simplify how dump_exec_info() prints1befd4787a tcg: Simplify how dump_opcount_info() prints ca597f2d8e trace: Simplify how st_print_trace_file_status() prints 1c6d436697 include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 1c6d43669789 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit ca597f2d8e95 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 1befd4787a61 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 26f0941f15dc (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit eeef382c8bdb (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit a2db2c108d25 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 409b0a9ef641 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit edae5f9c360a (memory: Clean up how mtree_info() prints) 9/17 Checking commit 0cf22bb8f42e (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit bea3b777dbfa (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit fc33835b6178 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 1f6386c655a5 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit a2be3c05f9fc (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 363a8f9258a4 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 473a1c877930 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit d69f01b1b315 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit 8b142fc76760 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'd04838b7b7 include: Move fprintf_function to disas/319ed76db2 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h feff1f1103 monitor: Clean up how monitor_disas() funnels output to monitor c9c4a984c5 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints f7def015ea qemu-print: New qemu_fprintf(), qemu_vfprintf() 286643ea44 qom/cpu: Simplify how CPUClass::dump_statistics() prints 3d846546c8 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints f2b3c9abee target: Clean up how the dump_mmu() print
1394894623 target: Simplify how the TARGET_cpu_list() print 1c6016aa83 memory: Clean up how mtree_info() prints8f6c6a9fe3 block/qapi: Clean up how we print to monitor or stdout 782d9eb94e qsp: Simplify how qsp_report() printse6de5c5911 tcg: Simplify how dump_drift_info() prints9e1aa6472d tcg: Simplify how dump_exec_info() prints21dba78baa tcg: Simplify how dump_opcount_info() prints c6d722b62c trace: Simplify how st_print_trace_file_status() prints ded6f95b0e include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit ded6f95b0e1b (include: Include fprintf-fn.h only where needed) 2/17 Checking commit c6d722b62cc2 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 21dba78baad3 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 9e1aa6472d45 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit e6de5c591115 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 782d9eb94e8a (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 8f6c6a9fe333 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 1c6016aa83ad (memory: Clean up how mtree_info() prints) 9/17 Checking commit 139489462353 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit f2b3c9abeec5 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 3d846546c8e2 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 286643ea442b (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit f7def015ea17 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit c9c4a984c53d (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit feff1f11032c (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 319ed76db21e (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit d04838b7b77a (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'66669b6bcf include: Move fprintf_function to disas/5f3c81a6c0 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h b1ae46c343 monitor: Clean up how monitor_disas() funnels output to monitor a00c28ab5f qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 0f55321ae1 qemu-print: New qemu_fprintf(), qemu_vfprintf() f2dbd0673c qom/cpu: Simplify how CPUClass::dump_statistics() prints 5b67d37795 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints dc40ad0d34 target: Clean up how the dump_mmu() print8df164790b target: Simplify how the TARGET_cpu_list() print 17406d3cf6 memory: Clean up how mtree_info() prints53875f811b block/qapi: Clean up how we print to monitor or stdout d2f6642515 qsp: Simplify how qsp_report() printse380a5d2ef tcg: Simplify how dump_drift_info() printsaa6873e448 tcg: Simplify how dump_exec_info() printsf8a56f8a9e tcg: Simplify how dump_opcount_info() prints 5beb1ec556 trace: Simplify how st_print_trace_file_status() prints 5f69e0108f include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 5f69e0108f3a (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 5beb1ec556b3 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit f8a56f8a9e7a (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit aa6873e4485d (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit e380a5d2ef1f (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit d2f6642515d9 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 53875f811b38 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 17406d3cf6af (memory: Clean up how mtree_info() prints) 9/17 Checking commit 8df164790bf4 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit dc40ad0d3487 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 5b67d377956e (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit f2dbd0673ce7 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 0f55321ae1d6 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit a00c28ab5fe0 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit b1ae46c3432c (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 5f3c81a6c07d (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit 66669b6bcf6b (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'587c26c24e include: Move fprintf_function to disas/416f563f47 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 0a17831a3d monitor: Clean up how monitor_disas() funnels output to monitor 7552bb783c qom/cpu: Simplify how CPUClass:cpu_dump_state() prints f8829004b6 qemu-print: New qemu_fprintf(), qemu_vfprintf() 6e17d7886f qom/cpu: Simplify how CPUClass::dump_statistics() prints b9e7cc19f9 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints d0235ec2aa target: Clean up how the dump_mmu() print5ac5266b18 target: Simplify how the TARGET_cpu_list() print 537efe83e7 memory: Clean up how mtree_info() printsd8c0a5610f block/qapi: Clean up how we print to monitor or stdout 1f2593e991 qsp: Simplify how qsp_report() prints8ddded1f2c tcg: Simplify how dump_drift_info() prints50a002becd tcg: Simplify how dump_exec_info() printseb737a179a tcg: Simplify how dump_opcount_info() prints 298229bbdd trace: Simplify how st_print_trace_file_status() prints 8a2715b3db include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 8a2715b3db01 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 298229bbddd0 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit eb737a179ad4 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 50a002becdd9 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 8ddded1f2ce1 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 1f2593e99199 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit d8c0a5610f9d (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 537efe83e7af (memory: Clean up how mtree_info() prints) 9/17 Checking commit 5ac5266b18f3 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit d0235ec2aa72 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit b9e7cc19f90d (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 6e17d7886f80 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit f8829004b621 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 7552bb783c08 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 0a17831a3dbe (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 416f563f47e7 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit 587c26c24e65 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'4efc614089 include: Move fprintf_function to disas/609b068e91 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h b60826bdec monitor: Clean up how monitor_disas() funnels output to monitor 7e0a83951c qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 0310913eaf qemu-print: New qemu_fprintf(), qemu_vfprintf() de8e759927 qom/cpu: Simplify how CPUClass::dump_statistics() prints 21575fb486 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints 5e14da45f9 target: Clean up how the dump_mmu() printd38f591f4a target: Simplify how the TARGET_cpu_list() print f6d226a80d memory: Clean up how mtree_info() printsdea28d5474 block/qapi: Clean up how we print to monitor or stdout 18cc598399 qsp: Simplify how qsp_report() printsa2acbfe35b tcg: Simplify how dump_drift_info() prints746793c924 tcg: Simplify how dump_exec_info() prints48e5796804 tcg: Simplify how dump_opcount_info() prints 2788f8a6c8 trace: Simplify how st_print_trace_file_status() prints b667f124bf include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit b667f124bfd4 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 2788f8a6c887 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 48e579680473 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 746793c92494 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit a2acbfe35b3f (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 18cc59839940 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit dea28d5474ce (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit f6d226a80d57 (memory: Clean up how mtree_info() prints) 9/17 Checking commit d38f591f4af4 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit 5e14da45f92c (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 21575fb486ef (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit de8e75992712 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 0310913eaf37 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 7e0a83951c37 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit b60826bdec60 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 609b068e9185 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit 4efc61408903 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'c8c93e61d1 include: Move fprintf_function to disas/f5674f82b2 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 08e5c5c637 monitor: Clean up how monitor_disas() funnels output to monitor 5758566368 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 263852f63a qemu-print: New qemu_fprintf(), qemu_vfprintf() 005251581b qom/cpu: Simplify how CPUClass::dump_statistics() prints 207d3db725 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints d9cc902329 target: Clean up how the dump_mmu() print827021bdb4 target: Simplify how the TARGET_cpu_list() print f5dfd1ae06 memory: Clean up how mtree_info() printsea4b4273ed block/qapi: Clean up how we print to monitor or stdout cf6447c2ca qsp: Simplify how qsp_report() prints66120f6a1e tcg: Simplify how dump_drift_info() prints872e71e6a3 tcg: Simplify how dump_exec_info() prints49dadefa20 tcg: Simplify how dump_opcount_info() prints ce1a847509 trace: Simplify how st_print_trace_file_status() prints 20ac898544 include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 20ac898544d2 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit ce1a8475095a (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 49dadefa2093 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 872e71e6a30d (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 66120f6a1e65 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit cf6447c2ca7d (qsp: Simplify how qsp_report() prints) 7/17 Checking commit ea4b4273ed42 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit f5dfd1ae06f7 (memory: Clean up how mtree_info() prints) 9/17 Checking commit 827021bdb479 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit d9cc9023295d (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 207d3db72502 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 005251581b3b (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 263852f63aa4 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 5758566368d1 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 08e5c5c637d7 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit f5674f82b2d3 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit c8c93e61d132 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'dfb284c449 include: Move fprintf_function to disas/dbc3e8039f disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 71f572cab2 monitor: Clean up how monitor_disas() funnels output to monitor 67cdf8cf8b qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 6a1d72f66f qemu-print: New qemu_fprintf(), qemu_vfprintf() b6e8226b5c qom/cpu: Simplify how CPUClass::dump_statistics() prints fea77047bb target/i386: Simplify how x86_cpu_dump_local_apic_state() prints f850e6e38b target: Clean up how the dump_mmu() printf36f9982d5 target: Simplify how the TARGET_cpu_list() print 97472bedb7 memory: Clean up how mtree_info() prints09a19b6e63 block/qapi: Clean up how we print to monitor or stdout 68ff1d89f6 qsp: Simplify how qsp_report() prints6777d9cdfd tcg: Simplify how dump_drift_info() printsdc643ac146 tcg: Simplify how dump_exec_info() prints
9801855090 tcg: Simplify how dump_opcount_info() prints 7530ac3e60 trace: Simplify how st_print_trace_file_status() prints 8d5be4b138 include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 8d5be4b13878 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 7530ac3e60b5 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 980185509054 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit dc643ac146c5 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 6777d9cdfd98 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 68ff1d89f658 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 09a19b6e63c7 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 97472bedb71b (memory: Clean up how mtree_info() prints) 9/17 Checking commit f36f9982d564 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit f850e6e38bf3 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit fea77047bbff (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit b6e8226b5c46 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 6a1d72f66f1b (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 67cdf8cf8b1f (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 71f572cab24d (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit dbc3e8039f78 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit dfb284c44975 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'dbad74bf63 include: Move fprintf_function to disas/8056ad6cd3 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 90edbaf518 monitor: Clean up how monitor_disas() funnels output to monitor 9dacaf5ef7 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 5e6905625e qemu-print: New qemu_fprintf(), qemu_vfprintf() 149609b2ad qom/cpu: Simplify how CPUClass::dump_statistics() prints 64fad59c2e target/i386: Simplify how x86_cpu_dump_local_apic_state() prints d0d676884c target: Clean up how the dump_mmu() printe62415eb3c target: Simplify how the TARGET_cpu_list() print 6b93fa5e80 memory: Clean up how mtree_info() printse55e74cdf1 block/qapi: Clean up how we print to monitor or stdout 922dc9a331 qsp: Simplify how qsp_report() printsa319820a6d tcg: Simplify how dump_drift_info() prints7e213bdc95 tcg: Simplify how dump_exec_info() printsa8dbca91a2 tcg: Simplify how dump_opcount_info() prints 8f9d9b1b12 trace: Simplify how st_print_trace_file_status() prints 7bf430b203 include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit 7bf430b2033a (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 8f9d9b1b1263 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit a8dbca91a2fb (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 7e213bdc9596 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit a319820a6d62 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 922dc9a33160 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit e55e74cdf1f9 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 6b93fa5e8004 (memory: Clean up how mtree_info() prints) 9/17 Checking commit e62415eb3c51 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit d0d676884c52 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit 64fad59c2e43 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 149609b2ad9b (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 5e6905625eeb (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 9dacaf5ef718 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 90edbaf518e3 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 8056ad6cd3d8 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit dbad74bf63f2 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'90107e0ecd include: Move fprintf_function to disas/08c75e94b5 disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h b35d73a420 monitor: Clean up how monitor_disas() funnels output to monitor 4f0c3493f6 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 68f63bc7a9 qemu-print: New qemu_fprintf(), qemu_vfprintf() d41d47ee91 qom/cpu: Simplify how CPUClass::dump_statistics() prints df73a8c8e6 target/i386: Simplify how x86_cpu_dump_local_apic_state() prints edc6b2832c target: Clean up how the dump_mmu() print482f38cd69 target: Simplify how the TARGET_cpu_list() print 18b22c842c memory: Clean up how mtree_info() prints2dfb27eebe block/qapi: Clean up how we print to monitor or stdout 10b6b38b8a qsp: Simplify how qsp_report() prints3a161a6792 tcg: Simplify how dump_drift_info() printse340f7a5c0 tcg: Simplify how dump_exec_info() printsbdd8aea085 tcg: Simplify how dump_opcount_info() prints 0cb2f55550 trace: Simplify how st_print_trace_file_status() prints dcae6b30f1 include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit dcae6b30f156 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit 0cb2f5555029 (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit bdd8aea085c0 (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit e340f7a5c047 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 3a161a679275 (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 10b6b38b8ae9 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit 2dfb27eebe4e (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 18b22c842ccb (memory: Clean up how mtree_info() prints) 9/17 Checking commit 482f38cd6965 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit edc6b2832c82 (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit df73a8c8e645 (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit d41d47ee915e (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit 68f63bc7a914 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 4f0c3493f69b (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit b35d73a42067 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 08c75e94b574 (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit 90107e0ecdfa (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'db19e834f8 include: Move fprintf_function to disas/4413299b4d disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h 4daa71b4be monitor: Clean up how monitor_disas() funnels output to monitor 8db320f550 qom/cpu: Simplify how CPUClass:cpu_dump_state() prints b71147d0c2 qemu-print: New qemu_fprintf(), qemu_vfprintf() 27a5a25b67 qom/cpu: Simplify how CPUClass::dump_statistics() prints a83cbb831d target/i386: Simplify how x86_cpu_dump_local_apic_state() prints 245613cc1b target: Clean up how the dump_mmu() print10998140d5 target: Simplify how the TARGET_cpu_list() print 2e76bc9d7c memory: Clean up how mtree_info() printsfef413a9bc block/qapi: Clean up how we print to monitor or stdout 72de8879b2 qsp: Simplify how qsp_report() prints89b234381a tcg: Simplify how dump_drift_info() prints511085a3f7 tcg: Simplify how dump_exec_info() prints8a89bb3a52 tcg: Simplify how dump_opcount_info() prints d8a29469b3 trace: Simplify how st_print_trace_file_status() prints d1ffc558ad include: Include fprintf-fn.h only where needed
=== OUTPUT BEGIN ===
1/17 Checking commit d1ffc558ada9 (include: Include fprintf-fn.h only where needed) 2/17 Checking commit d8a29469b38b (trace: Simplify how st_print_trace_file_status() prints) 3/17 Checking commit 8a89bb3a523a (tcg: Simplify how dump_opcount_info() prints) 4/17 Checking commit 511085a3f704 (tcg: Simplify how dump_exec_info() prints) 5/17 Checking commit 89b234381aef (tcg: Simplify how dump_drift_info() prints) 6/17 Checking commit 72de8879b2a5 (qsp: Simplify how qsp_report() prints) 7/17 Checking commit fef413a9bc34 (block/qapi: Clean up how we print to monitor or stdout) 8/17 Checking commit 2e76bc9d7c92 (memory: Clean up how mtree_info() prints) 9/17 Checking commit 10998140d529 (target: Simplify how the TARGET_cpu_list() print) 10/17 Checking commit 245613cc1b1e (target: Clean up how the dump_mmu() print)
WARNING: line over 80 characters
#950: FILE: target/xtensa/mmu_helper.c:784:
+ qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n"
total: 0 errors, 1 warnings, 848 lines checked
Patch 10/17 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/17 Checking commit a83cbb831dfb (target/i386: Simplify how x86_cpu_dump_local_apic_state() prints) 12/17 Checking commit 27a5a25b6773 (qom/cpu: Simplify how CPUClass::dump_statistics() prints) 13/17 Checking commit b71147d0c208 (qemu-print: New qemu_fprintf(), qemu_vfprintf()) 14/17 Checking commit 8db320f55011 (qom/cpu: Simplify how CPUClass:cpu_dump_state() prints)
ERROR: line over 90 characters
#1051: FILE: target/i386/helper.c:419:
+ qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1052: FILE: target/i386/helper.c:420:
+ "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1053: FILE: target/i386/helper.c:421:
+ "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1054: FILE: target/i386/helper.c:422:
+ "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"
ERROR: line over 90 characters
#1055: FILE: target/i386/helper.c:423:
+ "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",
WARNING: line over 80 characters
#1163: FILE: target/i386/helper.c:494:
+ qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",
WARNING: line over 80 characters
#1751: FILE: target/mips/translate.c:29791:
+ qemu_fprintf(f, "CP0 Status 0x%08x Cause 0x%08x EPC 0x" TARGET_FMT_lx "\n",
total: 5 errors, 2 warnings, 2551 lines checked
Patch 14/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
15/17 Checking commit 4daa71b4bee9 (monitor: Clean up how monitor_disas() funnels output to monitor) 16/17 Checking commit 4413299b4d9a (disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#296:
rename from include/disas/bfd.h
total: 0 errors, 1 warnings, 192 lines checked
Patch 16/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/17 Checking commit db19e834f826 (include: Move fprintf_function to disas/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #45:
deleted file mode 100644
total: 0 errors, 1 warnings, 17 lines checked
Patch 17/17 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]