icount: don't adjust virtual time backwards after warp
RFC PATCH 1/1 icount: don't adjust virtual time backwards after warp
With icount shift=auto, the QEMU_CLOCK_VIRTUAL can be adjusted backwards after a warp, resulting in the machine observing time going backwards. Linux on powerpc can't handle this, and it results in lockup due to a time delta underflowing.
This patch seems to solve it, no more backwards time observed. Is it a reasonable way to address it?
Thanks,
Nick
--- softmmu/icount.c | 3 +++ 1 file changed, 3 insertions(+)
softmmu/icount.c +3 -0
@@ -273,6 +273,9 @@ static void icount_warp_rt(void)*/ int64_t cur_icount =icount_get_locked ();int64_t delta = clock - cur_icount; +if (delta <0 ) { + warp_delta =0 ; + } warp_delta =MIN (warp_delta, delta); } qatomic_set_i64(&timers_state.qemu_icount_bias,
Signature · 1 line
2.40.1
Paolo Bonzini
AppliedQueued, thanks.
Paolo
Quoted 1 line · Paolo Bonzini
Queued, thanks.
Hmm, almost, can you provide the Signed-off-by?
Thanks,
Paolo
Quoted 4 lines · Paolo Bonzini
Quoted 1 line · Paolo Bonzini
Queued, thanks.
Hmm, almost, can you provide the Signed-off-by?
Sure, give me a bit and I'll make up a better changelog and patch.
Thanks,
Nick