From: Pranith Kumar <bobby.prani@gmail.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
"Cao jin" <caoj.fnst@cn.fujitsu.com>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] timer.h: Provide monotonic time for ARM guests
Date: Sat, 15 Apr 2017 15:29:30 -0400 [thread overview]
Message-ID: <20170415192930.1443-1-bobby.prani@gmail.com> (raw)
Tested and confirmed that the stretch i386 debian qcow2 image on a
raspberry pi 2 works.
Fixes: LP#: 893208 <https://bugs.launchpad.net/qemu/+bug/893208/>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
include/qemu/timer.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index e1742f2f3d..14c9558da4 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -1015,6 +1015,16 @@ static inline int64_t cpu_get_host_ticks(void)
return cur - ofs;
}
+#elif defined(__arm__) || defined(__aarch64__)
+
+/* ARM does not have a user-space readble cycle counter available.
+ * This is a compromise to get monotonically increasing time.
+ */
+static inline int64_t cpu_get_host_ticks(void)
+{
+ return get_clock();
+}
+
#else
/* The host CPU doesn't have an easily accessible cycle counter.
Just return a monotonically increasing value. This will be
--
2.11.0
next reply other threads:[~2017-04-15 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-15 19:29 Pranith Kumar [this message]
2017-04-17 18:42 ` [Qemu-devel] [PATCH] timer.h: Provide monotonic time for ARM guests Peter Maydell
2017-04-17 18:55 ` Pranith Kumar
2017-04-18 9:56 ` Paolo Bonzini
2017-04-18 19:19 ` Pranith Kumar
2017-04-20 13:58 ` Peter Maydell
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=20170415192930.1443-1-bobby.prani@gmail.com \
--to=bobby.prani@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=edgar.iglesias@xilinx.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--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).