aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2014-09-09 12:27:19 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-10 05:34:39 -0400
commit209cf19fcd927e6db9f2ef38e3ca6afdcc0d4d5a (patch)
tree397489460e9dc22be8b6a0721c5e91afa29f9f3b /Documentation/virtual
parent4bd9d3441edadff4c8df9de4b5d5386c36667ca6 (diff)
KVM: fix api documentation of KVM_GET_EMULATED_CPUID
It looks like when this was initially merged it got accidentally included in the following section. I've just moved it back in the correct section and re-numbered it as other ioctls have been added since. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r--Documentation/virtual/kvm/api.txt140
1 files changed, 70 insertions, 70 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 539c010eade0..f7735c72c128 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -2610,6 +2610,76 @@ When debug events exit the main run loop with the reason
2610KVM_EXIT_DEBUG with the kvm_debug_exit_arch part of the kvm_run 2610KVM_EXIT_DEBUG with the kvm_debug_exit_arch part of the kvm_run
2611structure containing architecture specific debug information. 2611structure containing architecture specific debug information.
2612 2612
26134.88 KVM_GET_EMULATED_CPUID
2614
2615Capability: KVM_CAP_EXT_EMUL_CPUID
2616Architectures: x86
2617Type: system ioctl
2618Parameters: struct kvm_cpuid2 (in/out)
2619Returns: 0 on success, -1 on error
2620
2621struct kvm_cpuid2 {
2622 __u32 nent;
2623 __u32 flags;
2624 struct kvm_cpuid_entry2 entries[0];
2625};
2626
2627The member 'flags' is used for passing flags from userspace.
2628
2629#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
2630#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
2631#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
2632
2633struct kvm_cpuid_entry2 {
2634 __u32 function;
2635 __u32 index;
2636 __u32 flags;
2637 __u32 eax;
2638 __u32 ebx;
2639 __u32 ecx;
2640 __u32 edx;
2641 __u32 padding[3];
2642};
2643
2644This ioctl returns x86 cpuid features which are emulated by
2645kvm.Userspace can use the information returned by this ioctl to query
2646which features are emulated by kvm instead of being present natively.
2647
2648Userspace invokes KVM_GET_EMULATED_CPUID by passing a kvm_cpuid2
2649structure with the 'nent' field indicating the number of entries in
2650the variable-size array 'entries'. If the number of entries is too low
2651to describe the cpu capabilities, an error (E2BIG) is returned. If the
2652number is too high, the 'nent' field is adjusted and an error (ENOMEM)
2653is returned. If the number is just right, the 'nent' field is adjusted
2654to the number of valid entries in the 'entries' array, which is then
2655filled.
2656
2657The entries returned are the set CPUID bits of the respective features
2658which kvm emulates, as returned by the CPUID instruction, with unknown
2659or unsupported feature bits cleared.
2660
2661Features like x2apic, for example, may not be present in the host cpu
2662but are exposed by kvm in KVM_GET_SUPPORTED_CPUID because they can be
2663emulated efficiently and thus not included here.
2664
2665The fields in each entry are defined as follows:
2666
2667 function: the eax value used to obtain the entry
2668 index: the ecx value used to obtain the entry (for entries that are
2669 affected by ecx)
2670 flags: an OR of zero or more of the following:
2671 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
2672 if the index field is valid
2673 KVM_CPUID_FLAG_STATEFUL_FUNC:
2674 if cpuid for this function returns different values for successive
2675 invocations; there will be several entries with the same function,
2676 all with this flag set
2677 KVM_CPUID_FLAG_STATE_READ_NEXT:
2678 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
2679 the first entry to be read by a cpu
2680 eax, ebx, ecx, edx: the values returned by the cpuid instruction for
2681 this function/index combination
2682
26135. The kvm_run structure 26835. The kvm_run structure
2614------------------------ 2684------------------------
2615 2685
@@ -2912,76 +2982,6 @@ values in kvm_run even if the corresponding bit in kvm_dirty_regs is not set.
2912}; 2982};
2913 2983
2914 2984
29154.81 KVM_GET_EMULATED_CPUID
2916
2917Capability: KVM_CAP_EXT_EMUL_CPUID
2918Architectures: x86
2919Type: system ioctl
2920Parameters: struct kvm_cpuid2 (in/out)
2921Returns: 0 on success, -1 on error
2922
2923struct kvm_cpuid2 {
2924 __u32 nent;
2925 __u32 flags;
2926 struct kvm_cpuid_entry2 entries[0];
2927};
2928
2929The member 'flags' is used for passing flags from userspace.
2930
2931#define KVM_CPUID_FLAG_SIGNIFCANT_INDEX BIT(0)
2932#define KVM_CPUID_FLAG_STATEFUL_FUNC BIT(1)
2933#define KVM_CPUID_FLAG_STATE_READ_NEXT BIT(2)
2934
2935struct kvm_cpuid_entry2 {
2936 __u32 function;
2937 __u32 index;
2938 __u32 flags;
2939 __u32 eax;
2940 __u32 ebx;
2941 __u32 ecx;
2942 __u32 edx;
2943 __u32 padding[3];
2944};
2945
2946This ioctl returns x86 cpuid features which are emulated by
2947kvm.Userspace can use the information returned by this ioctl to query
2948which features are emulated by kvm instead of being present natively.
2949
2950Userspace invokes KVM_GET_EMULATED_CPUID by passing a kvm_cpuid2
2951structure with the 'nent' field indicating the number of entries in
2952the variable-size array 'entries'. If the number of entries is too low
2953to describe the cpu capabilities, an error (E2BIG) is returned. If the
2954number is too high, the 'nent' field is adjusted and an error (ENOMEM)
2955is returned. If the number is just right, the 'nent' field is adjusted
2956to the number of valid entries in the 'entries' array, which is then
2957filled.
2958
2959The entries returned are the set CPUID bits of the respective features
2960which kvm emulates, as returned by the CPUID instruction, with unknown
2961or unsupported feature bits cleared.
2962
2963Features like x2apic, for example, may not be present in the host cpu
2964but are exposed by kvm in KVM_GET_SUPPORTED_CPUID because they can be
2965emulated efficiently and thus not included here.
2966
2967The fields in each entry are defined as follows:
2968
2969 function: the eax value used to obtain the entry
2970 index: the ecx value used to obtain the entry (for entries that are
2971 affected by ecx)
2972 flags: an OR of zero or more of the following:
2973 KVM_CPUID_FLAG_SIGNIFCANT_INDEX:
2974 if the index field is valid
2975 KVM_CPUID_FLAG_STATEFUL_FUNC:
2976 if cpuid for this function returns different values for successive
2977 invocations; there will be several entries with the same function,
2978 all with this flag set
2979 KVM_CPUID_FLAG_STATE_READ_NEXT:
2980 for KVM_CPUID_FLAG_STATEFUL_FUNC entries, set if this entry is
2981 the first entry to be read by a cpu
2982 eax, ebx, ecx, edx: the values returned by the cpuid instruction for
2983 this function/index combination
2984
2985 2985
29866. Capabilities that can be enabled on vCPUs 29866. Capabilities that can be enabled on vCPUs
2987-------------------------------------------- 2987--------------------------------------------