From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AFBA1ABED7; Wed, 23 Oct 2024 12:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729687386; cv=none; b=jitlZZKXr5KfBBGP1/dgxWfuv1cRpF/GDawkGRWn78lU3fvfChgVzvletsLmsmq6y9STPMRgzEjn2HmEFvEBy2T+267m3mb9yvdMzT9b3rhFVuppZuLZXcbIISst4elCSL/61nKDabkURZksAyaPWg3F4gopWeyHXB9JWcLQkbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729687386; c=relaxed/simple; bh=/0gWrh16eEWBSX+EPa2gr0cMPyjlfx819x1/Kch8gss=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=LBxKw603VA+ylM9A09Il5zG45v0j6KfuYLrPZkInRdV5uW3owGygSMfABadHnnFLmgqpAK7o5yfNRZbtEOU6Uw+dC+CU4vk8BsHIfb/0Qjh7f34on59BJFaN4Qf24sJD7x5sO2s+QmiZQMQVOjlHgWov/O6X0uVfzeXX/CIjcek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H/4j2sXW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H/4j2sXW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10930C4CEC6; Wed, 23 Oct 2024 12:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729687386; bh=/0gWrh16eEWBSX+EPa2gr0cMPyjlfx819x1/Kch8gss=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H/4j2sXW/ZcyFCdp59G7vm+FirRp88lq6JnvXQka7ABAgnLeiG6csHZo0bMuuyQ89 0m4ivFyzjv4TIyfvQFR7FZStkYNTlk8Ym6Sd4HTh9dU/9YKSB+XBG9keXtCTD2eIGk oI7Xkaj/ySgJTACjpz+6H7bHBJSAMtd0zQx5/PMHT/QDow32RBCbJtBklInKipMU0U +4m46eqkyJ0ZVYZeHIyPG3seUMWezloPu0ZmPKCxwi16CvU9qtC/Ig2/Y/zABdYMZd 6MbN/rdtdJ5vyv/EPbNmnEHfglqtc576vJ88WSRruHW39HDce6QQjb70UhMN/4zu8t FibgB1E65Q4AQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t3ahb-0066R3-SH; Wed, 23 Oct 2024 13:43:03 +0100 Date: Wed, 23 Oct 2024 13:43:03 +0100 Message-ID: <864j533s88.wl-maz@kernel.org> From: Marc Zyngier To: Dan Carpenter Cc: oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: arch/arm64/kvm/at.c:71 at_s1e1p_fast() error: uninitialized symbol 'fail'. In-Reply-To: <7612de9a-d262-4d40-addb-64449768b35a@stanley.mountain> References: <7612de9a-d262-4d40-addb-64449768b35a@stanley.mountain> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dan.carpenter@linaro.org, oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 21 Oct 2024 08:29:41 +0100, Dan Carpenter wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 3d5ad2d4eca337e80f38df77de89614aa5aaceb9 > commit: be0135bde1df5e80cffacd2ed6f952e6d38d6f71 KVM: arm64: nv: Add basic emulation of AT S1E1{R,W}P > date: 7 weeks ago > config: arm64-randconfig-r071-20241015 (https://download.01.org/0day-ci/archive/20241020/202410200209.bAXXL58Q-lkp@intel.com/config) > compiler: aarch64-linux-gcc (GCC) 14.1.0 > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Reported-by: Dan Carpenter > | Closes: https://lore.kernel.org/r/202410200209.bAXXL58Q-lkp@intel.com/ > > smatch warnings: > arch/arm64/kvm/at.c:71 at_s1e1p_fast() error: uninitialized symbol 'fail'. > > vim +/fail +71 arch/arm64/kvm/at.c > > be0135bde1df5e Marc Zyngier 2024-07-14 52 static bool at_s1e1p_fast(struct kvm_vcpu *vcpu, u32 op, u64 vaddr) > be0135bde1df5e Marc Zyngier 2024-07-14 53 { > be0135bde1df5e Marc Zyngier 2024-07-14 54 u64 host_pan; > be0135bde1df5e Marc Zyngier 2024-07-14 55 bool fail; > be0135bde1df5e Marc Zyngier 2024-07-14 56 > be0135bde1df5e Marc Zyngier 2024-07-14 57 host_pan = read_sysreg_s(SYS_PSTATE_PAN); > be0135bde1df5e Marc Zyngier 2024-07-14 58 write_sysreg_s(*vcpu_cpsr(vcpu) & PSTATE_PAN, SYS_PSTATE_PAN); > be0135bde1df5e Marc Zyngier 2024-07-14 59 > be0135bde1df5e Marc Zyngier 2024-07-14 60 switch (op) { > be0135bde1df5e Marc Zyngier 2024-07-14 61 case OP_AT_S1E1RP: > be0135bde1df5e Marc Zyngier 2024-07-14 62 fail = __kvm_at(OP_AT_S1E1RP, vaddr); > be0135bde1df5e Marc Zyngier 2024-07-14 63 break; > be0135bde1df5e Marc Zyngier 2024-07-14 64 case OP_AT_S1E1WP: > be0135bde1df5e Marc Zyngier 2024-07-14 65 fail = __kvm_at(OP_AT_S1E1WP, vaddr); > be0135bde1df5e Marc Zyngier 2024-07-14 66 break; > > default case? There is no bug here, as evidenced by the *only* caller of this function (__kvm_at_s1e01_fast()): switch (op) { case OP_AT_S1E1RP: case OP_AT_S1E1WP: fail = at_s1e1p_fast(vcpu, op, vaddr); break; So 'op' can only be one of these two values, and at_s1e1p_fast() always initialises 'fail'. I guess this is a case of smatch not seeing beyond function scope. Thanks, M. -- Without deviation from the norm, progress is not possible.