I've been thinking about how to use the cpuid hypercall.

Right now the x86 backend does
foreach proc
  bind on this proc
  do a lot of cpuid calls

It would do instead
foreach proc
  cpuid hypercall on this proc

So we would
1) add a cpuid(topology, cpu, inputbuffer, outputbuffer) hook pointer in
the topology structure
2) have xen define that hook (using a new function since the topology
internals are not visible to plugins). It could be in the xen discover()
callback. Or it could be in the instantiate() callback if we want the
x86 backend to work when used before the xen backend. I think we just
have to be sure we don't enable that hook before we're sure the Xen
backend will work.
3) when this hook is defined, the x86 backend doesn't need to bind
anymore, but it uses that cpuid hook instead of raw cpuid instructions.

We may want to make inputbuffer and outputbuffer generic enough (void* +
length) so that the model works for other architectures one day? Xen
will know that they correspond to inputbuffer=one-register and
outputbuffer=four-registers when running on x86.

Brice

Reply via email to