On 08/10/2018 19:19, Vitaly Kuznetsov wrote: > + memset(vp_bitmap, 0, (KVM_MAX_VCPUS / 64) * sizeof(*vp_bitmap)); > + for_each_set_bit(bank, (unsigned long *)&valid_bank_mask, 64) This "64" should probably be "KVM_MAX_VCPUS / 64"... and actually both should be DIV_ROUND_UP(KVM_MAX_VCPUS, 64), so it's better to introduce something like a "#define KVM_HV_MAX_SPARSE_VCPU_SET_BITS". Paolo > + vp_bitmap[bank] = sparse_banks[sbank++];