lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <43F901BD926A4E43B106BF17856F0755643EBDF9@orsmsx508.amr.corp.intel.com>
Date:	Thu, 16 Jul 2009 03:55:21 -0700
From:	"Pan, Jacob jun" <jacob.jun.pan@...el.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"x86@...nel.org" <x86@...nel.org>
Subject: [PATCH v2 7/10] x86/tsc: enable APB timer based calibration

>From e9264a1e5f8662d64f7d042544a03504b325bac9 Mon Sep 17 00:00:00 2001
From: Jacob Pan <jacob.jun.pan@...el.com>
Date: Wed, 15 Jul 2009 14:20:02 -0700
Subject: [PATCH] x86/tsc: enable APB timer based calibration

for platform that do not have PIT, we can use APB timer (if available)
to calibrate TSC by counting the two. APB timer frequency is known to
the system by SFI table provided by FW.

Signed-off-by: Jacob Pan <jacob.jun.pan@...el.com>
---
 arch/x86/kernel/tsc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6e1a368..8b38a9d 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -18,6 +18,9 @@
 #include <asm/delay.h>
 #include <asm/hypervisor.h>
 
+#include <asm/platform_feature.h>
+#include <asm/apb_timer.h>
+
 unsigned int __read_mostly cpu_khz;	/* TSC clocks / usec, not used here */
 EXPORT_SYMBOL(cpu_khz);
 
@@ -394,6 +397,14 @@ unsigned long native_calibrate_tsc(void)
 		return hv_tsc_khz;
 	}
 
+	/* first check if apb timer exist and is usable */
+	if (platform_has(X86_PLATFORM_FEATURE_APBT)) {
+		local_irq_save(flags);
+		fast_calibrate = apbt_quick_calibrate();
+		local_irq_restore(flags);
+		if (fast_calibrate)
+			return fast_calibrate;
+	}
 	local_irq_save(flags);
 	fast_calibrate = quick_pit_calibrate();
 	local_irq_restore(flags);
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ