From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E0413371873; Tue, 14 Jul 2026 14:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039027; cv=none; b=ksDre56VWj2NnPutqSDeNHhGu74ydzW5fdSsCGBUZzrRGhdqD11URAlixFSPM8HYhLY9G0soiymMvDgSRBEn1Via7X/K9UJjTVQfd10l90va0+rsiN6ZEVifVUMRx742+lrZihqKldLNjwSzn9dnsSS+ZT1fULFwcj8igLrIJ1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039027; c=relaxed/simple; bh=gWk9yXqf6qSyLggNRpfDizVEfzcVgGoCOuJzxY/D5yY=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=TVVSUXKOC2UcM+iMezIw/Z6EfQcJji9ESGEx1Bs4VlavfKSGz0f1+mUxQNOw1ZI5YwUwYGF+W3MpDzmr1wnlw028kuwYAp2Bp5XPUBca5uytY64KJsHPd3JsZQ9UGF4D6Jql1LPnwIN3M5m8J33z0mdr8KylIHJUPEnSOYNl9h8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YDxjuwhF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YDxjuwhF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FCFF1F000E9; Tue, 14 Jul 2026 14:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039025; bh=3deSPY6p7cZU3t7Ksy8ouyzbaZoLlYF+1c0RK/jgVdg=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YDxjuwhFudOSzOFFQ3wLvFlKmE8qgW88T9Fa8JgdReMF6DZB3tsKrdjDehIIFBx6j PAOqKkcHbMJOGTZonJvnfShUSLpaAPAHOf+8m6a5r9n0v85dz2s++hXj/CM7B9tQtM HNydGptLYXWDcoxCxMkut+LwH+MzzMC7gmpFPZ7FaFFZC1KWORuLDbJT4ca3IirXLd 87K9AKws2u0k0OiYoCSnXE3+m8DiDQz8vPfHdgduZEAt4mfe+GgQ7wja8QFlVzplQn bhjq9Z/Sv+H1hRvBEvIeN4eZUWKzONZ4n6nLZy1JalFwqgm4SdP41VZf32BDxw+t1B V6C2htL0vjC8Q== 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.98.2) (envelope-from ) id 1wje2x-00000004wR2-3I2B; Tue, 14 Jul 2026 14:23:43 +0000 Date: Tue, 14 Jul 2026 15:23:43 +0100 Message-ID: <86pl0podjk.wl-maz@kernel.org> From: Marc Zyngier To: sashiko-reviews@lists.linux.dev Cc: kvmarm@lists.linux.dev, "Oliver Upton" , kvm@vger.kernel.org Subject: Re: [PATCH v2 18/28] KVM: arm64: Add kvm_has_nv{2,3}() predicates In-Reply-To: <20260714094803.B3C371F000E9@smtp.kernel.org> References: <20260714091641.1970822-1-maz@kernel.org> <20260714091641.1970822-19-maz@kernel.org> <20260714094803.B3C371F000E9@smtp.kernel.org> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@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: sashiko-reviews@lists.linux.dev, kvmarm@lists.linux.dev, oupton@kernel.org, kvm@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 Tue, 14 Jul 2026 10:48:03 +0100, sashiko-bot@kernel.org wrote: > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] kvm_has_nv3() will always return false because ARM64_HAS_NV3 is never populated in the capabilities bitmap. > -- > > --- Patch [18]: [PATCH v2 18/28] KVM: arm64: Add kvm_has_nv{2,3}() predicates --- > commit e61ff01470e9cbe730c6702e605c3c17d525ca4e > Author: Marc Zyngier > > KVM: arm64: Add kvm_has_nv{2,3}() predicates > > This commit adds a new set of predicates indicating whether a VM is capable > of NV2, NV3, and is in a nested NV3 context. > > > diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h > > index 9831166695186..c562d8171d5e1 100644 > > --- a/arch/arm64/include/asm/kvm_emulate.h > > +++ b/arch/arm64/include/asm/kvm_emulate.h > > [ ... ] > > > +static inline bool kvm_has_nv3(struct kvm *kvm) > > +{ > > + return (cpus_have_final_cap(ARM64_HAS_NESTED_VIRT) && > > + cpus_have_final_cap(ARM64_HAS_NV3) && > > [Severity: Medium] > Will kvm_has_nv3() always return false here? > > It appears the ARM64_HAS_NV3 capability was added to the cpucaps tools, but > the corresponding hardware detection entry is missing from the arm64_features > array in arch/arm64/kernel/cpufeature.c. Since it is never populated, > cpus_have_final_cap(ARM64_HAS_NV3) will unconditionally evaluate to false, > turning any code relying on this predicate into dead code. Patch #26 is your friend. M. -- Without deviation from the norm, progress is not possible.