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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03964C00144 for ; Mon, 1 Aug 2022 23:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=si0EwPOtWNkOaWz+IP/O9t9EcMA11N0lz8sES/szEvk=; b=BCqJ/ToBKOYfCT nFOwYr7VGU0qeAO791xnWlk8JFHdl7PrstwGgLWy0XEirg2sAxPoWMMq4Uo8Hkr02Kf1Drl1LWxjE 2LzFuAieG2KpOy5loEIaO31Uca9a6JRANNAATpxrnuoVgNpYczjzI3TBqVFI/U/CKE72jkGauTxb1 5AuX2mDvak54E36GH/Htqycq/XrNCro9WPLXcpa2+niAeBAE4jeTey04Zii5j40HS4rHam8a95deq IcD7MHJgJzMscAY10kAc7l0rsJrPhU7sLQQJ94/A3LFPY3lqHe1xC9g/KphdV6oxdtCgobB/sqYSr pT960TRXun6YTb1/uRUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIeQD-00BoDS-Dk; Mon, 01 Aug 2022 23:02:01 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIeQ9-00Bo9Y-MJ for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 23:01:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659394917; x=1690930917; h=date:from:to:cc:subject:message-id:mime-version; bh=qaxB4sl8a/rH+tTAChpuZTrtwZkUmR2acUchCg95ECU=; b=QlVaPyuWTf6ElyqUmZM57JmiEkhEiMSpEyAOvpBuOmqOiI8JBHz8w17E eS+NIzgAkUPA/iwxrqnWvft4nkHLunxb2bmyOlOg9wQhiz85OfDvmgThu gU04VnuI9nmhWjuHPSi26Bs2DHwZmcDoRiuVQ8Cbnx5sy/+QSWC5VBmQz vNgEyjXj1z6hKGf0Inb50AfOGyi8u5S6B56jzAxe9bh+PpEcLLV3Evn5M lJ27bxa/iFhCpi2flIHKYajWRGodqX2A6CourFkRl5qXQSU/DnIHVrGM1 9eFC83U7JEciDIoPx8vxqyAGjf6F0OACjlz/xP8IsBxrrVHSpTHJzKcUp Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="269650398" X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="269650398" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 16:01:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="691633782" Received: from lkp-server01.sh.intel.com (HELO e0eace57cfef) ([10.239.97.150]) by FMSMGA003.fm.intel.com with ESMTP; 01 Aug 2022 16:01:53 -0700 Received: from kbuild by e0eace57cfef with local (Exim 4.96) (envelope-from ) id 1oIeQ5-000FSI-0h; Mon, 01 Aug 2022 23:01:53 +0000 Date: Tue, 2 Aug 2022 07:01:49 +0800 From: kernel test robot To: Marc Zyngier Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: [arm-platforms:kvm-arm64/pmu-chained 6/6] arch/arm64/kvm/pmu-emul.c:175:7: warning: variable 'val' is used uninitialized whenever 'if' condition is false Message-ID: <202208020643.wTCgOkeH-lkp@intel.com> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220801_160157_787363_1BE06928 X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/pmu-chained head: ed5c6c9ddd3a3376659e45652c263cee7ee0ac2f commit: ed5c6c9ddd3a3376659e45652c263cee7ee0ac2f [6/6] rework overflow conditions config: arm64-buildonly-randconfig-r003-20220801 (https://download.01.org/0day-ci/archive/20220802/202208020643.wTCgOkeH-lkp@intel.com/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e) 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 # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=ed5c6c9ddd3a3376659e45652c263cee7ee0ac2f git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git git fetch --no-tags arm-platforms kvm-arm64/pmu-chained git checkout ed5c6c9ddd3a3376659e45652c263cee7ee0ac2f # 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=arm64 SHELL=/bin/bash arch/arm64/kvm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> arch/arm64/kvm/pmu-emul.c:175:7: warning: variable 'val' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!kvm_pmu_idx_is_64bit(vcpu, pmc->idx)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/pmu-emul.c:179:30: note: uninitialized use occurs here __vcpu_sys_reg(vcpu, reg) = val; ^~~ arch/arm64/kvm/pmu-emul.c:175:3: note: remove the 'if' if its condition is always true if (!kvm_pmu_idx_is_64bit(vcpu, pmc->idx)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/pmu-emul.c:163:23: note: initialize the variable 'val' to silence this warning u64 counter, reg, val; ^ = 0 1 warning generated. vim +175 arch/arm64/kvm/pmu-emul.c 154 155 /** 156 * kvm_pmu_stop_counter - stop PMU counter 157 * @pmc: The PMU counter pointer 158 * 159 * If this counter has been configured to monitor some event, release it here. 160 */ 161 static void kvm_pmu_stop_counter(struct kvm_vcpu *vcpu, struct kvm_pmc *pmc) 162 { 163 u64 counter, reg, val; 164 165 if (!pmc->perf_event) 166 return; 167 168 counter = kvm_pmu_get_counter_value(vcpu, pmc->idx); 169 170 if (pmc->idx == ARMV8_PMU_CYCLE_IDX) { 171 reg = PMCCNTR_EL0; 172 val = counter; 173 } else { 174 reg = PMEVCNTR0_EL0 + pmc->idx; > 175 if (!kvm_pmu_idx_is_64bit(vcpu, pmc->idx)) 176 val = lower_32_bits(counter); 177 } 178 179 __vcpu_sys_reg(vcpu, reg) = val; 180 181 kvm_pmu_release_perf_event(pmc); 182 } 183 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel