From: Christopher Covington <cov@codeaurora.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Aaron Lindsay <alindsay@codeaurora.org>,
qemu-trivial@nongnu.org,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
qemu-devel@nongnu.org,
Alistair Francis <alistair.francis@xilinx.com>,
Christopher Covington <cov@codeaurora.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-trivial] [PATCH] Rename cpu_get_icount_{locked,biased}
Date: Wed, 10 Feb 2016 09:06:32 -0500 [thread overview]
Message-ID: <1455113192-27139-1-git-send-email-cov@codeaurora.org> (raw)
The function does not provide locking but rather adds a bias value.
Signed-off-by: Christopher Covington <cov@codeaurora.org>
---
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);
}
--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: Christopher Covington <cov@codeaurora.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Aaron Lindsay <alindsay@codeaurora.org>,
qemu-trivial@nongnu.org,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
qemu-devel@nongnu.org,
Alistair Francis <alistair.francis@xilinx.com>,
Christopher Covington <cov@codeaurora.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] Rename cpu_get_icount_{locked,biased}
Date: Wed, 10 Feb 2016 09:06:32 -0500 [thread overview]
Message-ID: <1455113192-27139-1-git-send-email-cov@codeaurora.org> (raw)
The function does not provide locking but rather adds a bias value.
Signed-off-by: Christopher Covington <cov@codeaurora.org>
---
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);
}
--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next reply other threads:[~2016-02-10 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 14:06 Christopher Covington [this message]
2016-02-10 14:06 ` [Qemu-devel] [PATCH] Rename cpu_get_icount_{locked,biased} Christopher Covington
2016-02-10 14:13 ` [Qemu-trivial] " Paolo Bonzini
2016-02-10 14:13 ` [Qemu-devel] " Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455113192-27139-1-git-send-email-cov@codeaurora.org \
--to=cov@codeaurora.org \
--cc=alindsay@codeaurora.org \
--cc=alistair.francis@xilinx.com \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.