From patchwork Wed Feb 10 14:06:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Covington X-Patchwork-Id: 581423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5B2B8140B96 for ; Thu, 11 Feb 2016 01:07:20 +1100 (AEDT) Received: from localhost ([::1]:39577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTVQM-0004mp-Bl for incoming@patchwork.ozlabs.org; Wed, 10 Feb 2016 09:07:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTVPv-0004CO-FV for qemu-devel@nongnu.org; Wed, 10 Feb 2016 09:06:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTVPq-0001BO-CP for qemu-devel@nongnu.org; Wed, 10 Feb 2016 09:06:51 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTVPq-0001BK-6c; Wed, 10 Feb 2016 09:06:46 -0500 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 7DE0D60246; Wed, 10 Feb 2016 14:06:45 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4F2E260351; Wed, 10 Feb 2016 14:06:45 +0000 (UTC) Received: from keeshans.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cov@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 087A760246; Wed, 10 Feb 2016 14:06:40 +0000 (UTC) From: Christopher Covington To: Date: Wed, 10 Feb 2016 09:06:32 -0500 Message-Id: <1455113192-27139-1-git-send-email-cov@codeaurora.org> X-Mailer: git-send-email 1.8.1.1 X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.145.29.96 Cc: Peter Maydell , Aaron Lindsay , qemu-trivial@nongnu.org, Peter Crosthwaite , qemu-devel@nongnu.org, Alistair Francis , Christopher Covington , Paolo Bonzini , Richard Henderson Subject: [Qemu-devel] [PATCH] Rename cpu_get_icount_{locked,biased} X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The function does not provide locking but rather adds a bias value. Signed-off-by: Christopher Covington --- cpus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 898426c..50403c4 100644 --- a/cpus.c +++ b/cpus.c @@ -164,7 +164,7 @@ int64_t cpu_get_icount_raw(void) } /* Return the virtual CPU time, based on the instruction counter. */ -static int64_t cpu_get_icount_locked(void) +static int64_t cpu_get_icount_biased(void) { int64_t icount = cpu_get_icount_raw(); return timers_state.qemu_icount_bias + cpu_icount_to_ns(icount); @@ -177,7 +177,7 @@ int64_t cpu_get_icount(void) do { start = seqlock_read_begin(&timers_state.vm_clock_seqlock); - icount = cpu_get_icount_locked(); + icount = cpu_get_icount_biased(); } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start)); return icount; @@ -293,7 +293,7 @@ static void icount_adjust(void) seqlock_write_lock(&timers_state.vm_clock_seqlock); cur_time = cpu_get_clock_locked(); - cur_icount = cpu_get_icount_locked(); + cur_icount = cpu_get_icount_biased(); delta = cur_icount - cur_time; /* FIXME: This is a very crude algorithm, somewhat prone to oscillation. */ @@ -356,7 +356,7 @@ static void icount_warp_rt(void) * In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too * far ahead of real time. */ - int64_t cur_icount = cpu_get_icount_locked(); + int64_t cur_icount = cpu_get_icount_biased(); int64_t delta = clock - cur_icount; warp_delta = MIN(warp_delta, delta); }