KVM: x86: hyperv: optimize sparse VP set processing
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 10 Oct 2018 15:14:38 +0000 (17:14 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:30:01 +0000 (00:30 +0200)
commitf21dd494506ad002a5b6b32e50a5d4ccac6929fe
tree464ac2d0ebbe3289c640fdd8d56ecb4859375010
parente6b6c483ebe9b3f82710fc39eff5531b4d80b089
KVM: x86: hyperv: optimize sparse VP set processing

Rewrite kvm_hv_flush_tlb()/send_ipi_vcpus_mask() making them cleaner and
somewhat more optimal.

hv_vcpu_in_sparse_set() is converted to sparse_set_to_vcpu_mask()
which copies sparse banks u64-at-a-time and then, depending on the
num_mismatched_vp_indexes value, returns immediately or does
vp index to vcpu index conversion by walking all vCPUs.

To support the change and make kvm_hv_send_ipi() look similar to
kvm_hv_flush_tlb() send_ipi_vcpus_mask() is introduced.

Suggested-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/hyperv.c