summaryrefslogtreecommitdiff
path: root/arch/x86/include/uapi/asm/kvm_para.h
diff options
context:
space:
mode:
authorWanpeng Li <wanpengli@tencent.com>2018-02-13 04:05:40 +0300
committerRadim Krčmář <rkrcmar@redhat.com>2018-03-06 20:40:44 +0300
commita4429e53c9b3082b05e51224c3d58dbdd39306c5 (patch)
treed0fbeff12679477198902c365cb23ad6b645747c /arch/x86/include/uapi/asm/kvm_para.h
parentd4c67a7a54f12cb8d267284212f1072c95917e5a (diff)
downloadlinux-a4429e53c9b3082b05e51224c3d58dbdd39306c5.tar.xz
KVM: Introduce paravirtualization hints and KVM_HINTS_DEDICATED
This patch introduces kvm_para_has_hint() to query for hints about the configuration of the guests. The first hint KVM_HINTS_DEDICATED, is set if the guest has dedicated physical CPUs for each vCPU (i.e. pinning and no over-commitment). This allows optimizing spinlocks and tells the guest to avoid PV TLB flush. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Wanpeng Li <wanpengli@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/include/uapi/asm/kvm_para.h')
-rw-r--r--arch/x86/include/uapi/asm/kvm_para.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index 6cfa9c8cb7d6..68a41b6ba3da 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -10,8 +10,10 @@
*/
#define KVM_CPUID_SIGNATURE 0x40000000
-/* This CPUID returns a feature bitmap in eax. Before enabling a particular
- * paravirtualization, the appropriate feature bit should be checked.
+/* This CPUID returns two feature bitmaps in eax, edx. Before enabling
+ * a particular paravirtualization, the appropriate feature bit should
+ * be checked in eax. The performance hint feature bit should be checked
+ * in edx.
*/
#define KVM_CPUID_FEATURES 0x40000001
#define KVM_FEATURE_CLOCKSOURCE 0
@@ -28,6 +30,8 @@
#define KVM_FEATURE_PV_TLB_FLUSH 9
#define KVM_FEATURE_ASYNC_PF_VMEXIT 10
+#define KVM_HINTS_DEDICATED 0
+
/* The last 8 bits are used to indicate how to interpret the flags field
* in pvclock structure. If no bits are set, all flags are ignored.
*/