KVM: x86: hyperv: valid_bank_mask should be 'u64'
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 26 Sep 2018 17:02:57 +0000 (19:02 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:29:46 +0000 (00:29 +0200)
This probably doesn't matter much (KVM_MAX_VCPUS is much lower nowadays)
but valid_bank_mask is really u64 and not unsigned long.

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

index f94dedd7ae6d95c1c7d0015e201e082d20675024..a2af1c9489fd219ffc25f08fd211d7c85483e07b 100644 (file)
@@ -1300,7 +1300,7 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *current_vcpu, u64 ingpa,
        struct hv_tlb_flush flush;
        struct kvm_vcpu *vcpu;
        unsigned long vcpu_bitmap[BITS_TO_LONGS(KVM_MAX_VCPUS)] = {0};
-       unsigned long valid_bank_mask = 0;
+       u64 valid_bank_mask = 0;
        u64 sparse_banks[64];
        int sparse_banks_len, i;
        bool all_cpus;
@@ -1328,7 +1328,8 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *current_vcpu, u64 ingpa,
                all_cpus = flush_ex.hv_vp_set.format !=
                        HV_GENERIC_SET_SPARSE_4K;
 
-               sparse_banks_len = bitmap_weight(&valid_bank_mask, 64) *
+               sparse_banks_len =
+                       bitmap_weight((unsigned long *)&valid_bank_mask, 64) *
                        sizeof(sparse_banks[0]);
 
                if (!sparse_banks_len && !all_cpus)