Skip to content

Commit 2b107d9

Browse files
Jacob PanH. Peter Anvin
authored andcommitted
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>
1 parent 722154e commit 2b107d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/x86/kernel/cpu/bugs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void __init check_fpu(void)
8686

8787
static void __init check_hlt(void)
8888
{
89-
if (paravirt_enabled())
89+
if (boot_cpu_data.x86 >= 5 || paravirt_enabled())
9090
return;
9191

9292
printk(KERN_INFO "Checking 'hlt' instruction... ");

0 commit comments

Comments
 (0)