From: Christopher Covington <cov@codeaurora.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Zack Callendish <daajjall@gmail.com>,
893208@bugs.launchpad.net,
Christopher Covington <cov@codeaurora.org>
Subject: [Qemu-devel] [RFC] Use cpu_get_icount as cpu_get_host_ticks fallback
Date: Fri, 18 Mar 2016 16:56:39 -0400 [thread overview]
Message-ID: <1458334599-9857-1-git-send-email-cov@codeaurora.org> (raw)
In-Reply-To: <20160311091553.26911.633.malone@chaenomeles.canonical.com>
The previous increment-on-read fallback didn't increment fast
enough for some versions of grub.
https://bugs.launchpad.net/qemu-linaro/+bug/893208
Signed-off-by: Christopher Covington <cov@codeaurora.org>
---
I unfortunately don't have the opportunity to fully test this right
now, but I'm sending it out nevertheless on the off chance that
someone else might.
---
include/qemu/timer.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index d0946cb..60c6dd6 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -998,13 +998,12 @@ static inline int64_t cpu_get_host_ticks(void)
}
#else
-/* 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. */
+/* The host CPU doesn't have an easily accessible cycle counter, so just return
+ the instruction count. This may make the CPU look like it has an IPC of
+ exactly 1, but that shouldn't cause any functional problems. */
static inline int64_t cpu_get_host_ticks (void)
{
- static int64_t ticks = 0;
- return ticks++;
+ return cpu_get_icount();
}
#endif
--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-03-18 20:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20111121171820.16487.92704.malonedeb@chaenomeles.canonical.com>
2011-12-10 13:40 ` [Qemu-devel] [Bug 893208] Re: qemu on ARM hosts can't boot i386 image Peter Maydell
2012-01-05 0:58 ` Michael Hope
2012-01-12 10:14 ` Peter Maydell
2015-09-16 23:12 ` PeteVine
2015-09-17 1:23 ` PeteVine
2015-09-19 10:54 ` Marina Kovalevna
2015-09-21 15:12 ` Laszlo Ersek
2015-09-21 15:37 ` Peter Maydell
2015-09-21 15:50 ` Dr. David Alan Gilbert
2015-09-21 17:12 ` Laszlo Ersek
2015-09-22 2:02 ` Marina Kovalevna
2015-09-21 17:43 ` PeteVine
2015-09-21 18:01 ` Dr. David Alan Gilbert
2015-09-29 11:07 ` Paolo Bonzini
2015-10-14 1:27 ` PeteVine
2015-11-07 20:31 ` PeteVine
2015-11-08 18:20 ` Marina Kovalevna
2015-12-21 18:45 ` PeteVine
2016-01-12 21:58 ` pranith
2016-02-28 1:12 ` Zack Callendish
2016-02-28 15:22 ` Peter Maydell
2016-02-29 15:23 ` Zack Callendish
2016-02-29 16:24 ` Peter Maydell
2016-03-11 9:15 ` PeteVine
2016-03-18 20:56 ` Christopher Covington [this message]
2016-03-19 10:44 ` PeteVine
2016-03-19 14:24 ` PeteVine
2017-06-13 17:23 ` Thomas Huth
2017-06-13 22:17 ` PeteVine
2017-08-30 20:08 ` Thomas Huth
2020-08-12 12:35 ` Laszlo Ersek (Red Hat)
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=1458334599-9857-1-git-send-email-cov@codeaurora.org \
--to=cov@codeaurora.org \
--cc=893208@bugs.launchpad.net \
--cc=daajjall@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).