summaryrefslogtreecommitdiff
path: root/target/i386/cpu.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2017-09-11 23:20:27 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-09-19 16:20:49 +0200
commit6c69dfb67e84747cf071958594d939e845dfcc0c (patch)
tree97b7f03024f43bce6ac98056a344d1446e70da2f /target/i386/cpu.c
parent05cb8ed5467ff0f154f9356fa0cdcf7fca4b17f6 (diff)
downloadqemu-6c69dfb67e84747cf071958594d939e845dfcc0c.zip
i386/cpu/hyperv: support over 64 vcpus for windows guests
Starting with Windows Server 2012 and Windows 8, if CPUID.40000005.EAX contains a value of -1, Windows assumes specific limit to the number of VPs. In this case, Windows Server 2012 guest VMs may use more than 64 VPs, up to the maximum supported number of processors applicable to the specific Windows version being used. https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs For compatibility, Let's introduce a new property for X86CPU, named "x-hv-max-vps" as Eduardo's suggestion, and set it to 0x40 before machine 2.10. (The "x-" prefix indicates that the property is not supposed to be a stable user interface.) Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1505143227-14324-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/cpu.c')
-rw-r--r--target/i386/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 7644f6dc2c..40c3091edf 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4145,6 +4145,20 @@ static Property x86_cpu_properties[] = {
false),
DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true),
+
+ /*
+ * From "Requirements for Implementing the Microsoft
+ * Hypervisor Interface":
+ * https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
+ *
+ * "Starting with Windows Server 2012 and Windows 8, if
+ * CPUID.40000005.EAX contains a value of -1, Windows assumes that
+ * the hypervisor imposes no specific limit to the number of VPs.
+ * In this case, Windows Server 2012 guest VMs may use more than
+ * 64 VPs, up to the maximum supported number of processors applicable
+ * to the specific Windows version being used."
+ */
+ DEFINE_PROP_INT32("x-hv-max-vps", X86CPU, hv_max_vps, -1),
DEFINE_PROP_END_OF_LIST()
};