From nobody Thu Nov 6 06:16:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539767594816492.29913248846367; Wed, 17 Oct 2018 02:13:14 -0700 (PDT) Received: from localhost ([::1]:34789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gChtB-0004l9-KI for importer@patchew.org; Wed, 17 Oct 2018 05:13:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCho5-0001JU-FF for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:07:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCho2-000149-Tw for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:07:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCho2-000127-Lk for qemu-devel@nongnu.org; Wed, 17 Oct 2018 05:07:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C53F3002946; Wed, 17 Oct 2018 09:07:53 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1C5D413D; Wed, 17 Oct 2018 09:07:51 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2018 11:07:50 +0200 Message-Id: <20181017090750.4378-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 17 Oct 2018 09:07:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] Revert "icount: remove obsolete warp call" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artem Pisarenko , Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" QEMU running with options "-icount,sleep=3Doff -rtc clock=3Dvm" doesn't execute emulation at maximum possible speed. Target virtual clock may run faster or slower than realtime clock by N times, where N value depends on various unrelated conditions (i.e. random from the user point of view), or possibly the target hangs completely. Bisection shows commit 281b2201e4 ("icount: remove obsolete warp call", 2016-03-15) to be the culprit, revert it. Suggested-by: Artem Pisarenko Signed-off-by: Paolo Bonzini --- cpus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpus.c b/cpus.c index 361678e459..2872e7e37c 100644 --- a/cpus.c +++ b/cpus.c @@ -1224,6 +1224,10 @@ static void qemu_tcg_rr_wait_io_event(CPUState *cpu) { while (all_cpu_threads_idle()) { stop_tcg_kick_timer(); + + /* Start accounting real time to the virtual clock if the CPUs + are idle. */ + qemu_clock_warp(QEMU_CLOCK_VIRTUAL); qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); } =20 --=20 2.17.1