hyperv: cpu hotplug fix with HyperV enabled

With Hyper-V enabled CPU hotplug stops working. The CPU appears
in device manager on Windows but does not appear in peformance
monitor and control panel.

The root of the problem is the following. Windows checks
HV_X64_CPU_DYNAMIC_PARTITIONING_AVAILABLE bit in CPUID. The
presence of this bit is enough to cure the situation.

The bit should be set when CPU hotplug is allowed for HyperV VM.
The check that hot_add_cpu callback is defined is enough from the
protocol point of view. Though this callback is defined almost
always thus there is no need to export that knowledge in the
other way.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Eduardo Habkost <ehabkost@redhat.com>
CC: "Andreas Färber" <afaerber@suse.de>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 4467c6c118b85133846785f517e5733112e811b4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
1 file changed
tree: 224f2795ed3aab5df4a5932f63e4edfc0777709c
  1. audio/
  2. backends/
  3. block/
  4. bsd-user/
  5. contrib/
  6. crypto/
  7. default-configs/
  8. disas/
  9. docs/
  10. fpu/
  11. fsdev/
  12. gdb-xml/
  13. hw/
  14. include/
  15. libdecnumber/
  16. linux-headers/
  17. linux-user/
  18. migration/
  19. net/
  20. pc-bios/
  21. po/
  22. qapi/
  23. qga/
  24. qobject/
  25. qom/
  26. replay/
  27. roms/
  28. scripts/
  29. slirp/
  30. stubs/
  31. target-alpha/
  32. target-arm/
  33. target-cris/
  34. target-i386/
  35. target-lm32/
  36. target-m68k/
  37. target-microblaze/
  38. target-mips/
  39. target-moxie/
  40. target-openrisc/
  41. target-ppc/
  42. target-s390x/
  43. target-sh4/
  44. target-sparc/
  45. target-tilegx/
  46. target-tricore/
  47. target-unicore32/
  48. target-xtensa/
  49. tcg/
  50. tests/
  51. trace/
  52. ui/
  53. util/
  54. .dir-locals.el
  55. .exrc
  56. .gitignore
  57. .gitmodules
  58. .mailmap
  59. .travis.yml
  60. accel.c
  61. aio-posix.c
  62. aio-win32.c
  63. arch_init.c
  64. async.c
  65. balloon.c
  66. block.c
  67. blockdev-nbd.c
  68. blockdev.c
  69. blockjob.c
  70. bootdevice.c
  71. bt-host.c
  72. bt-vhci.c
  73. Changelog
  74. CODING_STYLE
  75. configure
  76. COPYING
  77. COPYING.LIB
  78. cpu-exec-common.c
  79. cpu-exec.c
  80. cpus.c
  81. cputlb.c
  82. device-hotplug.c
  83. device_tree.c
  84. disas.c
  85. dma-helpers.c
  86. dump.c
  87. exec.c
  88. gdbstub.c
  89. HACKING
  90. hmp-commands-info.hx
  91. hmp-commands.hx
  92. hmp.c
  93. hmp.h
  94. iohandler.c
  95. ioport.c
  96. iothread.c
  97. kvm-all.c
  98. kvm-stub.c
  99. LICENSE
  100. main-loop.c
  101. MAINTAINERS
  102. Makefile
  103. Makefile.objs
  104. Makefile.target
  105. memory.c
  106. memory_mapping.c
  107. module-common.c
  108. monitor.c
  109. nbd.c
  110. numa.c
  111. os-posix.c
  112. os-win32.c
  113. page_cache.c
  114. qapi-schema.json
  115. qdev-monitor.c
  116. qdict-test-data.txt
  117. qemu-bridge-helper.c
  118. qemu-char.c
  119. qemu-doc.texi
  120. qemu-ga.texi
  121. qemu-img-cmds.hx
  122. qemu-img.c
  123. qemu-img.texi
  124. qemu-io-cmds.c
  125. qemu-io.c
  126. qemu-log.c
  127. qemu-nbd.c
  128. qemu-nbd.texi
  129. qemu-options-wrapper.h
  130. qemu-options.h
  131. qemu-options.hx
  132. qemu-seccomp.c
  133. qemu-tech.texi
  134. qemu-timer.c
  135. qemu.nsi
  136. qemu.sasl
  137. qjson.c
  138. qmp-commands.hx
  139. qmp.c
  140. qtest.c
  141. README
  142. rules.mak
  143. softmmu_template.h
  144. spice-qemu-char.c
  145. tcg-runtime.c
  146. tci.c
  147. thread-pool.c
  148. thunk.c
  149. tpm.c
  150. trace-events
  151. translate-all.c
  152. translate-all.h
  153. translate-common.c
  154. user-exec.c
  155. VERSION
  156. version.rc
  157. vl.c
  158. xen-common-stub.c
  159. xen-common.c
  160. xen-hvm-stub.c
  161. xen-hvm.c
  162. xen-mapcache.c