um: virtio_uml: Fix time-travel external time propagation
authorJohannes Berg <johannes.berg@intel.com>
Thu, 16 Sep 2021 11:09:22 +0000 (13:09 +0200)
committerRichard Weinberger <richard@nod.at>
Tue, 21 Dec 2021 20:29:30 +0000 (21:29 +0100)
commit85e73968a040c642fd38f6cba5b73b61f5d0f052
tree4f092ae8b992d08d18e2da50022e25f0a98fb3b4
parent4e8a5edac5010820e7c5303fc96f5a262e096bb6
um: virtio_uml: Fix time-travel external time propagation

When creating an external event, the current time needs to
be propagated to other participants of a simulation. This
is done in the places here where we kick a virtq etc.

However, it must be done for _all_ external events, and
that includes making the initial socket connection and
later closing it. Call time_travel_propagate_time() to do
this before making or closing the socket connection.

Apparently, at least for the initial connection creation,
due to the remote side in my use cases using microseconds
(rather than nanoseconds), this wasn't a problem yet; only
started failing between 5.14-rc1 and 5.15-rc1 (didn't test
others much), or possibly depending on the configuration,
where more delays happen before the virtio devices are
initialized.

Fixes: 88ce64249233 ("um: Implement time-travel=ext")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/virtio_uml.c