HT enabled detection is not reliable

This commit is contained in:
Doug MacEachern 2006-03-22 02:46:11 +00:00
parent 4c7b451f69
commit 8e48b40ec2
1 changed files with 5 additions and 3 deletions

View File

@ -216,12 +216,14 @@ static int is_ht_enabled(sigar_t *sigar)
sigar_cpuid(1, &eax, &ebx, &ecx, &edx); sigar_cpuid(1, &eax, &ebx, &ecx, &edx);
if (edx & (1<<28)) { if (edx & (1<<28)) {
#ifdef DETECT_HT_ENABLED
unsigned long apic_id = unsigned long apic_id =
(ebx & 0xFF000000) >> 24; (ebx & 0xFF000000) >> 24;
unsigned long log_id, phy_id_mask=0xFF, i=1; unsigned long log_id, phy_id_mask=0xFF, i=1;
#endif
sigar->lcpu = (ebx & 0x00FF0000) >> 16; sigar->lcpu = (ebx & 0x00FF0000) >> 16;
#ifdef DETECT_HT_ENABLED
/* XXX disabled. process affinity mask can throw this off? */
while (i < sigar->lcpu) { while (i < sigar->lcpu) {
i *= 2; i *= 2;
phy_id_mask <<= 1; phy_id_mask <<= 1;
@ -232,7 +234,7 @@ static int is_ht_enabled(sigar_t *sigar)
if (log_id == 0) { if (log_id == 0) {
sigar->lcpu = 1; sigar->lcpu = 1;
} }
#endif
if (sigar->lcpu > 1) { if (sigar->lcpu > 1) {
sigar->ht_enabled = 1; sigar->ht_enabled = 1;
sigar_log_printf(sigar, SIGAR_LOG_DEBUG, sigar_log_printf(sigar, SIGAR_LOG_DEBUG,