From patchwork Mon Sep 13 08:16:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1527245 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=blP11gya; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=TKcy5CzP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H7K9F0qhXz9sf8 for ; Mon, 13 Sep 2021 18:17:53 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=S3xyBqJx4mrURdTXmMRYvM4LAi3bd6e69MIUojEVKC8=; b=blP11gya0274VK 6IEfbAtCLSr4lDrqepRW87E5sHKJ82Tn3VswHjdW8F0ncToqErvjSEvp3AqYQsPLI9pM5Aw14FEmN uZZ7qNBxBcEbaWDPiw/HSUekziaGpdGsfEmKQ1w/LTqAmS96vW/KZK916IzuzV0n6bBPevPsU8hxL pxUu+IcpxdhkcTulpKIHzGlsJXBTeEga+5uapYjpAWtCySEQdOSo0YSPuYcBvAL2lVwFtAnaIDJZV XAv6x1Ls9EScbNQ/6TVm9uQh2nGle7muxwFi/fRMq3TCgj5rvr31IGph+n/Y68PvERIwfGkBkblPX Yux/9qcCMffO+fxIanyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPh9m-000goN-3L; Mon, 13 Sep 2021 08:17:38 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPh9Q-000gZJ-CD for linux-um@lists.infradead.org; Mon, 13 Sep 2021 08:17:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=wA+yRMeZD2c9EJSkef77AX+PMIOEOXl7QJlSlAY+zTM=; t=1631521033; x=1632730633; b=TKcy5CzPXIwuuJd6RNFC/Kx3qBJQDq35RdmiHvs1QU8+gxSszp+2F1PWm38lK/fja7VJwCgdE0v ic32ZcK15XDOPAcA2puFZ7/gOYFz+3olhY2TKrA5oGpv/AdOVebVTSVtLdZbefG3X33HqyP0lPsCd kCxI1z3Gc0KPi8uleBYgaGBXdWDNKgONz5isybypAzzPFstobVAtM/nnMfqTeJBKAnf5T41cFj/1S Nv5qTJutdbmTMkpV6NHwqyfQiaIVH+XOUTRI+pzE95ZcE2HUwL3b8yRDvjmcmKDKtJIWSdhzrV4cV tFpKHsMmXnABRwh7PGYPFMNFfTBip12qUv4A==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95-RC2) (envelope-from ) id 1mPh9L-006Jf6-Hp; Mon, 13 Sep 2021 10:17:11 +0200 From: Johannes Berg To: linux-um@lists.infradead.org Cc: Johannes Berg Subject: [PATCH] um: virtio_uml: fix time-travel external time propagation Date: Mon, 13 Sep 2021 10:16:55 +0200 Message-Id: <20210913101651.cdb4485c257e.I6268ef8a313d80008f422b7ac8b52cb52554d636@changeid> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_011716_459317_D1942987 X-CRM114-Status: GOOD ( 11.62 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg 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. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg 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 --- arch/um/drivers/virtio_uml.c | 2 ++ 1 file changed, 2 insertions(+) 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);