From nobody Fri May 3 10:45:37 2024 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.zoho.com; dkim=fail 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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492543197704675.105185630414; Tue, 18 Apr 2017 12:19:57 -0700 (PDT) Received: from localhost ([::1]:43565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0YfM-0006Oj-3R for importer@patchew.org; Tue, 18 Apr 2017 15:19:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0YeD-0005oB-0O for qemu-devel@nongnu.org; Tue, 18 Apr 2017 15:18:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Ye7-0004sm-W5 for qemu-devel@nongnu.org; Tue, 18 Apr 2017 15:18:44 -0400 Received: from mail-yb0-x243.google.com ([2607:f8b0:4002:c09::243]:35489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0Ye7-0004sV-Qy for qemu-devel@nongnu.org; Tue, 18 Apr 2017 15:18:39 -0400 Received: by mail-yb0-x243.google.com with SMTP id 19so97715ybl.2 for ; Tue, 18 Apr 2017 12:18:39 -0700 (PDT) Received: from senna.cc.gatech.edu (senna.cc.gt.atl.ga.us. [143.215.128.17]) by smtp.gmail.com with ESMTPSA id u195sm22944ywg.54.2017.04.18.12.18.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Apr 2017 12:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=Afn34SVbequJ03x2pUkSz+1Kb+vuq8d7JaYlnXKOBNc=; b=oIsKXXN9ReIcKu7Cz03a+YI0+FgC10F6mtrXZb6yaaPKeOJMLM4muKCWHS9u87yjT6 GQZC3+9d6i51Swlxyy1RX9ZVqKITxta3UorwaoCXXdhSKWzMeidlj1xb8HkQq7cYKalw M7NdefI0ablRLt0Ige6EjL4XhR/0I7PYHnQurQvwAhjONEsoRrOLD3EhGu3RnPSq48eg GtFwgdPP3+X18abnG3fj5L6Bqf/V0voAKVy8yYxSauvpFQ8XIfCt9OL7R4s9yI1PMR+R y+jVI2WixphjhlxQSmpZt5qBSfUGcwCJ00KJXazQcS7gwEY4XQxUusQyHACHhJck90a/ OFJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Afn34SVbequJ03x2pUkSz+1Kb+vuq8d7JaYlnXKOBNc=; b=CTvFei6lzancnptXKEd8hpE/aXhMIR/si9B7a6bpTjJJqD5ucaReu96HkO3xl3gwaQ Ep4cznMQMVshkjvHmS+CjUmDB2ivkblYqSQAjjxdQ9EpCdb8x1rBvBJ9Ig+YFZach5Yv bHSJwaUo22gfcAGriuB2ZzyNjuLHy8Adfv+dIlrmLDPqT03NTc+qkMOmtoXNl/R67Q+m 9rXW2HIiGECpOmfivAhH/CeOrA43WzVFqMFiI0lYzK9FUL811Kio5OOePsIUTgXrpgF7 p1M2Wn+TkgVxal1IGsizwTU8a7B+uO4Mp83IQtlz99tfJgGIVigXbeIsxHXXD7r/TNjS O61g== X-Gm-Message-State: AN3rC/6cKHBxFSgZDDF8ZbUU5vdJelV58Aokvk/OwMkl5ijmPjO6R+56 eqKemwRLS8aPjQ== X-Received: by 10.37.248.25 with SMTP id u25mr12515926ybd.98.1492543118965; Tue, 18 Apr 2017 12:18:38 -0700 (PDT) From: Pranith Kumar To: Paolo Bonzini , Cao jin , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Michael Tokarev , "Edgar E. Iglesias" , qemu-devel@nongnu.org (open list:All patches CC here) Date: Tue, 18 Apr 2017 15:18:16 -0400 Message-Id: <20170418191817.10430-1-bobby.prani@gmail.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c09::243 Subject: [Qemu-devel] [PATCH] timer.h: Provide better monotonic time 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Tested and confirmed that the stretch i386 debian qcow2 image on a raspberry pi 2 works. Fixes: LP#: 893208 Signed-off-by: Pranith Kumar Reviewed-by: Paolo Bonzini --- include/qemu/timer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 8a1eb74839..1b518bca30 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -1020,10 +1020,9 @@ static inline int64_t cpu_get_host_ticks(void) /* The host CPU doesn't have an easily accessible cycle counter. Just return a monotonically increasing value. This will be totally wrong, but hopefully better than nothing. */ -static inline int64_t cpu_get_host_ticks (void) +static inline int64_t cpu_get_host_ticks(void) { - static int64_t ticks =3D 0; - return ticks++; + return get_clock(); } #endif =20 --=20 2.11.0