lkml.org 
[lkml]   [2014]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] x86, disable ht flag when hyperthreading is disabled
Date
The ht flag indicates that a processor is capable of having sibling threads.
This has long been confusing for users who confuse the ht flag as
indicating that hyperthreading is enabled on their systems even though
it may have been disabled in BIOS.

This patch removes the hyperthreading flag when no cpu thread siblings are
found, ie) smp_num_siblings == 1.

Cc: Oren Twaig <oren@scalemp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Borislav Petkov <bp@suse.de>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Torsten Kaiser <just.for.lkml@googlemail.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Andrew Jones <drjones@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
arch/x86/kernel/smpboot.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e5ab30b..2eaadf0 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -371,6 +371,7 @@ void set_cpu_sibling_map(int cpu)
cpumask_set_cpu(cpu, cpu_core_mask(cpu));
c->booted_cores = 1;
smp_num_siblings = 1;
+ clear_cpu_cap(c, X86_FEATURE_HT);
return;
}

@@ -419,6 +420,9 @@ void set_cpu_sibling_map(int cpu)
/* Only need to check this on the boot cpu, o/w it is disabled */
if (cpu == 0)
smp_num_siblings = cpumask_weight(cpu_sibling_mask(cpu));
+
+ if (cpu_has_ht && smp_num_siblings == 1)
+ clear_cpu_cap(c, X86_FEATURE_HT);
}

/* maps the cpu to the sched domain representing multi-core */
--
1.7.9.3


\
 
 \ /
  Last update: 2014-06-20 19:41    [W:0.052 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site