Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

 [WIP DNM] use x86 hybrid freqs for cpukinds #688

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion hwloc/topology-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ struct procinfo {

unsigned hybridcoretype;
unsigned hybridnativemodel;
unsigned basefreq;
unsigned maxfreq;
};

enum cpuid_type {
Expand Down Expand Up @@ -744,13 +746,20 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns
}

if (highest_cpuid >= 0x1a && has_hybrid(features)) {
data->is_hybrid = 1;
/* Get hybrid cpu information from cpuid 0x1a on Intel */
eax = 0x1a;
ecx = 0;
cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump);
infos->hybridcoretype = eax >> 24;
infos->hybridnativemodel = eax & 0xffffff;
data->is_hybrid = 1;
/* Get base and max freq from cpuid 0x16 on Intel */
eax = 0x16;
ecx = 0;
cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump);
infos->basefreq = eax & 0xffff;
infos->maxfreq = ebx & 0xffff;
printf("base %u max %u\n", infos->basefreq, infos->maxfreq);
}

/*********************************************************************************
Expand Down