[tip:x86/mrst] x86: Avoid check hlt for newer cpus

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Jacob Pan
Date: Friday, May 7, 2010 - 3:36 pm

Commit-ID:  2b107d93635616db0c3f893c8cc2e6d5cd8d77b2
Gitweb:     http://git.kernel.org/tip/2b107d93635616db0c3f893c8cc2e6d5cd8d77b2
Author:     Jacob Pan <jacob.jun.pan@linux.intel.com>
AuthorDate: Fri, 7 May 2010 14:59:45 -0700
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 7 May 2010 15:31:17 -0700

x86: Avoid check hlt for newer cpus

Check hlt instruction was targeted for some older CPUs. It is an expensive
operation in that it takes 4 ticks to break out the check.  We can avoid
such check completely for newer x86 cpus (family >= 5).

[ hpa: corrected family > 5 to family >= 5 ]

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
LKML-Reference: <1273269585-14346-1-git-send-email-jacob.jun.pan@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/kernel/cpu/bugs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 01a2652..c39576c 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -86,7 +86,7 @@ static void __init check_fpu(void)
 
 static void __init check_hlt(void)
 {
-	if (paravirt_enabled())
+	if (boot_cpu_data.x86 >= 5 || paravirt_enabled())
 		return;
 
 	printk(KERN_INFO "Checking 'hlt' instruction... ");
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: avoid check hlt for newer cpus, Jacob Pan, (Fri May 7, 2:59 pm)
[tip:x86/mrst] x86: Avoid check hlt for newer cpus, tip-bot for Jacob Pan, (Fri May 7, 3:18 pm)
[tip:x86/mrst] x86: Avoid check hlt for newer cpus, tip-bot for Jacob Pan, (Fri May 7, 3:36 pm)