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 E51DF3B893F; Wed, 22 Jul 2026 09:01:07 +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=1784710869; cv=none; b=KnFDS59oSbhTAVxHDODTf5kgYX86OyO1Kc6hstGxxxsfs8lvOGBw8no5bYk0hF1yNuSoxoBTKxZTwvHF0WLONhCidNMBujircwxxWsMWJYEE+QT6tn8fFH+hnXXaJD/eZ4eiYl/IZd+6IhbuetqRq/aPJbKsngHIc1uGGgP4RBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784710869; c=relaxed/simple; bh=sia0pWxdyOTzen9ICLGqD8LHSzWaRc57OQWh8I6lUXk=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=IcPezUHOb573xXXkDqGMOSxnRwR3tTr1IqNX3IVNkPA+Xvm0mehTHWpGNm4LnoCFn6+oyvyYjiXk0hT+iPMxAFSComMPrmurzgqe0DqjVS53RWQpc4ZX8miyAgqV8v7jrRljW/XO5EDKCCIRAbeJVkQ59Ocydq6O5Yfq2MluCow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mv8beTWz; 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="Mv8beTWz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C4CE1F000E9; Wed, 22 Jul 2026 09:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784710867; bh=Mxvq17phTvOIz+F95XW32eAWCY41W57wVkFwPwUBYh4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Mv8beTWz2LfpgGNIJMAFQJ4kB1xxMPKaX7zPN9y78nnh6CLeGJk9GLYwLW+HtpLJ1 cjp/TOmTp9FEiwt6CkKnolf7aQbC4B3Jae2IyeC17X75fvRjS5IrR+S1nOv+qomedh icbmNAF2rc9z6Xths6L4ngxWWOKCWU48UTL+SoxRxLeLIHk2MIpwp/ejEgYLOSw4RF qeyVwmHfHIeSfFqDrUEpIkVUqFAHsqjH2jeAJMoKI4DvAUIKm9BhwR4aFGViPdB2mw rfH0OFgaruZGoYEzux4GriF5KlPHDxQBHh8mD3uqRJrG7ID3VitQe+wnljGJ0sbGKx BKJvViwPWKoUg== 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 1wmSp7-00000007Y1a-2OmI; Wed, 22 Jul 2026 09:01:05 +0000 Date: Wed, 22 Jul 2026 10:01:05 +0100 Message-ID: <86o6fze6um.wl-maz@kernel.org> From: Marc Zyngier To: sashiko-reviews@lists.linux.dev Cc: kvm@vger.kernel.org, "Oliver Upton" , kvmarm@lists.linux.dev Subject: Re: [PATCH v3 11/28] KVM: arm64: Expose FEAT_NV2p1 to NV guests In-Reply-To: <20260722083253.1F3351F000E9@smtp.kernel.org> References: <20260722074234.3330999-1-maz@kernel.org> <20260722074234.3330999-12-maz@kernel.org> <20260722083253.1F3351F000E9@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, kvm@vger.kernel.org, oupton@kernel.org, kvmarm@lists.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 Wed, 22 Jul 2026 09:32:52 +0100, sashiko-bot@kernel.org wrote: > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] The ARM64_HAS_NV2P1 CPU feature capability is checked dynamically to enable FEAT_NV2p1 logic in KVM, but the capability is never registered in the kernel's CPU feature framework, rendering the new feature entirely dead code. > -- > > --- Patch [11]: [PATCH v3 11/28] KVM: arm64: Expose FEAT_NV2p1 to NV guests --- > commit 2bb48d2c7459805b9d877b250f95afb9c6786a43 > Author: Marc Zyngier > > KVM: arm64: Expose FEAT_NV2p1 to NV guests > > This commit exposes the FEAT_NV2p1 feature to nested virtualization guests by > updating the ID_AA64MMFR4_EL1 register limits when the hardware capability is > present. This intends to reduce the number of traps for NV guests. > > > diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c > > index fb54f6dad995c..82be8bcb07035 100644 > > --- a/arch/arm64/kvm/nested.c > > +++ b/arch/arm64/kvm/nested.c > [ ... ] > > @@ -1738,7 +1738,11 @@ u64 limit_nv_id_reg(struct kvm *kvm, u32 reg, u64 val) > > if (test_bit(KVM_ARM_VCPU_HAS_EL2_E2H0, kvm->arch.vcpu_features)) { > > val = 0; > > } else { > > - val = SYS_FIELD_PREP_ENUM(ID_AA64MMFR4_EL1, NV_frac, NV2_ONLY); > > + val &= ID_AA64MMFR4_EL1_NV_frac; > > + if (cpus_have_final_cap(ARM64_HAS_NV2P1)) > > [Severity: Medium] > Is ARM64_HAS_NV2P1 registered in the kernel's CPU feature framework? > > It appears that the ARM64_HAS_NV2P1 capability is missing from the > arm64_features array in arch/arm64/kernel/cpufeature.c. Because it is not > mapped to a hardware ID register field, this capability check in > limit_nv_id_reg() will always evaluate to false. > > Does this render the newly added FEAT_NV2p1 support unreachable? See follow-up patch. M. -- Without deviation from the norm, progress is not possible.