I just pushed some changes to the new "x86-common" branch in hwloc's git.
You should be able to use it from the Xen component with:
hwloc_x86_discovery(topology, nbprocs /* total number of PUs */, HWLOC_X86_DISC_FLAG_CPUINFO|HWLOC_X86_DISC_FLAG_CACHES, func, data);
func must be something like:
static int hwloc_x86_xen_cpuid(void *data, unsigned pu,
unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
/* PU is the physical PU number */
data will likely be the Xen handle.
Le 01/02/2014 11:24, Brice Goglin a écrit :
> Le 29/01/2014 18:47, Andrew Cooper a écrit :
>> This would be nice, although it would involve some more selection on the
>> exclusions. Currently, running Xen excludes all other cpu detection
>> methods as they are more likely than not to be wrong.
>> One solution to this would be to have a "generic" x86 cpuid topology
>> generator which must be parametrised with a structure, at which point
>> both Xen and the fallback x86 methods can supply appropriate function
>> This would allow Xen to use the generic topology code while still
>> preventing fallback to the x86 topology detection method.
> Right, that'd work better, and the code would be nicer.
> I'll look at this.
> hwloc-devel mailing list