From: tip-bot for Bin Gao <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bin.gao@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, mingo@kernel.org, bin.gao@linux.intel.com,
peterz@infradead.org
Subject: [tip:x86/timers] x86/tsc: Mark TSC frequency determined by CPUID as known
Date: Fri, 18 Nov 2016 02:05:25 -0800 [thread overview]
Message-ID: <tip-4ca4df0b7eb06df264b2919759957f6d6ea1822e@git.kernel.org> (raw)
In-Reply-To: <1479241644-234277-3-git-send-email-bin.gao@linux.intel.com>
Commit-ID: 4ca4df0b7eb06df264b2919759957f6d6ea1822e
Gitweb: http://git.kernel.org/tip/4ca4df0b7eb06df264b2919759957f6d6ea1822e
Author: Bin Gao <bin.gao@linux.intel.com>
AuthorDate: Tue, 15 Nov 2016 12:27:22 -0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 18 Nov 2016 10:58:30 +0100
x86/tsc: Mark TSC frequency determined by CPUID as known
CPUs/SoCs with CPUID leaf 0x15 come with a known frequency and will report
the frequency to software via CPUID instruction. This hardware provided
frequency is the "real" frequency of TSC.
Set the X86_FEATURE_TSC_KNOWN_FREQ flag for such systems to skip the
software calibration process.
A 24 hours test on one of the CPUID 0x15 capable platforms was
conducted. PIT calibrated frequency resulted in more than 3 seconds drift
whereas the CPUID determined frequency showed less than 0.5 second
drift.
Signed-off-by: Bin Gao <bin.gao@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1479241644-234277-3-git-send-email-bin.gao@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/tsc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index d2c4ee4..e58c319 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -702,6 +702,13 @@ unsigned long native_calibrate_tsc(void)
}
}
+ /*
+ * TSC frequency determined by CPUID is a "hardware reported"
+ * frequency and is the most accurate one so far we have. This
+ * is considered a known frequency.
+ */
+ setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
+
return crystal_khz * ebx_numerator / eax_denominator;
}
next prev parent reply other threads:[~2016-11-18 10:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 20:27 [PATCH 0/4] x86/tsc: add X86_FEATURE_TSC_KNOWN_FREQ flag and hardware related changes Bin Gao
2016-11-15 20:27 ` [PATCH 1/4] x86/tsc: add X86_FEATURE_TSC_KNOWN_FREQ flag Bin Gao
2016-11-18 10:04 ` [tip:x86/timers] x86/tsc: Add " tip-bot for Bin Gao
2016-11-15 20:27 ` [PATCH 2/4] x86/tsc: mark TSC frequency determined by CPUID as known Bin Gao
2016-11-18 10:05 ` tip-bot for Bin Gao [this message]
2016-11-15 20:27 ` [PATCH 3/4] x86/tsc: mark Intel ATOM_GOLDMONT TSC reliable Bin Gao
2016-11-18 10:05 ` [tip:x86/timers] x86/tsc: Mark " tip-bot for Bin Gao
2016-11-15 20:27 ` [PATCH 4/4] x86/tsc: set TSC_KNOWN_FREQ and TSC_RELIABLE flags on Intel Atom SoCs Bin Gao
2016-11-18 8:21 ` Ingo Molnar
2016-11-18 10:06 ` [tip:x86/timers] x86/tsc: Set " tip-bot for Bin Gao
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=tip-4ca4df0b7eb06df264b2919759957f6d6ea1822e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bin.gao@intel.com \
--cc=bin.gao@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).