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: 8272301 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3A17E9F1C0 for ; Wed, 10 Feb 2016 14:07:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AC8A201C7 for ; Wed, 10 Feb 2016 14:07:03 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 96F3B203E1 for ; Wed, 10 Feb 2016 14:07:02 +0000 (UTC) Received: from localhost ([::1]:39575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTVQ5-0004ER-Va for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Feb 2016 09:07:01 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }