From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30860C433F5 for ; Mon, 23 May 2022 05:49:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 71E4B6B0005; Mon, 23 May 2022 01:49:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CF936B0006; Mon, 23 May 2022 01:49:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BE006B0007; Mon, 23 May 2022 01:49:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4E1156B0005 for ; Mon, 23 May 2022 01:49:55 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2BEF820DD5 for ; Mon, 23 May 2022 05:49:55 +0000 (UTC) X-FDA: 79495931550.07.D7F69F9 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by imf30.hostedemail.com (Postfix) with ESMTP id 6337280029 for ; Mon, 23 May 2022 05:49:27 +0000 (UTC) Received: by mail-yb1-f169.google.com with SMTP id z7so2261213ybf.7 for ; Sun, 22 May 2022 22:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bwC5QQGi/RwlldZWVkMNteflbAkL+jLDxrVZ/7sdTFs=; b=ZtOkIZ84R1vXKoMYcIcH/R3JHRpOeXFkHN5RMBGubWC93CPtVjTEhpYyfHeLRF7LYf MUX3sN9FsA39zWskA6NoYYNlUrI7YGbLNABvPfwrOv+8wiORZ25kfSsJ6YAnBbRz2Wmc kOKXAJZbgDgSPVafeg0edLj1rpidRLlTsBA3rAORGj1qdvGA7Pvvyy0vS2ulkOFSUig3 89w37JS91GDOGBwzinnVdzb+OkBZZRNgpkdumF3RBufn3QcwtNx6rXwZnQyMRDkInrgr Vc8ogNtijt2ayD2Ce6qLVMB68s60ETf6K5Phqb2SnA7PGMJHXDTYAj90uNxFoGehGf7s HICQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bwC5QQGi/RwlldZWVkMNteflbAkL+jLDxrVZ/7sdTFs=; b=tispEA4/YSGBDnslu/9Go1pAul1HtiFVTE9n+BOvAEw2Rc9CWuIpoUBu9GtdhN/XtI gsxZaoZmK2MHQ6TPYnCQmuYOOpGs8d6c2P1GfvBnvsVtDy0z444nmS10QR7paXZJ7Cib fH1FaIN8FC/sMKbXjgkgPos2dC77YOPhjqOI7/qrtN0tc9Lu0XYlxDaFveRZUbjijKce JGcoQHV6ER4RMFzFUJmkKuCjXZaOW+bszTA2aKoCrGmzzBzsDb5tzs99QIpzUdBMZy9B RbHXEPoMva+bHaq97oI5DQJ5UYKYt1VIRTv/ergRoUxcTGuBQw2EkiRPJV//DFVWcNy4 owYA== X-Gm-Message-State: AOAM530VV5YKXtbIbaDyRnWyVT58YESEh0XT7ExJdm6FarMNVwQxGjX9 GM5nYHkyRatvEe+znAuCn1ZaAWY5GSRcAkMo2kn5hA== X-Google-Smtp-Source: ABdhPJw06RNDX+RfVK9zAYMFdvIxjdxqt0oRtTzUPXmnLtm6NJVTSuhbJa4NUsbz8A6skUym4vj01qOjnpNDwY8qlLg= X-Received: by 2002:a05:6902:1004:b0:64f:4748:e8be with SMTP id w4-20020a056902100400b0064f4748e8bemr17911740ybt.537.1653284993871; Sun, 22 May 2022 22:49:53 -0700 (PDT) MIME-Version: 1.0 References: <202205201624.A4IhDdYX-lkp@intel.com> In-Reply-To: From: Naresh Kamboju Date: Mon, 23 May 2022 11:19:42 +0530 Message-ID: Subject: Re: [linux-next:master 12308/12886] arch/x86/kvm/hyperv.c:1983:22: warning: shift count >= width of type To: Nathan Chancellor , Vitaly Kuznetsov , Yury Norov Cc: kernel test robot , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Jim Mattson , Joerg Roedel , Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Wanpeng Li , kvm list , open list , X86 ML , lkft-triage@lists.linaro.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6337280029 X-Stat-Signature: 4q7oy6i9icg7h4n3ug16rpy4wmd4znzc Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=ZtOkIZ84; spf=pass (imf30.hostedemail.com: domain of naresh.kamboju@linaro.org designates 209.85.219.169 as permitted sender) smtp.mailfrom=naresh.kamboju@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Rspam-User: X-HE-Tag: 1653284967-846835 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 20 May 2022 at 21:18, Nathan Chancellor wrote: > > Hi Yury, > > On Fri, May 20, 2022 at 04:24:32PM +0800, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: 21498d01d045c5b95b93e0a0625ae965b4330ebe > > commit: 81db71a60292e9a40ae8f6ef137b17f2aaa15a52 [12308/12886] KVM: x86: hyper-v: replace bitmap_weight() with hweight64() > > config: i386-randconfig-a011 (https://download.01.org/0day-ci/archive/20220520/202205201624.A4IhDdYX-lkp@intel.com/config) > > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e00cbbec06c08dc616a0d52a20f678b8fbd4e304) > > reproduce (this is a W=1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=81db71a60292e9a40ae8f6ef137b17f2aaa15a52 > > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > git fetch --no-tags linux-next master > > git checkout 81db71a60292e9a40ae8f6ef137b17f2aaa15a52 > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All warnings (new ones prefixed by >>): > > > > >> arch/x86/kvm/hyperv.c:1983:22: warning: shift count >= width of type [-Wshift-count-overflow] > > if (hc->var_cnt != hweight64(valid_bank_mask)) > > ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/asm-generic/bitops/const_hweight.h:29:49: note: expanded from macro 'hweight64' > > #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w)) > > ^~~~~~~~~~~~~~~~~~~~ > > include/asm-generic/bitops/const_hweight.h:21:76: note: expanded from macro '__const_hweight64' > > #define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32)) > > ^ ~~ > > include/asm-generic/bitops/const_hweight.h:20:49: note: expanded from macro '__const_hweight32' > > #define __const_hweight32(w) (__const_hweight16(w) + __const_hweight16((w) >> 16)) > > ^ > > note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) > > include/asm-generic/bitops/const_hweight.h:10:9: note: expanded from macro '__const_hweight8' > > ((!!((w) & (1ULL << 0))) + \ > > ^ > > include/linux/compiler.h:56:47: note: expanded from macro 'if' > > #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) > > ^~~~ > > include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' > > #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) > > ^~~~ LKFT build system found these build warnings / errors on Linux next-20220520. > I think this is the proper fix, as valid_bank_mask is only assigned u64 > values. Could you fold it into that patch to clear this warning up? The proposed patch below was tested and it fixed the reported problem on 32-bit > Cheers, > Nathan > > diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c > index b652b856df2b..e2e95a6fccfd 100644 > --- a/arch/x86/kvm/hyperv.c > +++ b/arch/x86/kvm/hyperv.c > @@ -1914,7 +1914,7 @@ static u64 kvm_hv_send_ipi(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc) > struct hv_send_ipi_ex send_ipi_ex; > struct hv_send_ipi send_ipi; > DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS); > - unsigned long valid_bank_mask; > + u64 valid_bank_mask; > u64 sparse_banks[KVM_HV_MAX_SPARSE_VCPU_SET_BITS]; > u32 vector; > bool all_cpus; Reported-by: Linux Kernel Functional Testing Tested-by: Linux Kernel Functional Testing -- Linaro LKFT https://lkft.linaro.org