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 263BC14A639; Mon, 10 Feb 2025 09:21:32 +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=1739179293; cv=none; b=pZKz/7oemqwCtw8POGmM5wuoweGqTyuf39ysXmiEAdvw8YGXjMsjfYGSm/hO0Md3hH0TLXwY2z+lXxHi3hLc0jBQXDLABZZQpJQAKparLe30WSl3L0rmCauBEivAxB+Mx3WsAbPwgrLKJ8pQyR2iRIGsaTj6a4MjUSbNWTCNAtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739179293; c=relaxed/simple; bh=vBG2TnCFp07FXDNxi+pNodmf7UR3oHXHYl3Z5N+P8q4=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=HtGK6UWnsq+zXBIPUYCVfuUwF5Yz3KHWXRuDnqe6B3uQOCkya7FblQ84+i69s4ONHMxDw1neLqSdPaTFHDTp0igEVzDJXw4S2SNu1+WGpeC/Ym+1QgNduFXNGDfo4zMt2eeFR2btD/bmDndyFDb9vVhJKOLAZkg2mhmJgFAVy7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S8pLXoFa; 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="S8pLXoFa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890AAC4CED1; Mon, 10 Feb 2025 09:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739179292; bh=vBG2TnCFp07FXDNxi+pNodmf7UR3oHXHYl3Z5N+P8q4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S8pLXoFaEcX/xnssNk5tIf4vioqZJx+XLNBGcu5HVwDsLTG+4+lf83MbnLNUvJwDl 2H6+7girgSa3KVdfRS+756qt4748hnYytjRlGV7H2R8Gj3sK0iL9V7gz82H4nkZz9K GZeQXGT5qbM0ZQRZXH0n0hMViLhv+Z1FBBbilNjEQIdq1dOrF30IPjZQCiSCQ0D4ym C2NO3Yksq0sGYNb+zS4g0ZSZqBkV/6W21GFmg70/DyqJKvbxenpIYg4Qansb0fbGTW n3tQ+IrSVyQDsHmYzK+DkqqoWp54MBII1nR9Fg3RlL0Xs67mx6n3vP1v0apysJ6ykF Fqb2dlHUVDFgA== 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 1thPyr-002TTI-Qu; Mon, 10 Feb 2025 09:21:30 +0000 Date: Mon, 10 Feb 2025 09:21:29 +0000 Message-ID: <868qqetasm.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret , kernel test robot Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Oliver Upton Subject: Re: [kvmarm:fixes 18/18] arch/arm64/kvm/hyp/nvhe/mem_protect.c:1086:9: warning: variable 'ret' is uninitialized when used here In-Reply-To: <202502100911.8c9DbtKD-lkp@intel.com> References: <202502100911.8c9DbtKD-lkp@intel.com> 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: llvm@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 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qperret@google.com, lkp@intel.com, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, oliver.upton@linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 10 Feb 2025 01:39:04 +0000, kernel test robot wrote: >=20 > tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git= fixes > head: eabc7aaef7a553b64bf6e631ce04526af6c8d104 > commit: eabc7aaef7a553b64bf6e631ce04526af6c8d104 [18/18] KVM: arm64: Simp= lify np-guest hypercalls > config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250= 210/202502100911.8c9DbtKD-lkp@intel.com/config) > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b= 5c1ec4a3095ab096dd780e84d7ab81f3d7ff) > reproduce (this is a W=3D1 build): (https://download.01.org/0day-ci/archi= ve/20250210/202502100911.8c9DbtKD-lkp@intel.com/reproduce) >=20 > If you fix the issue in a separate patch/commit (i.e. not just a new vers= ion of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202502100911.8c9DbtKD-lkp= @intel.com/ >=20 > All warnings (new ones prefixed by >>): >=20 > >> arch/arm64/kvm/hyp/nvhe/mem_protect.c:1086:9: warning: variable 'ret' = is uninitialized when used here [-Wuninitialized] > 1086 | return ret; > | ^~~ > arch/arm64/kvm/hyp/nvhe/mem_protect.c:1076:9: note: initialize the var= iable 'ret' to silence this warning > 1076 | int ret; > | ^ > | =3D 0 > 1 warning generated. Nice catch. I wish the compiler would warn for these by default... Quentin, are you happy with the following patch that I can stash on top of the current set of fixes? M. =46rom 5da62486aeda7d7d11107db8ed4e6421e3a2a364 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 10 Feb 2025 09:17:58 +0000 Subject: [PATCH] KVM: arm64: Fix __pkvm_host_mkyoung_guest() return value Don't use an uninitialised stack variable, and just return 0 on the non-error path. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202502100911.8c9DbtKD-lkp@int= el.com/ Signed-off-by: Marc Zyngier --- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvh= e/mem_protect.c index 4c2f6a6a2efe1..19c3c631708ce 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -1073,7 +1073,6 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hy= p_vcpu *vcpu) { struct pkvm_hyp_vm *vm =3D pkvm_hyp_vcpu_to_hyp_vm(vcpu); u64 ipa =3D hyp_pfn_to_phys(gfn); - int ret; =20 if (pkvm_hyp_vm_is_protected(vm)) return -EPERM; @@ -1083,5 +1082,5 @@ int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hy= p_vcpu *vcpu) kvm_pgtable_stage2_mkyoung(&vm->pgt, ipa, 0); guest_unlock_component(vm); =20 - return ret; + return 0; } --=20 2.39.2 --=20 Without deviation from the norm, progress is not possible.