diff mbox series

um: virtio_uml: fix time-travel external time propagation

Message ID 20210913101651.cdb4485c257e.I6268ef8a313d80008f422b7ac8b52cb52554d636@changeid
State Superseded
Headers show
Series um: virtio_uml: fix time-travel external time propagation | expand

Commit Message

Johannes Berg Sept. 13, 2021, 8:16 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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. Call
time_travel_propagate_time() to do this before making the
socket connection.

Apparently, due to the remote side in my use cases using
only 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>
---
 arch/um/drivers/virtio_uml.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
index d51e445df797..860b7430bcff 100644
--- a/arch/um/drivers/virtio_uml.c
+++ b/arch/um/drivers/virtio_uml.c
@@ -1136,6 +1136,8 @@  static int virtio_uml_probe(struct platform_device *pdev)
 	vu_dev->pdev = pdev;
 	vu_dev->req_fd = -1;
 
+	time_travel_propagate_time();
+
 	do {
 		rc = os_connect_socket(pdata->socket_path);
 	} while (rc == -EINTR);