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 E8F5FC02198 for ; Mon, 10 Feb 2025 09:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qrp2D4IaNIONEJ6iZskrP9z0mXL+Y+o7srm3cMYw2qQ=; b=YA+ZqUpRxYvb5/gRAbK2TSPtIf ADmKPPE19i1F0ZGJN6HpFWlRw1KNZOavME6rlHScemyGQ1+U/86obrq9P4QVgUOTpRSVA/yEOwW2J mWEE9k/lxsIQvlF0LBeAT1WAp5rivIyjo7aDp2cVrd5Ao5LORzHAW1IVWYlcTz9dTHKf5b9HdXPbn ltSVPDC2BFigpxeOg3D9/8mwxqTioW7kzZ03aatdMnqgoh6LKtqI91c4hzc8bb4HTQy33DSN6lTSB xmM7x5TLdpErmmiSx+vtiErsv/fi7sBTAmTImCFsCh3LYxSd0lyOsNcbTNM+QKR42juSMoTCuGsIT uoxPIuxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thQ1S-0000000GoEH-3nB5; Mon, 10 Feb 2025 09:24:10 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thPyv-0000000GnkV-1QOd for linux-arm-kernel@lists.infradead.org; Mon, 10 Feb 2025 09:21:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 36A695C0099; Mon, 10 Feb 2025 09:20:53 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250210_012133_467103_8BFC72AF X-CRM114-Status: GOOD ( 22.59 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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.