From patchwork Wed Jul 3 15:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13722494 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 2566FC2BD09 for ; Wed, 3 Jul 2024 15:48: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: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:In-Reply-To:References:List-Owner; bh=7RbyAE6sd3yLjp33IqfRiVb8w94zRhhTfaVgFY95otk=; b=EsZAJVq9uU1MtbwFjOkty5E1GX SLy0Vo5pM7azt3fwPRZedRuqpvxi/DNuj6by9wmGLfkpgtJrChh7rv8D1mff4Iq21ho3RFOU6x2l/ BFuEkavSHFLJGwHBvXrqmQIst7kFrjoY1zBG51ALYYOQbWw0wIZ2qjs6Ce9NXHnhNQzmAv8iTqq7R og6E27bcawbPgWGXzFCsWnpBcav7BjgqhCB7qs3jRo9D80fCTsG9kguwgeqhHjhxeHtTmrbI59MEz EvJJPMrRyfxTPSvvorIFf4nPj8yCRfMWOy2BMLTmzgyChFUC30W1qrvO6BsPFTazLd66KQFG8INCV g68CVNPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP2DI-0000000AkIB-2v4F; Wed, 03 Jul 2024 15:48:08 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP2D5-0000000AkDt-1h9A for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 15:47:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4A0CD6233E; Wed, 3 Jul 2024 15:47:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F14FEC2BD10; Wed, 3 Jul 2024 15:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720021674; bh=xVi9E4QQ7Ky8LoYasCK2VdMivLv1/qqg53/SZnL6ZHg=; h=From:To:Cc:Subject:Date:From; b=OHWG6LhouNPAcWCL7cidRjn4i+wELfViRrIopsZRrwK/sMVHEghk4ZrH8qnHB5xWS kroT6Pi/jj4A2a+b8s6M9QzhGt2W6sTBOjI1redKn+Y5dURZtsTgPkuaRjo8Rp3Ri8 OtrnmZwgmuYYocSNyhyMa3rN4asQ5fs4GQZVFp66tZvAwqAWxHAA26n68SvYzjHbar p0qlBIjOZzgNYxRV3rLy2SWGloUHeBtXXEkO0WhIOeNYXGfx/vQ/BqnXyXxR6b8VC5 +Zg8XkepunccVSKbQ41EGJD/792DapCEo0qwdgsUiZxo1GXqCaNeMffvTViv1zNrKd SDHDNyCNPIo+g== 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.95) (envelope-from ) id 1sP2D1-009V00-P0; Wed, 03 Jul 2024 16:47:51 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH] KVM: arm64: nv: Truely enable nXS TLBI operations Date: Wed, 3 Jul 2024 16:47:43 +0100 Message-Id: <20240703154743.824824-1-maz@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_084755_538566_160FA51E X-CRM114-Status: GOOD ( 13.02 ) 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 Although we now have support for nXS-flavoured TLBI instructions, we still don't expose the feature to the guest thanks to a mixture of misleading comment and use of a bunch of magic values. Fix the comment and correctly express the masking of LS64, which is enough to expose nXS to the world. Not that anyone cares... Signed-off-by: Marc Zyngier --- arch/arm64/kvm/nested.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index 81e0374a4a45b..b3c8d8e04a547 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -810,8 +810,8 @@ static u64 limit_nv_id_reg(u32 id, u64 val) break; case SYS_ID_AA64ISAR1_EL1: - /* Support everything but Spec Invalidation */ - val &= ~(GENMASK_ULL(63, 56) | + /* Support everything but Spec Invalidation and LS64 */ + val &= ~(NV_FTR(ISAR1, LS64) | NV_FTR(ISAR1, SPECRES)); break;