Skip to content

ppc: record-replay enablement and fixes

Nicholas Piggin qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 14 repliesIn review
  2. v17 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19ppc/vhyp: reset exception state when handling vhyp hcalltarget/ppc/excp_helper.c+3 -00 replies
2/19ppc/vof: Fix missed fields in VOF cleanuphw/ppc/vof.c+2 -01 reply
3/19hw/ppc/ppc.c: Tidy over-long lineshw/ppc/ppc.c+12 -70 replies
4/19hw/ppc: Introduce functions for conversion between timebase and nanosecondshw/ppc/ppc.c+18 -100 replies
5/19host-utils: Add muldiv64_round_upinclude/qemu/host-utils.h+20 -18 replies
6/19hw/ppc: Round up the decrementer interval when converting to nshw/ppc/ppc.c+19 -120 replies
7/19hw/ppc: Avoid decrementer rounding errorshw/ppc/ppc.c+24 -150 replies
8/19target/ppc: Sign-extend large decrementer to 64-bitshw/ppc/ppc.c+6 -22 replies
9/19hw/ppc: Always store the decrementer valuehw/ppc/ppc.c+10 -100 replies
10/19target/ppc: Migrate DECR SPRtarget/ppc/machine.c+14 -02 replies
11/19hw/ppc: Reset timebase facilities on machine resethw/ppc/mac_oldworld.c hw/ppc/pegasos2.c hw/ppc/pnv_core.c +4 more+35 -210 replies
12/19hw/ppc: Read time only once to perform decrementer writehw/ppc/ppc.c+53 -310 replies
13/19target/ppc: Fix CPU reservation migration for record-replaytarget/ppc/cpu.h target/ppc/machine.c target/ppc/translate.c+30 -20 replies
14/19target/ppc: Fix timebase reset with record-replayhw/ppc/ppc.c+9 -20 replies
15/19spapr: Fix machine reset deadlock from replay-recordhw/ppc/spapr.c include/hw/ppc/spapr.h target/ppc/compat.c +1 more+39 -20 replies
16/19spapr: Fix record-replay machine reset consuming too many eventshw/ppc/spapr.c include/hw/ppc/spapr.h+10 -30 replies
17/19tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mounttests/avocado/replay_kernel.py+1 -20 replies
18/19tests/avocado: reverse-debugging cope with re-executing breakpointstests/avocado/reverse_debugging.py+21 -40 replies
19/19tests/avocado: ppc64 reverse debugging tests for pseries and powernvtests/avocado/reverse_debugging.py+29 -00 replies

Reviews trailers per patch

8 of 19 patches have a Reviewed-by or Acked-by.

PatchPavel DovgalyukAlexey KardashevskiyRichard Henderson
1/19
2/19R-b
3/19
4/19
5/19R-b
6/19
7/19
8/19
9/19
10/19
11/19
12/19
13/19A-b
14/19R-b
15/19
16/19A-b
17/19A-b
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 for-8.2 00/19] ppc: record-replay enablement and fixes

The patches in this series has been seen a few times in various iterations.

There are two main pieces, some assorted small fixes and tests for record-replay, plus a large set of decrementer fixes. I merged these into one series rather than send decrementer fixes alone first, because record-replay has been very good at uncovering timer problems, so it's good to have those test cases in at the same time IMO.

Some of the fixes we might take to stable, but unclear which. Decrementer fixes were a bit of a tangle so maybe we just leave those alone since they work okay.

The decrementer is not emulated perfectly still. Underflow from -ve to +ve is not implemented, for one. I started doing that but it's not trivial so better stop here for now.

For record-replay, pseries is now quite solid with rr. Surely some issues to iron out but it is becoming usable.

powernv record-replay has some known problems migrating edge-triggered decrementer, and edge triggered msgsnd. Also it seems to get stuck in xive init somewhere when replaying from checkpoint, so there is probably some state in xive not being reset. But at least it runs the avocado test and seems close to working, so I've added that test case so we don't go backwards (ha!).

Other machine types might not be too far off if there is interest. I found it quite difficult to find these problems though, reverse debugging will sometimes just lock up, stop at wrong location, or abort with wrong event. Difficult understand what went wrong. Worst case I had to basically bisect the replay of the trace, and find the minimum length of replay that hit the problem -- that sometimes would land near a mtDEC or timer interrupt or similar.

Thanks,
Nick

Nicholas Piggin (19):
ppc/vhyp: reset exception state when handling vhyp hcall ppc/vof: Fix missed fields in VOF cleanup
hw/ppc/ppc.c: Tidy over-long lines
hw/ppc: Introduce functions for conversion between timebase and
nanoseconds
host-utils: Add muldiv64_round_up
hw/ppc: Round up the decrementer interval when converting to ns hw/ppc: Avoid decrementer rounding errors
target/ppc: Sign-extend large decrementer to 64-bits hw/ppc: Always store the decrementer value
target/ppc: Migrate DECR SPR
hw/ppc: Reset timebase facilities on machine reset hw/ppc: Read time only once to perform decrementer write target/ppc: Fix CPU reservation migration for record-replay target/ppc: Fix timebase reset with record-replay
spapr: Fix machine reset deadlock from replay-record
spapr: Fix record-replay machine reset consuming too many events tests/avocado: boot ppc64 pseries replay-record test to Linux VFS
mount
tests/avocado: reverse-debugging cope with re-executing breakpoints tests/avocado: ppc64 reverse debugging tests for pseries and powernv

 hw/ppc/mac_oldworld.c              |   1 +
 hw/ppc/pegasos2.c                  |   1 +
 hw/ppc/pnv_core.c                  |   2 +
 hw/ppc/ppc.c                       | 236 +++++++++++++++++++----------
 hw/ppc/prep.c                      |   1 +
 hw/ppc/spapr.c                     |  32 +++-
 hw/ppc/spapr_cpu_core.c            |   2 +
 hw/ppc/vof.c                       |   2 +
 include/hw/ppc/ppc.h               |   3 +-
 include/hw/ppc/spapr.h             |   2 +
 include/qemu/host-utils.h          |  21 ++-
 target/ppc/compat.c                |  19 +++
 target/ppc/cpu.h                   |   3 +
 target/ppc/excp_helper.c           |   3 +
 target/ppc/machine.c               |  40 ++++-
 target/ppc/translate.c             |   4 +
 tests/avocado/replay_kernel.py     |   3 +-
 tests/avocado/reverse_debugging.py |  54 ++++++-
 18 files changed, 330 insertions(+), 99 deletions(-)
Signature · 1 line
2.40.1