[RFC v2 2/2] hw/riscv: Add server platform reference machine

2024-03-12 Thread Fei Wu
- PCIe AHCI - PCIe NIC - No virtio device - No fw_cfg device - No ACPI table provided - Only minimal device tree nodes [1] https://github.com/riscv-non-isa/riscv-server-platform Signed-off-by: Fei Wu --- configs/devices/riscv64-softmmu/default.mak |1 + hw/riscv/Kconfig

[RFC v2 1/2] target/riscv: Add server platform reference cpu

2024-03-12 Thread Fei Wu
/server_platform_requirements.adoc Signed-off-by: Fei Wu --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 61 ++ 2 files changed, 62 insertions(+) diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index 3670cfe6d9..adb934d19e 100644 --- a/target/riscv/cpu-qom.h

[RFC v2 0/2] Add RISC-V Server Platform Reference Board

2024-03-12 Thread Fei Wu
definition the 1st patch - replace sifive_test with power reset syscon - add versioning scheme to fdt - integrate recent changes in virt.c - use g_autofree - create_fdt/finalize_fdt - riscv_isa_write_fdt - some cleanups Fei Wu (2): target/riscv: Add server platform reference cpu hw/riscv

[RFC 2/2] target/riscv: Add server platform reference cpu

2024-03-04 Thread Fei Wu
/server_platform_requirements.adoc Signed-off-by: Fei Wu --- hw/riscv/server_platform_ref.c | 6 +++- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 62 ++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv

[RFC 1/2] hw/riscv: Add server platform reference machine

2024-03-04 Thread Fei Wu
- PCIe AHCI - PCIe NIC - No virtio device - No fw_cfg device - No ACPI table provided - Only minimal device tree nodes [1] https://github.com/riscv-non-isa/riscv-server-platform Signed-off-by: Fei Wu --- configs/devices/riscv64-softmmu/default.mak |1 + hw/riscv/Kconfig

[RFC 0/2] Add RISC-V Server Platform Reference Board

2024-03-04 Thread Fei Wu
-II platform (WIP) is needed to provide related ACPI tables. For testing purposes only, we used a workaround to generate the ACPI tables in Qemu with a dedicated downstream patch. [1] https://github.com/riscv-non-isa/riscv-server-platform [2] https://github.com/tianocore/edk2.git Fei Wu (2): hw

[PATCH] hw/riscv: split RAM into low and high memory

2023-07-30 Thread Fei Wu
, and these (APIC/IOAPIC) live right below 4GiB. So just split the RAM range into two portions: - 1 GiB range from 0x8000 to 0xc000. - The remainder at 0x1 ...leaving a hole between the ranges. Signed-off-by: Andrei Warkentin Signed-off-by: Fei Wu --- hw/riscv/virt.c | 74

[PATCH v16 5/9] tb-stats: reset the tracked TBs on a tb_flush

2023-06-28 Thread Fei Wu
Henderson Signed-off-by: Fei Wu --- accel/tcg/tb-maint.c| 1 + accel/tcg/tb-stats.c| 18 ++ include/exec/tb-stats.h | 8 3 files changed, 27 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 264bdd84b3..1ebe6fc60e 100644 --- a/accel/tcg/tb

[PATCH v16 6/9] tb-stats: Adding info [tb-list|tb] commands to HMP

2023-06-28 Thread Fei Wu
Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-10-vanderson...@gmail.com> [AJB: fix authorship, dropped coverset] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 112 accel/tcg/tb-st

[PATCH v16 2/9] accel: collecting TB execution count

2023-06-28 Thread Fei Wu
..@gmail.com> [AJB: Fix author] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/cpu-exec.c| 6 ++ accel/tcg/tb-stats.c| 18 ++ accel/tcg/tcg-runtime.c | 1 + accel/tcg/translate-all.c | 6 -- accel/tcg/

[PATCH v16 4/9] monitor: adding tb_stats hmp command

2023-06-28 Thread Fei Wu
authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 98 +++ accel/tcg/tb-stats.c | 17 ++ hmp-commands.hx | 16 ++ include/exec/tb-stats-flags.h | 1 + include/exec/tb-stats.h |

[PATCH v16 9/9] docs: add tb-stats how to

2023-06-28 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/devel/index-tcg.rst | 1 + docs/devel/tcg-tbstats.rst | 126 + 2 files changed, 127 insertions(+) create mode 100644 docs/devel/tcg-tbstats.rst diff --git a/docs/devel/index-tcg.rst b/docs/devel/index-tcg.rst index

[PATCH v16 8/9] tb-stats: dump hot TBs at the end of the execution

2023-06-28 Thread Fei Wu
Dump the hottest TBs if -d tb_stats_{all,jit,exec}[:dump_num_at_exit] --- accel/tcg/tb-stats.c | 21 + include/exec/tb-stats-dump.h | 21 + include/exec/tb-stats-flags.h | 1 + linux-user/exit.c | 2 ++ softmmu/runstate.c

[PATCH v16 7/9] debug: add -d tb_stats to control TBStatistics

2023-06-28 Thread Fei Wu
Capture TBS at startup instead of an explicit 'tb_stats start' command. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- include/exec/tb-stats-flags.h | 1 + include/qemu/log.h| 1 + stubs/meson.build | 1 + stubs/tb

[PATCH v16 3/9] accel/tcg: add jit stats to TBStatistics

2023-06-28 Thread Fei Wu
This collects all the statistics for TBStatistics, not only for the whole emulation but for each TB. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 6 +++ accel/tcg/tb-stats.c | 69

[PATCH v16 1/9] accel/tcg: introduce TBStatistics structure

2023-06-28 Thread Fei Wu
o have all present and future qemu/tcg statistics and meta-data stored in this new structure. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-2-vanderson...@gmail.com> [AJB: fix git author, review comments] Signed-off-by: Alex Bennée Signe

[PATCH v16 0/9] TCG code quality tracking

2023-06-28 Thread Fei Wu
logs and documents * small change to do_hmp_tbstats_safe() to avoid memory leaking Alex Bennée (1): tb-stats: reset the tracked TBs on a tb_flush Fei Wu (4): accel/tcg: add jit stats to TBStatistics debug: add -d tb_stats to control TBStatistics tb-stats: dump hot TBs at the end

[PATCH v15 06/10] tb-stats: reset the tracked TBs on a tb_flush

2023-06-07 Thread Fei Wu
Henderson Signed-off-by: Fei Wu --- accel/tcg/tb-maint.c| 1 + accel/tcg/tb-stats.c| 18 ++ include/exec/tb-stats.h | 8 3 files changed, 27 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 0980fca358..11ff0ddd90 100644 --- a/accel/tcg/tb

[PATCH v15 05/10] monitor: adding tb_stats hmp command

2023-06-07 Thread Fei Wu
authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 100 ++ accel/tcg/tb-stats.c | 17 ++ hmp-commands.hx | 16 ++ include/exec/tb-stats-flags.h | 1 + include/exec/tb-stats.h |

[PATCH v15 04/10] accel/tcg: add jit stats to TBStatistics

2023-06-07 Thread Fei Wu
This collects all the statistics for TBStatistics, not only for the whole emulation but for each TB. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 6 +++ accel/tcg/tb-stats.c | 69

[PATCH v15 10/10] docs: add tb-stats how to

2023-06-07 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/devel/tcg-tbstats.rst | 97 ++ 1 file changed, 97 insertions(+) create mode 100644 docs/devel/tcg-tbstats.rst diff --git a/docs/devel/tcg-tbstats.rst b/docs/devel/tcg-tbstats.rst new file mode 100644 index 00

[PATCH v15 01/10] accel/tcg: remove CONFIG_PROFILER

2023-06-07 Thread Fei Wu
TBStats will be introduced to replace CONFIG_PROFILER totally, here remove all CONFIG_PROFILER related stuffs first. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu Reviewed-by: Richard Henderson --- accel/tcg/monitor.c | 31 - accel/tcg

[PATCH v15 08/10] debug: add -d tb_stats to control TBStatistics

2023-06-07 Thread Fei Wu
Capture TBS at startup instead of an explicit 'tb_stats start' command. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- include/exec/tb-stats-flags.h | 1 + include/qemu/log.h| 1 + stubs/meson.build | 1 + stubs/tb

[PATCH v15 02/10] accel/tcg: introduce TBStatistics structure

2023-06-07 Thread Fei Wu
o have all present and future qemu/tcg statistics and meta-data stored in this new structure. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-2-vanderson...@gmail.com> [AJB: fix git author, review comments] Signed-off-by: Alex Bennée Signe

[PATCH v15 09/10] tb-stats: dump hot TBs at the end of the execution

2023-06-07 Thread Fei Wu
Dump the hottest TBs if -d tb_stats_{all,jit,exec}[:dump_num_at_exit] --- accel/tcg/tb-stats.c | 21 + include/exec/tb-stats-dump.h | 21 + include/exec/tb-stats-flags.h | 1 + linux-user/exit.c | 2 ++ softmmu/runstate.c

[PATCH v15 07/10] tb-stats: Adding info [tb-list|tb] commands to HMP (WIP)

2023-06-07 Thread Fei Wu
--- Acked-by: Dr. David Alan Gilbert Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-10-vanderson...@gmail.com> [AJB: fix authorship, dropped coverset] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 69 accel/tcg/tb-

[PATCH v15 00/10] TCG code quality tracking

2023-06-07 Thread Fei Wu
async_safe_run_on_cpu for cmd info tb-list & tb * use monitor_disas instead of regenerate TB, but **doesn't work yet** * other cleanups Alex Bennée (1): tb-stats: reset the tracked TBs on a tb_flush Fei Wu (5): accel/tcg: remove CONFIG_PROFILER accel/tcg: add jit stats to TBStatistics debug:

[PATCH v15 03/10] accel: collecting TB execution count

2023-06-07 Thread Fei Wu
..@gmail.com> [AJB: Fix author] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/cpu-exec.c | 6 ++ accel/tcg/tb-stats.c | 18 ++ accel/tcg/tcg-runtime.c | 1 + accel/tcg/translate-all.c | 6 -- accel/tc

[PATCH v14 05/10] debug: add -d tb_stats to control TBStatistics collection:

2023-05-30 Thread Fei Wu
ts -d tb_stats,level=jit+time -d tb_stats,dump_limit=15 ... Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-7-vanderson...@gmail.com> [AJB: fix authorship, reword title] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 5 +

[PATCH v14 06/10] monitor: adding tb_stats hmp command

2023-05-30 Thread Fei Wu
...@gmail.com> Message-Id: <20190829173437.5926-9-vanderson...@gmail.com> [AJB: fix authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 45 + accel/tcg/tb-stats.c | 121 +- hmp-commands.

[PATCH v14 09/10] tb-stats: dump hot TBs at the end of the execution

2023-05-30 Thread Fei Wu
000ec1cb (id:13) Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-12-vanderson...@gmail.com> [AJB: fix authorship, ad softmmu support] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 21 + include/e

[PATCH v14 10/10] docs: add tb-stats how to

2023-05-30 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/devel/tcg-tbstats.rst | 129 + 1 file changed, 129 insertions(+) create mode 100644 docs/devel/tcg-tbstats.rst diff --git a/docs/devel/tcg-tbstats.rst b/docs/devel/tcg-tbstats.rst new file mode 100644 index 00

[PATCH v14 04/10] accel/tcg: add jit stats and time to TBStatistics

2023-05-30 Thread Fei Wu
This collects all the statistics for TBStatistics, not only for the whole emulation but for each TB. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 20 - accel/tcg/tb-stats.c | 146

[PATCH v14 08/10] Adding info [tb-list|tb] commands to HMP (WIP)

2023-05-30 Thread Fei Wu
Acked-by: Dr. David Alan Gilbert Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-10-vanderson...@gmail.com> [AJB: fix authorship, dropped coverset] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 54 ++ acc

[PATCH v14 02/10] accel/tcg: introduce TBStatistics structure

2023-05-30 Thread Fei Wu
o have all present and future qemu/tcg statistics and meta-data stored in this new structure. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-2-vanderson...@gmail.com> [AJB: fix git author, review comments] Signed-off-by: Alex Bennée Signe

[PATCH v14 01/10] accel/tcg: remove CONFIG_PROFILER

2023-05-30 Thread Fei Wu
TBStats will be introduced to replace CONFIG_PROFILER totally, here remove all CONFIG_PROFILER related stuffs first. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu Reviewed-by: Richard Henderson --- accel/tcg/monitor.c | 25 accel/tcg

[PATCH v14 07/10] tb-stats: reset the tracked TBs on a tb_flush

2023-05-30 Thread Fei Wu
Henderson Signed-off-by: Fei Wu --- accel/tcg/tb-maint.c| 1 + accel/tcg/tb-stats.c| 19 +++ include/exec/tb-stats.h | 8 3 files changed, 28 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 0980fca358..11ff0ddd90 100644 --- a/accel/tcg

[PATCH v14 03/10] accel: collecting TB execution count

2023-05-30 Thread Fei Wu
..@gmail.com> [AJB: Fix author] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/cpu-exec.c | 6 ++ accel/tcg/tb-stats.c | 6 ++ accel/tcg/tcg-runtime.c | 1 + accel/tcg/translate-all.c | 7 +-- accel/tcg/translator.c| 25

[PATCH v14 00/10] TCG code quality tracking

2023-05-30 Thread Fei Wu
v14 --- * cleanup TCGProfile in patch 04 Alex Bennée (1): tb-stats: reset the tracked TBs on a tb_flush Fei Wu (3): accel/tcg: remove CONFIG_PROFILER accel/tcg: add jit stats and time to TBStatistics docs: add tb-stats how to Vanderson M. do Rosario (6): accel/tcg: introduce

[PATCH v13 07/10] tb-stats: reset the tracked TBs on a tb_flush

2023-05-29 Thread Fei Wu
Henderson Signed-off-by: Fei Wu --- accel/tcg/tb-maint.c| 1 + accel/tcg/tb-stats.c| 19 +++ include/exec/tb-stats.h | 8 3 files changed, 28 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 0980fca358..11ff0ddd90 100644 --- a/accel/tcg

[PATCH v13 02/10] accel/tcg: introduce TBStatistics structure

2023-05-29 Thread Fei Wu
o have all present and future qemu/tcg statistics and meta-data stored in this new structure. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-2-vanderson...@gmail.com> [AJB: fix git author, review comments] Signed-off-by: Alex Bennée Signe

[PATCH v13 10/10] docs: add tb-stats how to

2023-05-29 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/devel/tcg-tbstats.rst | 129 + 1 file changed, 129 insertions(+) create mode 100644 docs/devel/tcg-tbstats.rst diff --git a/docs/devel/tcg-tbstats.rst b/docs/devel/tcg-tbstats.rst new file mode 100644 index 00

[PATCH v13 08/10] Adding info [tb-list|tb] commands to HMP (WIP)

2023-05-29 Thread Fei Wu
Acked-by: Dr. David Alan Gilbert Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-10-vanderson...@gmail.com> [AJB: fix authorship, dropped coverset] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 54 ++ acc

[PATCH v13 09/10] tb-stats: dump hot TBs at the end of the execution

2023-05-29 Thread Fei Wu
000ec1cb (id:13) Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-12-vanderson...@gmail.com> [AJB: fix authorship, ad softmmu support] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 21 + include/e

[PATCH v13 05/10] debug: add -d tb_stats to control TBStatistics collection:

2023-05-29 Thread Fei Wu
ts -d tb_stats,level=jit+time -d tb_stats,dump_limit=15 ... Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-7-vanderson...@gmail.com> [AJB: fix authorship, reword title] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 5 +

[PATCH v13 06/10] monitor: adding tb_stats hmp command

2023-05-29 Thread Fei Wu
...@gmail.com> Message-Id: <20190829173437.5926-9-vanderson...@gmail.com> [AJB: fix authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 45 + accel/tcg/tb-stats.c | 121 +- hmp-commands.

[PATCH v13 01/10] accel/tcg: remove CONFIG_PROFILER

2023-05-29 Thread Fei Wu
TBStats will be introduced to replace CONFIG_PROFILER totally, here remove all CONFIG_PROFILER related stuffs first. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 25 accel/tcg/tcg-accel-ops.c | 10

[PATCH v13 00/10] TCG code quality tracking

2023-05-29 Thread Fei Wu
on a tb_flush Fei Wu (3): accel/tcg: remove CONFIG_PROFILER accel/tcg: add jit stats and time to TBStatistics docs: add tb-stats how to Vanderson M. do Rosario (6): accel/tcg: introduce TBStatistics structure accel: collecting TB execution count debug: add -d tb_stats to control

[PATCH v13 03/10] accel: collecting TB execution count

2023-05-29 Thread Fei Wu
..@gmail.com> [AJB: Fix author] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/cpu-exec.c | 6 ++ accel/tcg/tb-stats.c | 6 ++ accel/tcg/tcg-runtime.c | 1 + accel/tcg/translate-all.c | 7 +-- accel/tcg/translator.c| 25

[PATCH v13 04/10] accel/tcg: add jit stats and time to TBStatistics

2023-05-29 Thread Fei Wu
This collects all the statistics for TBStatistics, not only for the whole emulation but for each TB. Signed-off-by: Vanderson M. do Rosario Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 20 - accel/tcg/tb-stats.c | 146

[PATCH] Makefile: add file entry to ctags

2023-05-18 Thread Fei Wu
It's more convenient to jump among files with --extra=+fq. Signed-off-by: Fei Wu --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3c7d67142f..ffb3bcd4f4 100644 --- a/Makefile +++ b/Makefile @@ -239,8 +239,8 @@ ctags

[PATCH v12 14/15] configure: remove the final bits of --profiler support

2023-05-18 Thread Fei Wu
From: Alex Bennée Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- meson.build | 2 -- meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 7 deletions(-) diff --git a/meson.build b/meson.build index 4dddccb890..4be21c9d57 100644

[PATCH v12 10/15] monitor: adding tb_stats hmp command

2023-05-18 Thread Fei Wu
...@gmail.com> Message-Id: <20190829173437.5926-9-vanderson...@gmail.com> [AJB: fix authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 45 ++ accel/tcg/tb-stats.c | 112 ++ hmp-commands.

[PATCH v12 13/15] tb-stats: dump hot TBs at the end of the execution

2023-05-18 Thread Fei Wu
000ec1cb (id:13) Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-12-vanderson...@gmail.com> [AJB: fix authorship, ad softmmu support] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 21 + include/e

[PATCH v12 01/15] accel/tcg: introduce TBStatistics structure

2023-05-18 Thread Fei Wu
o have all present and future qemu/tcg statistics and meta-data stored in this new structure. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-2-vanderson...@gmail.com> [AJB: fix git author, review comments] Signed-off-by: Alex Bennée Signe

[PATCH v12 04/15] accel: replacing part of CONFIG_PROFILER with TBStats

2023-05-18 Thread Fei Wu
odeQuality#Overheads. Reviewed-by: Alex Bennée Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-5-vanderson...@gmail.com> [AJB: fix authorship, use prof structure] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 99 ++

[PATCH v12 15/15] docs/tb-stats: add how to

2023-05-18 Thread Fei Wu
Signed-off-by: Fei Wu --- docs/tb-stats.txt | 116 ++ 1 file changed, 116 insertions(+) create mode 100644 docs/tb-stats.txt diff --git a/docs/tb-stats.txt b/docs/tb-stats.txt new file mode 100644 index 00..2f96ebb741 --- /dev/null +++ b/docs

[PATCH v12 11/15] tb-stats: reset the tracked TBs on a tb_flush

2023-05-18 Thread Fei Wu
Henderson Signed-off-by: Fei Wu --- accel/tcg/tb-maint.c| 1 + accel/tcg/tb-stats.c| 19 +++ include/exec/tb-stats.h | 8 3 files changed, 28 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 0980fca358..11ff0ddd90 100644 --- a/accel/tcg

[PATCH v12 03/15] accel: collecting JIT statistics

2023-05-18 Thread Fei Wu
6-4-vanderson...@gmail.com> Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/translate-all.c | 29 +++-- accel/tcg/translator.c| 3 +++ include/exec/tb-stats-flags.h | 1 + include/exec/tb-stats.h | 23 +++ i

[PATCH v12 09/15] debug: add -d tb_stats to control TBStatistics collection:

2023-05-18 Thread Fei Wu
ts -d tb_stats,level=jit+time -d tb_stats,dump_limit=15 ... Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-7-vanderson...@gmail.com> [AJB: fix authorship, reword title] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 5 +

[PATCH v12 07/15] accel/tcg: convert profiling of code generation to TBStats

2023-05-18 Thread Fei Wu
. Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/tb-stats.c | 33 --- accel/tcg/translate-all.c | 69 ++- include/exec/tb-stats.h | 7 include/tcg/tcg.h | 14 tcg/tcg.c | 17

[PATCH v12 08/15] accel: adding TB_JIT_TIME and full replacing CONFIG_PROFILER

2023-05-18 Thread Fei Wu
do Rosario Message-Id: <20190829173437.5926-6-vanderson...@gmail.com> [AJB: fix authorship] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c| 25 -- accel/tcg/tb-stats.c | 78 + accel/tcg/tcg-accel-ops.c | 15 +++---

[PATCH v12 12/15] Adding info [tb-list|tb] commands to HMP (WIP)

2023-05-18 Thread Fei Wu
Acked-by: Dr. David Alan Gilbert Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-10-vanderson...@gmail.com> [AJB: fix authorship, dropped coverset] Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 54 ++ acc

[PATCH v12 06/15] accel/tcg: convert profiling of restore operations to TBStats

2023-05-18 Thread Fei Wu
From: Alex Bennée This starts the conversion of CONFIG_PROFILER data collection to under the TBStats system. We introduce a new flag TB_JIT_TIME and start tracking how much time is spent restoring execution state from a given TB. Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg

[PATCH v12 05/15] accel/tcg: move profiler dev_time to tb_stats

2023-05-18 Thread Fei Wu
From: Alex Bennée This shouldn't live in the monitor code anyway. While we are at it make it an uint64_t as we won't be dealing in negative numbers. Signed-off-by: Alex Bennée Signed-off-by: Fei Wu --- accel/tcg/monitor.c | 2 -- accel/tcg/tb-stats.c | 2 ++ include/qemu/timer.h | 2 +- 3

[PATCH v12 02/15] accel: collecting TB execution count

2023-05-18 Thread Fei Wu
a TB. The execution count of the TB is stored in its respective TBS. All TBStatistics are created by default with the flags from default_tbstats_flag. Signed-off-by: Vanderson M. do Rosario Message-Id: <20190829173437.5926-3-vanderson...@gmail.com> [AJB: Fix author] Signed-off-by: Alex Ben

[PATCH v12 00/15] TCG code quality tracking

2023-05-18 Thread Fei Wu
v12 --- * fix some CI issues, including make do-meson-check and build * move part of patch 9 to 1 * fix inverse_sort_tbs * use normal ++ instead of qatomic_inc for stats->executions.normal * add how to for tb-stats * append Fei Wu to Signed-off-by Alex Bennée (5): accel/tcg: move profi

[PATCH v11 14/14] configure: remove the final bits of --profiler support

2023-04-21 Thread Fei Wu
From: Alex Bennée Signed-off-by: Alex Bennée --- meson.build | 2 -- meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 7 deletions(-) diff --git a/meson.build b/meson.build index 29f8644d6d..27627199d7 100644 --- a/meson.build +++

[PATCH v11 12/14] Adding info [tb-list|tb] commands to HMP (WIP)

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" These commands allow the exploration of TBs generated by the TCG. Understand which one hotter, with more guest/host instructions... and examine their guest, host and IR code. The goal of this command is to allow the dynamic exploration of TCG behavior and code

[PATCH v11 09/14] debug: add -d tb_stats to control TBStatistics collection:

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" -d tb_stats[[,level=(+all+jit+exec+time)][,dump_limit=]] "dump_limit" is used to limit the number of dumped TBStats in linux-user mode. [all+jit+exec+time] control the profilling level used by the TBStats. Can be used as follow: -d tb_stats -d

[PATCH v11 11/14] tb-stats: reset the tracked TBs on a tb_flush

2023-04-21 Thread Fei Wu
From: Alex Bennée We keep track of translations but can only do so up until the translation cache is flushed. At that point we really have no idea if we can re-create a translation because all the active tracking information has been reset. Signed-off-by: Alex Bennée Reviewed-by: Richard

[PATCH v11 04/14] accel: replacing part of CONFIG_PROFILER with TBStats

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" We add some of the statistics collected in the TCGProfiler into the TBStats, having the statistics not only for the whole emulation but for each TB. Then, we removed these stats from TCGProfiler and reconstruct the information for the "info jit" using the sum of

[PATCH v11 10/14] monitor: adding tb_stats hmp command

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" Adding tb_stats [start|pause|stop|filter] command to hmp. This allows controlling the collection of statistics. It is also possible to set the level of collection: all, jit, or exec. tb_stats filter allow to only collect statistics for the TB in the last_search

[PATCH v11 13/14] tb-stats: dump hot TBs at the end of the execution

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" Dump the hottest TBs if -d tb_stats,dump_limit=N is used. Example of output for the 3 hottest TBs: TB id:1 | phys:0x34d54 virt:0x00034d54 flags:0xf0 | exec:4828932/0 guest inst cov:16.38% | trans:1 ints: g:3 op:82 op_opt:34 spills:3

[PATCH v11 07/14] accel/tcg: convert profiling of code generation to TBStats

2023-04-21 Thread Fei Wu
From: Alex Bennée We continue the conversion of CONFIG_PROFILER data to TBStats by measuring the time it takes to generate code. Instead of calculating elapsed time as we do we simply store key timestamps in the profiler structure and then calculate the totals and add them to TBStats under lock.

[PATCH v11 06/14] accel/tcg: convert profiling of restore operations to TBStats

2023-04-21 Thread Fei Wu
From: Alex Bennée This starts the conversion of CONFIG_PROFILER data collection to under the TBStats system. We introduce a new flag TB_JIT_TIME and start tracking how much time is spent restoring execution state from a given TB. Signed-off-by: Alex Bennée --- accel/tcg/translate-all.c | 23

[PATCH v11 08/14] accel: adding TB_JIT_TIME and full replacing CONFIG_PROFILER

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" Replace all others CONFIG_PROFILER statistics and migrate it to TBStatistics system. However, TCGProfiler still exists and can be use to store global statistics and times. All TB related statistics goes to TBStatistics. Signed-off-by: Vanderson M. do Rosario

[PATCH v11 05/14] accel/tcg: move profiler dev_time to tb_stats

2023-04-21 Thread Fei Wu
From: Alex Bennée This shouldn't live in the monitor code anyway. While we are at it make it an uint64_t as we won't be dealing in negative numbers. Signed-off-by: Alex Bennée --- accel/tcg/monitor.c | 2 -- accel/tcg/tb-stats.c | 2 ++ include/qemu/timer.h | 2 +- 3 files changed, 3

[PATCH v11 03/14] accel: collecting JIT statistics

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" If a TB has a TBS (TBStatistics) with the TB_JIT_STATS enabled then we collect statistics of its translation processes and code translation. To help with collection we include the TCGProfile structure unconditionally. It will have further alterations in future

[PATCH v11 01/14] accel/tcg: introduce TBStatistics structure

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" To store statistics for each TB, we created a TBStatistics structure which is linked with the TBs. TBStatistics can stay alive after tb_flush and be relinked to a regenerated TB. So the statistics can be accumulated even through flushes. The goal is to have all

[PATCH v11 02/14] accel: collecting TB execution count

2023-04-21 Thread Fei Wu
From: "Vanderson M. do Rosario" If a TB has a TBS (TBStatistics) with the TB_EXEC_STATS enabled, then we instrument the start code of this TB to atomically count the number of times it is executed. We count both the number of "normal" executions and atomic executions of a TB. The execution

[PATCH v11 00/14] TCG code quality tracking

2023-04-21 Thread Fei Wu
This patch series were done by Vanderson and Alex originally in 2019, I (Fei Wu) rebased them on latest upstream from: https://github.com/stsquad/qemu/tree/tcg/tbstats-and-perf-v10 and send out this review per Alex's request, I will continue to address any future review comments here. As it's

[PATCH 1/2] accel/tcg/plugin: export host insn size

2023-04-05 Thread Fei Wu
, instruction size is still a valid estimation. Signed-off-by: Fei Wu --- accel/tcg/plugin-gen.c | 1 + include/qemu/plugin.h| 2 ++ include/qemu/qemu-plugin.h | 8 plugins/api.c| 5 + plugins/qemu-plugins.symbols | 1 + 5 files changed, 17 insertions

[PATCH 2/2] plugins/hotblocks: add host insn size

2023-04-05 Thread Fei Wu
It's only valid when inline=false, otherwise it's default to 0. Signed-off-by: Fei Wu --- contrib/plugins/hotblocks.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 062200a7a4

[PATCH 0/2] accel/tcg/plugin: host insn size for plugin

2023-04-05 Thread Fei Wu
135 0x8041abd0, 1, 1, 46032689, 123 0x8041ab3c, 1, 1, 46021650, 123 0x8045ffe8, 1, 5, 40927215, 328 Fei Wu (2): accel/tcg/plugin: export host insn size plugins/hotblocks: add host insn size accel/tcg/plugin-gen.c | 1 + contrib/plugins/hotblocks.c |

[PATCH v5 2/2] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-24 Thread Fei Wu
to flush tlb anymore when SUM changes. This is similar to how ARM handles Privileged Access Never (PAN). Result of 'pipe 10' from unixbench boosts from 223656 to 1705006. Many other syscalls benefit a lot from this too. Signed-off-by: Fei Wu --- target/riscv/cpu.h | 1 - target

[PATCH v5 0/2] target/riscv: reduce MSTATUS_SUM overhead

2023-03-24 Thread Fei Wu
v4 -> v5: * add priv to tb_flags v3 -> v4: * seperate priv from mmu_idx * use index 2 for S+SUM mmu_idx * no tlb_flush for MPRV / MPP changes Fei Wu (2): target/riscv: separate priv from mmu_idx target/riscv: reduce overhead of MSTATUS_SUM change target/riscv

[PATCH v5 1/2] target/riscv: separate priv from mmu_idx

2023-03-24 Thread Fei Wu
Currently it's assumed the 2 low bits of mmu_idx map to privilege mode, this assumption won't last as we are about to add more mmu_idx. Here an individual priv field is added into TB_FLAGS. Signed-off-by: Fei Wu --- target/riscv/cpu.h | 2 +- target/riscv

[PATCH v4 0/2] target/riscv: reduce MSTATUS_SUM overhead

2023-03-22 Thread Fei Wu
v3 -> v4: * seperate priv from mmu_idx * use index 2 for S+SUM mmu_idx * no tlb_flush for MPRV / MPP changes Fei Wu (2): target/riscv: separate priv from mmu_idx target/riscv: reduce overhead of MSTATUS_SUM change target/riscv/cpu.h| 2 -- target/ri

[PATCH v4 2/2] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Fei Wu
to flush tlb anymore when SUM changes. This is similar to how ARM handles Privileged Access Never (PAN). Result of 'pipe 10' from unixbench boosts from 223656 to 1705006. Many other syscalls benefit a lot from this too. Signed-off-by: Fei Wu --- target/riscv/cpu.h | 1 - target

[PATCH v4 1/2] target/riscv: separate priv from mmu_idx

2023-03-22 Thread Fei Wu
Currently it's assumed the 2 low bits of mmu_idx map to privilege mode, this assumption won't last as we are about to add more mmu_idx. Signed-off-by: Fei Wu --- target/riscv/cpu.h | 1 - target/riscv/cpu_helper.c | 2 +- target/riscv/insn_trans

[PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Fei Wu
to flush tlb anymore when SUM changes. This is similar to how ARM handles Privileged Access Never (PAN). Result of 'pipe 10' from unixbench boosts from 223656 to 1705006. Many other syscalls benefit a lot from this too. Signed-off-by: Fei Wu --- target/riscv/cpu-param.h | 2 +- target/riscv/cpu.h

[PATCH v2] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-21 Thread Fei Wu
. It's not necessary to save/restore these new added status, as tlb_flush() is always called after restore. Result of 'pipe 10' from unixbench boosts from 223656 to 1327407. Many other syscalls benefit a lot from this one too. Signed-off-by: Fei Wu Reviewed-by: LIU Zhiwei Reviewed-by: Weiwei Li