cpuid.txt 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. KVM CPUID bits
  2. Glauber Costa <glommer@redhat.com>, Red Hat Inc, 2010
  3. =====================================================
  4. A guest running on a kvm host, can check some of its features using
  5. cpuid. This is not always guaranteed to work, since userspace can
  6. mask-out some, or even all KVM-related cpuid features before launching
  7. a guest.
  8. KVM cpuid functions are:
  9. function: KVM_CPUID_SIGNATURE (0x40000000)
  10. returns : eax = 0x40000001,
  11. ebx = 0x4b4d564b,
  12. ecx = 0x564b4d56,
  13. edx = 0x4d.
  14. Note that this value in ebx, ecx and edx corresponds to the string "KVMKVMKVM".
  15. The value in eax corresponds to the maximum cpuid function present in this leaf,
  16. and will be updated if more functions are added in the future.
  17. Note also that old hosts set eax value to 0x0. This should
  18. be interpreted as if the value was 0x40000001.
  19. This function queries the presence of KVM cpuid leafs.
  20. function: define KVM_CPUID_FEATURES (0x40000001)
  21. returns : ebx, ecx
  22. eax = an OR'ed group of (1 << flag), where each flags is:
  23. flag || value || meaning
  24. =============================================================================
  25. KVM_FEATURE_CLOCKSOURCE || 0 || kvmclock available at msrs
  26. || || 0x11 and 0x12.
  27. ------------------------------------------------------------------------------
  28. KVM_FEATURE_NOP_IO_DELAY || 1 || not necessary to perform delays
  29. || || on PIO operations.
  30. ------------------------------------------------------------------------------
  31. KVM_FEATURE_MMU_OP || 2 || deprecated.
  32. ------------------------------------------------------------------------------
  33. KVM_FEATURE_CLOCKSOURCE2 || 3 || kvmclock available at msrs
  34. || || 0x4b564d00 and 0x4b564d01
  35. ------------------------------------------------------------------------------
  36. KVM_FEATURE_ASYNC_PF || 4 || async pf can be enabled by
  37. || || writing to msr 0x4b564d02
  38. ------------------------------------------------------------------------------
  39. KVM_FEATURE_STEAL_TIME || 5 || steal time can be enabled by
  40. || || writing to msr 0x4b564d03.
  41. ------------------------------------------------------------------------------
  42. KVM_FEATURE_PV_EOI || 6 || paravirtualized end of interrupt
  43. || || handler can be enabled by writing
  44. || || to msr 0x4b564d04.
  45. ------------------------------------------------------------------------------
  46. KVM_FEATURE_PV_UNHALT || 7 || guest checks this feature bit
  47. || || before enabling paravirtualized
  48. || || spinlock support.
  49. ------------------------------------------------------------------------------
  50. KVM_FEATURE_PV_TLB_FLUSH || 9 || guest checks this feature bit
  51. || || before enabling paravirtualized
  52. || || tlb flush.
  53. ------------------------------------------------------------------------------
  54. KVM_FEATURE_ASYNC_PF_VMEXIT || 10 || paravirtualized async PF VM exit
  55. || || can be enabled by setting bit 2
  56. || || when writing to msr 0x4b564d02
  57. ------------------------------------------------------------------------------
  58. KVM_FEATURE_PV_SEND_IPI || 11 || guest checks this feature bit
  59. || || before using paravirtualized
  60. || || send IPIs.
  61. ------------------------------------------------------------------------------
  62. KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side
  63. || || per-cpu warps are expected in
  64. || || kvmclock.
  65. ------------------------------------------------------------------------------
  66. edx = an OR'ed group of (1 << flag), where each flags is:
  67. flag || value || meaning
  68. ==================================================================================
  69. KVM_HINTS_REALTIME || 0 || guest checks this feature bit to
  70. || || determine that vCPUs are never
  71. || || preempted for an unlimited time,
  72. || || allowing optimizations
  73. ----------------------------------------------------------------------------------