diff options
author | Wanpeng Li <wanpengli@tencent.com> | 2018-02-13 04:05:40 +0300 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-06 20:40:44 +0300 |
commit | a4429e53c9b3082b05e51224c3d58dbdd39306c5 (patch) | |
tree | d0fbeff12679477198902c365cb23ad6b645747c /include/linux/kvm_para.h | |
parent | d4c67a7a54f12cb8d267284212f1072c95917e5a (diff) | |
download | linux-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 'include/linux/kvm_para.h')
-rw-r--r-- | include/linux/kvm_para.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h index 51f6ef2c2ff4..f23b90b02898 100644 --- a/include/linux/kvm_para.h +++ b/include/linux/kvm_para.h @@ -9,4 +9,9 @@ static inline bool kvm_para_has_feature(unsigned int feature) { return !!(kvm_arch_para_features() & (1UL << feature)); } + +static inline bool kvm_para_has_hint(unsigned int feature) +{ + return !!(kvm_arch_para_hints() & (1UL << feature)); +} #endif /* __LINUX_KVM_PARA_H */ |