From patchwork Tue Apr 18 19:18:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9686101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 791F1602C9 for ; Tue, 18 Apr 2017 19:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 682D82832D for ; Tue, 18 Apr 2017 19:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CDBD2835B; Tue, 18 Apr 2017 19:19:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E19CC2832D for ; Tue, 18 Apr 2017 19:19:37 +0000 (UTC) Received: from localhost ([::1]:43563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Yf3-0005pM-57 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Apr 2017 15:19:37 -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) 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) 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) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 = 0; - return ticks++; + return get_clock(); } #endif