Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 275

kvm-83-164.el5_5.9.src.rpm

From e5dcf57e33082b88e0ca537087706124e24aa9de Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Wed, 25 Mar 2009 08:34:21 +0000
Subject: [PATCH 6/6] kvm: external module: do not hardcode tsc_khz

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>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Upstream-status: applied(kvm/master)
Bugzilla: 488543
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Donald Dutile <ddutile@redhat.com>
Acked-by: Glauber Costa <glommer@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Avi Kivity <avi@redhat.com>
---
 kernel/external-module-compat-comm.h |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 194105b..970b40d 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -380,15 +380,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>
-- 
1.6.1