Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1714039ioo; Mon, 23 May 2022 01:14:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL4KtSAPmmqCP+hPhpyyNpJqSDKYqds23uRKU6ibBWMQmJvrHiCEbGRgIt2sU7lZrLtffw X-Received: by 2002:aa7:8256:0:b0:4e0:78ad:eb81 with SMTP id e22-20020aa78256000000b004e078adeb81mr22450600pfn.30.1653293694954; Mon, 23 May 2022 01:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653293694; cv=none; d=google.com; s=arc-20160816; b=tI0vsqpJi2f+4+pR6R0Kz1DdyPmv0PU0wDKN1ckftztQaZk0iUQGv0b7+mWmo65rPw SVlkULdSt5KiVHM1X10J/iB1fLbZ6IlXFY1gTiIJO4h6U2eIuDf294r3UY3Ki/MtK6mX Y4fjiS73E6V7Ut757FlYQLFyNrrtpFYWneW0Y9WxGilA+4aRXlCic8Ol8yPA6SAC/6GE bmcd8TrvOx7jYIDqnj8GuUN1c+nJ/8PFKhF3VLS2aBffFxpEcF2awCgw6OZfVstM4Lyx JD6OhAad6FRVZWkdO8ws5UQioylOsn9XHRTBaQ68MhPL0WXcto4BE4rBjeu2az2qclvO gvKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bwC5QQGi/RwlldZWVkMNteflbAkL+jLDxrVZ/7sdTFs=; b=g6ElPTxjPx8I5P+Mr1RGMDK+B/4fLyqFjpv8QtfwJjkMjPcNAIBdT9Z2npWA+WKQI9 RZ46tDKZWS2+NO44ukvQryccd7hqfE0SWCg6MhjAcEo5Ys2RQ1yxFjVxhTBkD7JXAz10 x1VGDuGCX+34vaQWh2/mRWSIG7T/Vi9sUMO/6FO2R5dLhhoFqxcaqac+3/kLhfDQJ0Yh S9naCJ+uVuEZpR/aVp6LZqMCh62Dc46dDcsvjTPtBo4Kp+dtYdc2UYWP5EhVz5mS+h/8 n+8QYSgqOZsbjZWAPo+JLpqF5nWyDpMIT5tJ9jQd85+oDE08L//eJZXzTlUpZsVarkLF vMPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZtOkIZ84; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s15-20020a17090302cf00b001582df39d27si9815361plk.175.2022.05.23.01.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZtOkIZ84; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2FB8E2C106; Mon, 23 May 2022 00:09:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbiEWFuC (ORCPT + 99 others); Mon, 23 May 2022 01:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbiEWFt6 (ORCPT ); Mon, 23 May 2022 01:49:58 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB8F2AE0E for ; Sun, 22 May 2022 22:49:54 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id x2so23192992ybi.8 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=Tgv8NWP4WDB+8DVkwj5k79+Ue552Ve5MjiXx3ZSlwaPy/aK5rhOKm7h65JfRATqGNY FJSlDSKoeQnOPWr4uB4CRun6swF/2tNj+TYkdmN7NPmhzijVUuFjwO6Hh/aG93NZq5mo qmQcWku2R2DnHNOQdCWrb4HZcY12oGuzCAsLsaao/h3KsDHVlv5VlSJmKvaim5VzokP8 GgaAjpO+Ow830jNVd1HQ+2H2xq1UQRhJSWHhaGhYYME8QXxGCX/8yQiZBDL2mwjKZ7Tk IlKC3+p+gHtYOZ7o52VmZP2u7oevym6BTqZIrji93VHUcsKCgfThue/xqHZ29k3R4b0g bZRA== X-Gm-Message-State: AOAM531IKeEeb2G8XfO0gh4v8mAraeBb7yUHCz2oAzoX1odygY9J/zW7 4xCYuzd77Tk01cVmAWDxaZRdF5upSvSIlxkcSfQZAQ== 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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