[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Problems with hyperthreading in Windows HVM


I have been trying to get Hyperthreading to work in a Windows HVM on
Xen 4.1.2 as described in 'xmexample.hvm'. I think I have set it up
correctly, but I can't seem to get it to work. There is not much
documentation on it and most topics are from years ago. I'm curious to
know to whether this functionality is still supposed to work.

I'm aware that Xen itself supports Hyperthreading, but my software is
not happy about seeing every VCPU from Xen as a physical core. I would
like to use hyperthreading opposed to disabling it since the software
in question does benefit of using Hyperthreading.

For reference this is the original Hyperthreading example from 'xmexample.hvm':
#   Expose to the guest multi-core cpu instead of multiple processors
# Example for intel, expose a 8-core processor :
#          ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
#     '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
#  - CPUID.1[EDX][HT] : Enable HT
#  - CPUID.1[EBX] : Number of vcpus * 2
#  - CPUID.4,0[EAX] : Number of vcpus * 2 - 1

I tried the example from xmexample.hvm on a 4-core system of which I
wanted to pass 2 physical cores (so 4 logical) to Windows:
cpuid = 
'4,0:eax=000011xxxxxxxxxxxxxxxxxxxxxxxxxx' ]
cpus=['4', '6'] # pin to 2 different physical cores

When I boot up the VM, Windows detects just 2 physical cores. Debug
tools like Sysinternals coreinfo, cpu-z also don't detect 4 logical

To figure out what is going wrong, I wrote a small win32 tool to check
the result of the cpuid patching. For function 1, it shows that the
correct bits in edx and ebx got updated. The bits of function 4 which
should contain a part of the ACPI ID don't seem to got patched. In
fact eax/ebx/ecx/edx are all reported as 0. From what I saw in
'xc_cpuid_hvm_policy' and 'intel_xc_cpuid_policy' in libxc, Xen
performs filtering on a bunch of cpuid functions. Though all the ones
I patched are preserved by the filtering. From what I saw in past
email threads there were issues with ACPI ID stuff in the past, can
there be new issues here? Does anyone have hyperthreading working?

Roderick Colenbrander

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.