From nobody Sat May 4 16:30:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1576760412; cv=none; d=zohomail.com; s=zohoarc; b=E8JdBLk1v6eRJ+xSW7pyZVDWdgg9+MMlx/dAbk51ERLGLsr+tItKzE1hR4159bChwP+fhmjbg+ldczUq1Syhho2pHw9Z5U0Z7aRfQXhNU2cp1Wywqe1I38IgxhOf7egN6dh+cJRGgRcIBogsH1ZJ0TWubRTiMFpimwZIifHUMMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576760412; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=kANA2S2tFlcqxV9Hegh65JC3NCd7fjSJmQ9K+lHp4To=; b=U/WfZte/kBvMSZB0klu3tk4kec6q8YQD66aHDivFqktBPMWW8RdhUPkolUSKbRI/5xLpK7EaSTS9pW4vjqX4cAWnsEQBCgc96X6rEj96ymxGXWU55FWPbz4Y/ImouC9Ze93Wc1DzJ6B+854Anwk+e0n8fvvpdoAIfSHWGj+OO04= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576760412439445.1984163954762; Thu, 19 Dec 2019 05:00:12 -0800 (PST) Received: from localhost ([::1]:40536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihvPW-0005nc-AU for importer@patchew.org; Thu, 19 Dec 2019 08:00:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihvCV-0003dw-JU for qemu-devel@nongnu.org; Thu, 19 Dec 2019 07:46:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihvCT-0003GQ-In for qemu-devel@nongnu.org; Thu, 19 Dec 2019 07:46:42 -0500 Received: from mail.ispras.ru ([83.149.199.45]:35256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ihvCT-0003D9-8T for qemu-devel@nongnu.org; Thu, 19 Dec 2019 07:46:41 -0500 Received: from [127.0.1.1] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id DF007540022; Thu, 19 Dec 2019 15:46:28 +0300 (MSK) Subject: [PATCH] replay: check other timers for icount limit From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Thu, 19 Dec 2019 15:46:28 +0300 Message-ID: <157675958855.14346.18049977447896411847.stgit@pasha-Precision-3630-Tower> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Record/replay can stall when there are no virtual devices that generate events - it just uses all the time for vCPU thread. Therefore main loop has to wait too much for the vCPU thread, because they are synchronized in rr mode. This patch does not let creating too long vCPU executions without interrupting to main loop. It checks realtime timers that always exits to control user input. Signed-off-by: Pavel Dovgalyuk --- cpus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpus.c b/cpus.c index 63bda152f5..7dba4fa414 100644 --- a/cpus.c +++ b/cpus.c @@ -1388,6 +1388,10 @@ static int64_t tcg_get_icount_limit(void) */ deadline =3D qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, QEMU_TIMER_ATTR_ALL); + /* Check realtime timers, because they help with input processing = */ + deadline =3D qemu_soonest_timeout(deadline, + qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME, + QEMU_TIMER_ATTR_ALL)); =20 /* Maintain prior (possibly buggy) behaviour where if no deadline * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more= than