~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/virt/kvm/x86/cpuid.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GPL-2.0
  2 
  3 ==============
  4 KVM CPUID bits
  5 ==============
  6 
  7 :Author: Glauber Costa <glommer@gmail.com>
  8 
  9 A guest running on a kvm host, can check some of its features using
 10 cpuid. This is not always guaranteed to work, since userspace can
 11 mask-out some, or even all KVM-related cpuid features before launching
 12 a guest.
 13 
 14 KVM cpuid functions are:
 15 
 16 function: KVM_CPUID_SIGNATURE (0x40000000)
 17 
 18 returns::
 19 
 20    eax = 0x40000001
 21    ebx = 0x4b4d564b
 22    ecx = 0x564b4d56
 23    edx = 0x4d
 24 
 25 Note that this value in ebx, ecx and edx corresponds to the string "KVMKVMKVM".
 26 The value in eax corresponds to the maximum cpuid function present in this leaf,
 27 and will be updated if more functions are added in the future.
 28 Note also that old hosts set eax value to 0x0. This should
 29 be interpreted as if the value was 0x40000001.
 30 This function queries the presence of KVM cpuid leafs.
 31 
 32 function: define KVM_CPUID_FEATURES (0x40000001)
 33 
 34 returns::
 35 
 36           ebx, ecx
 37           eax = an OR'ed group of (1 << flag)
 38 
 39 where ``flag`` is defined as below:
 40 
 41 ================================== =========== ================================
 42 flag                               value       meaning
 43 ================================== =========== ================================
 44 KVM_FEATURE_CLOCKSOURCE            0           kvmclock available at msrs
 45                                                0x11 and 0x12
 46 
 47 KVM_FEATURE_NOP_IO_DELAY           1           not necessary to perform delays
 48                                                on PIO operations
 49 
 50 KVM_FEATURE_MMU_OP                 2           deprecated
 51 
 52 KVM_FEATURE_CLOCKSOURCE2           3           kvmclock available at msrs
 53                                                0x4b564d00 and 0x4b564d01
 54 
 55 KVM_FEATURE_ASYNC_PF               4           async pf can be enabled by
 56                                                writing to msr 0x4b564d02
 57 
 58 KVM_FEATURE_STEAL_TIME             5           steal time can be enabled by
 59                                                writing to msr 0x4b564d03
 60 
 61 KVM_FEATURE_PV_EOI                 6           paravirtualized end of interrupt
 62                                                handler can be enabled by
 63                                                writing to msr 0x4b564d04
 64 
 65 KVM_FEATURE_PV_UNHALT              7           guest checks this feature bit
 66                                                before enabling paravirtualized
 67                                                spinlock support
 68 
 69 KVM_FEATURE_PV_TLB_FLUSH           9           guest checks this feature bit
 70                                                before enabling paravirtualized
 71                                                tlb flush
 72 
 73 KVM_FEATURE_ASYNC_PF_VMEXIT        10          paravirtualized async PF VM EXIT
 74                                                can be enabled by setting bit 2
 75                                                when writing to msr 0x4b564d02
 76 
 77 KVM_FEATURE_PV_SEND_IPI            11          guest checks this feature bit
 78                                                before enabling paravirtualized
 79                                                send IPIs
 80 
 81 KVM_FEATURE_POLL_CONTROL           12          host-side polling on HLT can
 82                                                be disabled by writing
 83                                                to msr 0x4b564d05.
 84 
 85 KVM_FEATURE_PV_SCHED_YIELD         13          guest checks this feature bit
 86                                                before using paravirtualized
 87                                                sched yield.
 88 
 89 KVM_FEATURE_ASYNC_PF_INT           14          guest checks this feature bit
 90                                                before using the second async
 91                                                pf control msr 0x4b564d06 and
 92                                                async pf acknowledgment msr
 93                                                0x4b564d07.
 94 
 95 KVM_FEATURE_MSI_EXT_DEST_ID        15          guest checks this feature bit
 96                                                before using extended destination
 97                                                ID bits in MSI address bits 11-5.
 98 
 99 KVM_FEATURE_HC_MAP_GPA_RANGE       16          guest checks this feature bit before
100                                                using the map gpa range hypercall
101                                                to notify the page state change
102 
103 KVM_FEATURE_MIGRATION_CONTROL      17          guest checks this feature bit before
104                                                using MSR_KVM_MIGRATION_CONTROL
105 
106 KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 24          host will warn if no guest-side
107                                                per-cpu warps are expected in
108                                                kvmclock
109 ================================== =========== ================================
110 
111 ::
112 
113       edx = an OR'ed group of (1 << flag)
114 
115 Where ``flag`` here is defined as below:
116 
117 ================== ============ =================================
118 flag               value        meaning
119 ================== ============ =================================
120 KVM_HINTS_REALTIME 0            guest checks this feature bit to
121                                 determine that vCPUs are never
122                                 preempted for an unlimited time
123                                 allowing optimizations
124 ================== ============ =================================

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php