@@ -1534,6 +1534,7 @@ struct kvm_vm_stat {
u64 nx_lpage_splits;
u64 max_mmu_page_hash_collisions;
u64 max_mmu_rmap_size;
+ u64 synic_auto_eoi_used;
};
struct kvm_vcpu_stat {
@@ -149,6 +149,8 @@ static void synic_update_vector(struct kvm_vcpu_hv_synic *synic,
APICV_INHIBIT_REASON_HYPERV,
!!hv->synic_auto_eoi_used);
+ vcpu->kvm->stat.synic_auto_eoi_used = !!hv->synic_auto_eoi_used;
+
up_write(&vcpu->kvm->arch.apicv_update_lock);
}
@@ -256,7 +256,8 @@ const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
STATS_DESC_ICOUNTER(VM, pages_1g),
STATS_DESC_ICOUNTER(VM, nx_lpage_splits),
STATS_DESC_PCOUNTER(VM, max_mmu_rmap_size),
- STATS_DESC_PCOUNTER(VM, max_mmu_page_hash_collisions)
+ STATS_DESC_PCOUNTER(VM, max_mmu_page_hash_collisions),
+ STATS_DESC_IBOOLEAN(VM, synic_auto_eoi_used)
};
const struct kvm_stats_header kvm_vm_stats_header = {
APICv/AVIC is inhibited for guests using Hyper-V's synthetic interrupt controller (SynIC) enlightenment, and specifically SynIC's AutoEOI feature. It is recommended that guests do not enable AutoEOI (see flag HV_DEPRECATING_AEOI_RECOMMENDED and commit 0f250a646382 ("KVM: x86: hyper-v: Deactivate APICv only when AutoEOI feature is in use")), but it can still be used in legacy configurations. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com> --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/hyperv.c | 2 ++ arch/x86/kvm/x86.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-)