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 5420BC4450A for ; Tue, 14 Jul 2026 09:17:20 +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: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZwUtkaBfc1/bGDoMdw8wkMEGT7WDFKoW/EX/Xh2aA+Y=; b=tt0FfTeQ/zl2NbQBIdYMdtdIz/ MpIP+mIgdb6GHW3+NgArfqx2v5ctvwpkjh6XpTm0UbX9Utu/OdRPcH+ObwuR4Boa+J9JZ+qAxULCv vfYqh7BAHMj4elZrcD9EMYV438S1oRCnfGxqIA4lfAwZa6JAzP4sK/YFVBssshbfiq5EAonVMelR5 2AJdBoNbFespNwWhsiv0GEtV31TgQV+Njl3Tqgy0urveiyx2hH9qF3Wzqp1VDJAmdBkJeJGgQJjzj aySoG63AIz81axAJXzArVKTH8UlYyX175m6wbVgZtZK3QnDlR9nUA64Q+bQfMbQqM0E8ETUV5Hw4d vZb65EjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjZGH-0000000BPUq-097F; Tue, 14 Jul 2026 09:17:09 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjZG2-0000000BP3g-2VNS for linux-arm-kernel@lists.infradead.org; Tue, 14 Jul 2026 09:16:54 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 87421408B6; Tue, 14 Jul 2026 09:16:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B5BD1F00ACA; Tue, 14 Jul 2026 09:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784020614; bh=ZwUtkaBfc1/bGDoMdw8wkMEGT7WDFKoW/EX/Xh2aA+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Noo4crISgwy+f8EI22NzQCVBOdZfRfcckn/W/Muv3K9XkA4OaUCIaEQHLr1+zfbIh 7aX65kA7xSYhvuH8lm28w/m3x3vDIzBwdkQZRwRi0JMpLrdWWFbG+aGNgO8D1Lz+aC 8VfiKWhmFpIfBqaJpp8T9KT9SxLH0A5k0htE26lRY7m54v0uJ87lQnmMlRtTtogl2H WLV9G3Efv4xcPJRzhJz9TtJW92ZUUsRYLcMT6iw7dRzmtEi74qAqRvgPATneubi6tn 2Ru9cAgR5gRzXCF048YGvnl/i6CdB+TF3adAWDtxbzqulFCKvD9NpWh9oWDPDBRtEA nYwLowMcfuRWQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) 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 1wjZG0-00000004ny1-329E; Tue, 14 Jul 2026 09:16:52 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: Steffen Eiden , Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH v2 27/28] KVM: arm64: Expose FEAT_NV3 to guests Date: Tue, 14 Jul 2026 10:16:40 +0100 Message-ID: <20260714091641.1970822-28-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714091641.1970822-1-maz@kernel.org> References: <20260714091641.1970822-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, seiden@linux.ibm.com, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 Further enable FEAT_NV3 by making it visible to NV guests. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/nested.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index f646894fec9a9..70d605e60cfb3 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -1728,7 +1728,7 @@ u64 limit_nv_id_reg(struct kvm *kvm, u32 reg, u64 val) * You get EITHER * * - FEAT_VHE without FEAT_E2H0 - * - FEAT_NV limited to FEAT_NV2(p1) + * - FEAT_NV limited to FEAT_NV2(p1)/NV3 * - HCR_EL2.NV1 being RES0 * * OR @@ -1741,7 +1741,9 @@ u64 limit_nv_id_reg(struct kvm *kvm, u32 reg, u64 val) val = 0; } else { val &= ID_AA64MMFR4_EL1_NV_frac; - if (cpus_have_final_cap(ARM64_HAS_NV2P1)) + if (cpus_have_final_cap(ARM64_HAS_NV3)) + val = ID_REG_LIMIT_FIELD_ENUM(val, ID_AA64MMFR4_EL1, NV_frac, NV3); + else if (cpus_have_final_cap(ARM64_HAS_NV2P1)) val = ID_REG_LIMIT_FIELD_ENUM(val, ID_AA64MMFR4_EL1, NV_frac, NV2P1); else val = SYS_FIELD_PREP_ENUM(ID_AA64MMFR4_EL1, NV_frac, NV2_ONLY); -- 2.47.3