From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: kvm: external module: do not hardcode tsc_khz
Date: Mon, 23 Mar 2009 14:46:43 -0300 [thread overview]
Message-ID: <20090323174643.GA28963@amt.cnet> (raw)
external module compat hard codes tsc_khz as 2000000 if KERNEL_VERSION <
(2,6,23).
This breaks kvmclock on hosts with different frequency.
While tsc_khz was only exported on 2.6.23, the majority of relevant
older v2.6 based distros seem to have it exported.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index a14cea2..e0dc577 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -387,15 +387,11 @@ static inline struct page *__kvm_vm_fault(struct vm_area_struct *vma,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
-
-static unsigned __attribute__((__used__)) kvm_tsc_khz = 2000000;
-
-#else
+extern unsigned int tsc_khz;
+#endif
#define kvm_tsc_khz tsc_khz
-#endif
-
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
#include <linux/ktime.h>
next reply other threads:[~2009-03-23 17:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 17:46 Marcelo Tosatti [this message]
2009-03-24 9:36 ` kvm: external module: do not hardcode tsc_khz Avi Kivity
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=20090323174643.GA28963@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.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