Re: [PATCH 4/7] perf: Check if HT is supported and enabled

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, January 4, 2011 - 4:10 am

On Mon, 2011-01-03 at 11:53 -0800, H. Peter Anvin wrote:

Its the kernel space bit that wants to know if HT is enabled on CPU
bringup, /proc/cpuinfo is kinda useless in that context.


So you failed to address the primary question, how do we tell if HT is
enabled for a particular CPU?

X86_FEATURE_HT tells us the CPU supports telling us about HT,
smp_num_siblings > 1 tells us the CPU is capable of HT. But Lin found
that if you disable HT in the BIOS both those are true but we still
don't have HT enabled.

The problem we have to address is that Intel has some MSRs shared
between threads and if HT is enabled we need to allocate some memory to
manage this shared resource.

The simple check outlined above X86_FEATURE_HT && smp_num_siblings > 1,
will get us most of the way and will I think be good enough (false
positives but no false negatives). But it did get us wondering about how
all this works.

So could you, irrespective of Linux implementation details tell us how
to detect if HT is available and enabled from a HW and BIOS perspective?
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, H. Peter Anvin, (Mon Jan 3, 12:53 pm)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Peter Zijlstra, (Tue Jan 4, 4:10 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 6:38 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 6:52 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 8:35 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Valdis.Kletnieks, (Tue Jan 4, 11:55 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, H. Peter Anvin, (Tue Jan 4, 12:00 pm)