Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1005479imm; Wed, 26 Sep 2018 10:04:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SgkYCyktWVF7GkDQzv8Ksl+MwEjiQilBl/IG9fnM75hEB0rknL+EMxAHCvzu/RvQ0V0dP X-Received: by 2002:a17:902:c3:: with SMTP id a61-v6mr6750529pla.279.1537981452596; Wed, 26 Sep 2018 10:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537981452; cv=none; d=google.com; s=arc-20160816; b=db2hwRpkBmbR7O3HLeE/oC8d5YZP3powzquB+ie5jijmCQSbDLEPcbQ8jGKsJmE1Xr rRkR3iDxQyiejY8z710WxjKlDCeBhcsmZ1htxQwUykQru4omLjOVfkA4CgRt2NJE1vFJ akJQ8yYMWHfYRoLMZJhYdJy4RF9iwr+oDAwrSEqE4Xcbbekdan2lKD0WEgvnnMpR04Si gIJmOM1I5NHeJEbM9xEOMFYYMlQxA4h7HEA6g7D82WRJ45mqqBRimjWdxm5SdDYYyDr6 g13wW7+Als6E85A9Zi/0Jnb6YIPj6f7tB7kRpZmKvj30B2Al6If5QFFSDrvHfGhmzyhP GktQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=fmeypf53+T4CYPRa+tDV2E1TLBWUKWGBCXPFUvorDCg=; b=RyXhj0e04PJ7SR/JpTvQWZKgOGqpAySrV+XKcFicquHw/MBnuifMDFG/5+9mehJI7T FojasGP+tOZ++8zO59bU5BfkluxrwRs6XR6jvBlYHAzwntK3MYnLiqQ9JbQtGk2SL2wR s5dDZhIzD+aXNqPaFJp0F8+GLZPGHxYHeWUGBE4hqCAenPCQLS7gAs1FPCYdkFGXI7NM wMqzJLrC6svSCpTkfllnAtfhKTzvMViSj26tNOibqdTpgP1yBM0aL82Cg345PC8GcCVO iVZxybFRsSmlcIde0HMF9Ay+1HzD0ZWdrTJ5CRclLCHq1GJ+DpHE2F0Omg1sFcEYaUBX Q72A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf12-v6si2527696plb.433.2018.09.26.10.03.57; Wed, 26 Sep 2018 10:04:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728874AbeIZXRW (ORCPT + 99 others); Wed, 26 Sep 2018 19:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728823AbeIZXRV (ORCPT ); Wed, 26 Sep 2018 19:17:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05DEA30001E2; Wed, 26 Sep 2018 17:03:29 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id B576C60BE7; Wed, 26 Sep 2018 17:03:17 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Wanpeng Li , linux-kernel@vger.kernel.org Subject: [PATCH v6 5/7] KVM: x86: hyperv: valid_bank_mask should be 'u64' Date: Wed, 26 Sep 2018 19:02:57 +0200 Message-Id: <20180926170259.29796-6-vkuznets@redhat.com> In-Reply-To: <20180926170259.29796-1-vkuznets@redhat.com> References: <20180926170259.29796-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 26 Sep 2018 17:03:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kvm/hyperv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 6a19c8e3c432..eeb12eacd525 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -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) -- 2.17.1