Skip to content

hw/riscv, target/riscv: initial e-trace support

Daniel Henrique Barboza qemu-devel qemu-riscv 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest17 patches 6 repliesIn review
  2. v117 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- patch 5:
- changed tr_compat from "ventana,veyron-v2-trace" to "qemu,trace-component"
- renamed trace encoder prop handler "cpu" to "cpus"
- patch 14:
- removed updiscon generation in gen_jal()
- v1 link: https://lore.kernel.org/qemu-riscv/[email protected]/

[1] https://lore.kernel.org/linux-riscv/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17hw/riscv: Trace Encoder initial implhw/riscv/Kconfig hw/riscv/meson.build hw/riscv/trace-encoder.c +2 more+268 -01 reply
2/17hw/riscv: Trace RAM Sink initial implhw/riscv/meson.build hw/riscv/trace-events hw/riscv/trace-ram-sink.c +1 more+351 -12 replies
3/17hw/riscv/trace-encoder: add trace start/stop logichw/riscv/trace-encoder.c hw/riscv/trace-encoder.h+111 -00 replies
4/17hw/riscv/virt.c: add trace encoders and trace ram sinkshw/riscv/virt.c include/hw/riscv/virt.h target/riscv/cpu.h +1 more+93 -00 replies
5/17hw/riscv/virt.c add trace encoder and ramsink fdt nodeshw/riscv/virt.c+58 -00 replies
6/17hw/riscv: add e-trace message helpershw/riscv/meson.build hw/riscv/rv-trace-messages.c hw/riscv/rv-trace-messages.h+121 -11 reply
7/17target/riscv: add initial trace instrumentationhw/riscv/trace-encoder.c hw/riscv/trace-encoder.h hw/riscv/trace-events +5 more+76 -10 replies
8/17hw/riscv/trace-encoder: write e-trace packets to RAM sinkhw/riscv/trace-encoder.c+121 -00 replies
9/17test/qtest: add riscv-trace-test.chw/riscv/virt.c tests/qtest/meson.build tests/qtest/riscv-trace-test.c+122 -20 replies
10/17hw/riscv/rv-trace-messages.c: add encoded trap messagehw/riscv/rv-trace-messages.c hw/riscv/rv-trace-messages.h+99 -00 replies
11/17hw/riscv, target/riscv: send trace trap messageshw/riscv/trace-encoder.c hw/riscv/trace-encoder.h target/riscv/cpu_helper.c+34 -00 replies
12/17target/riscv, hw/riscv: send trace ppccd packetshw/riscv/trace-encoder.c hw/riscv/trace-encoder.h target/riscv/cpu_helper.c+31 -10 replies
13/17hw/riscv/trace: add format2 msg helperhw/riscv/rv-trace-messages.c hw/riscv/rv-trace-messages.h+61 -00 replies
14/17hw/riscv, target/riscv: send resync updiscon trace packetshw/riscv/trace-encoder.c hw/riscv/trace-encoder.h target/riscv/helper.h +4 more+77 -00 replies
15/17hw/riscv/rv-trace-messages: add format 1 msgs with branch infohw/riscv/rv-trace-messages.c hw/riscv/rv-trace-messages.h+133 -00 replies
16/17hw/riscv/trace-encoder: send branches infohw/riscv/trace-encoder.c hw/riscv/trace-encoder.h target/riscv/helper.h +2 more+81 -10 replies
17/17hw/riscv/trace: update branch bit in sync messageshw/riscv/rv-trace-messages.c hw/riscv/rv-trace-messages.h hw/riscv/trace-encoder.c+33 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/17] hw/riscv, target/riscv: initial e-trace support

Hi,

In this v2 we're addressing a review comment from Konstantin in patch
14. We're also doing changes in the FDT (patch 5) to keep up with the changes that the kernel support is making [1].

I've been thinking about adding partial support for N-trace in this work as well. From what I can tell the difference between N-trace and E-trace are the encoding of the packages, with everything else staying the same. In this case we could add hooks in the code to be ready to support N-trace encoding in the future.

No other changes made. Patches based on current master.

Changes in v2:
- patch 5:
- changed tr_compat from "ventana,veyron-v2-trace" to "qemu,trace-component"
- renamed trace encoder prop handler "cpu" to "cpus"
- patch 14:
- removed updiscon generation in gen_jal()
- v1 link: https://lore.kernel.org/qemu-riscv/[email protected]/

[1] https://lore.kernel.org/linux-riscv/[email protected]/

Daniel Henrique Barboza (16):
hw/riscv: Trace Encoder initial impl
hw/riscv: Trace RAM Sink initial impl hw/riscv/trace-encoder: add trace start/stop logic hw/riscv/virt.c: add trace encoders and trace ram sinks hw/riscv: add e-trace message helpers
target/riscv: add initial trace instrumentation hw/riscv/trace-encoder: write e-trace packets to RAM sink test/qtest: add riscv-trace-test.c hw/riscv/rv-trace-messages.c: add encoded trap message hw/riscv, target/riscv: send trace trap messages target/riscv, hw/riscv: send trace ppccd packets hw/riscv/trace: add format2 msg helper
hw/riscv, target/riscv: send resync updiscon trace packets hw/riscv/rv-trace-messages: add format 1 msgs with branch info hw/riscv/trace-encoder: send branches info hw/riscv/trace: update branch bit in sync messages

Mayuresh Chitale (1):
hw/riscv/virt.c add trace encoder and ramsink fdt nodes

 hw/riscv/Kconfig                              |   5 +
 hw/riscv/meson.build                          |   2 +
 hw/riscv/rv-trace-messages.c                  | 373 +++++++++++
 hw/riscv/rv-trace-messages.h                  |  40 ++
 hw/riscv/trace-encoder.c                      | 609 ++++++++++++++++++
 hw/riscv/trace-encoder.h                      |  62 ++
 hw/riscv/trace-events                         |   9 +
 hw/riscv/trace-ram-sink.c                     | 263 ++++++++
 hw/riscv/trace-ram-sink.h                     |  83 +++
 hw/riscv/virt.c                               | 135 ++++
 include/hw/riscv/virt.h                       |   2 +
 target/riscv/cpu.h                            |  11 +
 target/riscv/cpu_helper.c                     |  26 +-
 target/riscv/helper.h                         |   6 +
 .../riscv/insn_trans/trans_privileged.c.inc   |  11 +
 target/riscv/insn_trans/trans_rvi.c.inc       |  15 +
 target/riscv/meson.build                      |   3 +-
 target/riscv/tcg/tcg-cpu.c                    |   5 +
 target/riscv/trace_helper.c                   |  62 ++
 target/riscv/translate.c                      |  19 +
 tests/qtest/meson.build                       |   2 +-
 tests/qtest/riscv-trace-test.c                | 120 ++++
 22 files changed, 1860 insertions(+), 3 deletions(-)
 create mode 100644 hw/riscv/rv-trace-messages.c
 create mode 100644 hw/riscv/rv-trace-messages.h
 create mode 100644 hw/riscv/trace-encoder.c
 create mode 100644 hw/riscv/trace-encoder.h
 create mode 100644 hw/riscv/trace-ram-sink.c
 create mode 100644 hw/riscv/trace-ram-sink.h
 create mode 100644 target/riscv/trace_helper.c
 create mode 100644 tests/qtest/riscv-trace-test.c
Signature · 1 line
2.51.1