On 11/02/2014 12:15, Brice Goglin wrote:
> Hello,
>
> 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.
>
> Brice
>

That's fantastic! I was expecting to have to attempt to code this up myself.

I hereby present v4 of the series, available from:

http://xenbits.xen.org/gitweb/?p=people/andrewcoop/hwloc.git;a=shortlog;h=refs/heads/hwloc-xen-topology-v4
http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/hwloc-support-experimental-v2

Where the hwloc-xen-topology-v4 branch is now based on x86-common rather
than master.

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
more information.

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.

~Andrew

Reply via email to