mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 00:30:52 +07:00
a4429e53c9
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>
18 lines
402 B
C
18 lines
402 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LINUX_KVM_PARA_H
|
|
#define __LINUX_KVM_PARA_H
|
|
|
|
#include <uapi/linux/kvm_para.h>
|
|
|
|
|
|
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 */
|