On 11/02/2014 12:15, Brice Goglin wrote:
> 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.
That's fantastic! I was expecting to have to attempt to code this up myself.
I hereby present v4 of the series, available from:
Where the hwloc-xen-topology-v4 branch is now based on x86-common rather
hwloc-support-experimental-v2 in the Xen tree now contains two changes.
In addition to the *_bounced() functions, there is a new SYSCTL
hypercall for Xen to allow the toolstack to request execution of an
arbitrary cpuid instruction on a specific processor. It seems to work
in each of the usecases I had before, and now provides substantially
I suspect that the new cpuid function call needs to be properly guarded
by the configure script; While the previous code was common to all Xen
architectures, the cpuid sysctl is very definitely x86 specific.