Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] hwloc with Xen system support - v2
From: Andrew Cooper (andrew.cooper3_at_[hidden])
Date: 2014-02-12 20:48:07

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:;a=shortlog;h=refs/heads/hwloc-xen-topology-v4;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.