Skip to content

Commit

Permalink
x86: Avoid check hlt for newer cpus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jacob Pan authored and H. Peter Anvin committed May 7, 2010
1 parent 722154e commit 2b107d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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... ");
Expand Down

0 comments on commit 2b107d9

Please sign in to comment.