KVM: x86: hyper-v: Avoid calling kvm_make_vcpus_request_mask() with vcpu_mask==NULL
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 3 Sep 2021 07:51:36 +0000 (09:51 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 12 May 2023 04:08:40 +0000 (05:08 +0100)
commit7b62b074c5541fd90d34603abf9242933ff24a8a
tree44c26668f696c5b65a354cc9c1d7893c4c3f1382
parent9b183bff897d8330d80cbfc921c51643b35fdac4
KVM: x86: hyper-v: Avoid calling kvm_make_vcpus_request_mask() with vcpu_mask==NULL

Origin: https://git.kernel.org/linus/6470accc7ba948b0b3aca22b273fe84ec638a116
Bug-Debian: https://bugs.debian.org/1035779

In preparation to making kvm_make_vcpus_request_mask() use for_each_set_bit()
switch kvm_hv_flush_tlb() to calling kvm_make_all_cpus_request() for 'all cpus'
case.

Note: kvm_make_all_cpus_request() (unlike kvm_make_vcpus_request_mask())
currently dynamically allocates cpumask on each call and this is suboptimal.
Both kvm_make_all_cpus_request() and kvm_make_vcpus_request_mask() are
going to be switched to using pre-allocated per-cpu masks.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210903075141.403071-4-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name KVM-x86-hyper-v-Avoid-calling-kvm_make_vcpus_request.patch
arch/x86/kvm/hyperv.c