From patchwork Mon Mar 23 17:46:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 13777 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2NHlBs0022195 for ; Mon, 23 Mar 2009 17:47:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755498AbZCWRqy (ORCPT ); Mon, 23 Mar 2009 13:46:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753768AbZCWRqy (ORCPT ); Mon, 23 Mar 2009 13:46:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57566 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753417AbZCWRqx (ORCPT ); Mon, 23 Mar 2009 13:46:53 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2NHkpOh009047 for ; Mon, 23 Mar 2009 13:46:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2NHkkIP004926; Mon, 23 Mar 2009 13:46:46 -0400 Received: from amt.cnet (vpn-10-181.str.redhat.com [10.32.10.181]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2NHknma015104; Mon, 23 Mar 2009 13:46:50 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 0DFF3680296; Mon, 23 Mar 2009 14:46:45 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n2NHkhDL029556; Mon, 23 Mar 2009 14:46:43 -0300 Date: Mon, 23 Mar 2009 14:46:43 -0300 From: Marcelo Tosatti To: Avi Kivity Cc: kvm-devel Subject: kvm: external module: do not hardcode tsc_khz Message-ID: <20090323174643.GA28963@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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