From patchwork Wed Jul 31 18:58:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13749064 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 7A998C3DA64 for ; Wed, 31 Jul 2024 19:01:08 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HRJ4rDOmPjWn4iWdpMUQdIoWNUbrXdtsCGyr9RSic3g=; b=PomxAZBVnbMVBko++NzATYr165 cXdh7zgDJX2a3B46rlWm3IBfZr9hZ4VoQPknm+77tCxwrBdd96oTULRbwWvZ/jM/W7ZlmbgcQol93 QawU8G30Fn8tUz82uTIlhh01n8K8XqlUV8FllcFgww1omd7Mbjf2HlY9UCl+QWAr6WlwiIu6Ehm/H emMijKkmUKUqD+hSLipj/JLk0bpI36fuoVDS6AdvVkviAQTwuawY/g5pDxUotXV3EfxtVVo/tp7fn uZCcS8S1jx069D4NPTyGglaQ6d+m894wzqlxEGVX0qBVmwGBhkUD73K6WN9DBT2qv220/qlcQGsh4 xrp0g7Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEZB-00000002CjE-3icT; Wed, 31 Jul 2024 19:00:53 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEXi-00000002CAg-2qZs for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 18:59:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C4722CE17D4; Wed, 31 Jul 2024 18:59:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D653C116B1; Wed, 31 Jul 2024 18:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722452360; bh=XSg+lwQ2g0nRVDthJlG8jLEJHyIpajpAAFoMvVS2r5k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vESV6yaq+se8b/obD5lptkajKWudiLt9pSQ9lwZc3cId+JXJiC85ZmYUFN5Oj6NIC JyRcKhkm3kcezmQDUMYsdALc+66WllZVwa/4wuptaDf9Q2xmuzvdZhu2WtK0gYy74h mCFfyhbcs3512drL+X4KJDwOgZA3jjbcSfpX+6eNS61u8Edx8g4SPdMRJO2SqBdTgh d5L+qCQDKKuzJ76eeXwXbR+0ZTJDH+a2ZERVSTsv8QMYFKH+VS49JplnK4Xzf5Yz0E lKiqB30Y9xrtjJdF+ckAbInzxvjQOFXHg53hCaWWglxWq1ZDVlHghAz0dhAn/Ti80E BOQKZuzv5DtNg== From: Mark Brown Date: Wed, 31 Jul 2024 19:58:37 +0100 Subject: [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions MIME-Version: 1.0 Message-Id: <20240731-kvm-arm64-fgt-doc-v1-1-abb364f8fe57@kernel.org> References: <20240731-kvm-arm64-fgt-doc-v1-0-abb364f8fe57@kernel.org> In-Reply-To: <20240731-kvm-arm64-fgt-doc-v1-0-abb364f8fe57@kernel.org> To: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Fuad Tabba Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=1401; i=broonie@kernel.org; h=from:subject:message-id; bh=XSg+lwQ2g0nRVDthJlG8jLEJHyIpajpAAFoMvVS2r5k=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmqomCoNLrvAvRpKGkMdbEwhgsRaot3JhlgytOQAJI 6WjxHLuJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZqqJggAKCRAk1otyXVSH0CmpB/ 9C4Ym5KBqxoNgXRss3lajUhwhZiOEoo5xFr6umTw5c/SWiK2uOVEKgElVyeM+yAOJE4KOX8zFQqHSd S+AMf1oXBbEOchQ/ULdIALTqTGyjMZ1kJEdSTCl5ljGXkqelqZ+qrbE3DZEoqQ3y/hTuMRyrD2ENuK yi4wODmI7ksUEcbBFJtdnYD5Zqi7vpzMGy+1Xnl0G9wJT2+gVgYWDnFvnysNcPWzYuGy+YXSNJbfd8 lhrgAiK/0u4qG46xWwst+dVzWjUzDcFgXc8TcEWSEOeMjSsZc+lXy/hdrnZyomm/fiQSiKf93kXOCi 5c9KFx7FMOPYTNY+OkZn5k7JtuR3XI X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_115924_373618_BCB50FA9 X-CRM114-Status: GOOD ( 12.04 ) 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 Comments in the code say that our definitions for the FGT registers are not the generated ones and are updated only as far as DDI0487 J.a however in commit 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of specifying them") we updated to use the generated definitions, and as of the release of DDI0487 K.a the XML in DD0601 is in sync with the ARM. Remove the outdated comment about divergence. Fixes: 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of specifying them") Signed-off-by: Mark Brown --- arch/arm64/include/asm/kvm_arm.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index d81cc746e0eb..d347483395b4 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -342,12 +342,7 @@ /* * FGT register definitions * - * RES0 and polarity masks as of DDI0487J.a, to be updated as needed. - * We're not using the generated masks as they are usually ahead of - * the published ARM ARM, which we use as a reference. - * - * Once we get to a point where the two describe the same thing, we'll - * merge the definitions. One day. + * RES0 and polarity masks for the FGT registers. */ #define __HFGRTR_EL2_RES0 HFGxTR_EL2_RES0 #define __HFGRTR_EL2_MASK GENMASK(49, 0) From patchwork Wed Jul 31 18:58:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13749063 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 46D3BC3DA64 for ; Wed, 31 Jul 2024 19:00:42 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vGZZO4w90iL+ed4DOYoAiyXFasTc6IH196MH0myHnDk=; b=ErnwD8gQ0unp0DykU0/OLTIC4u GQKt2mpsoDKLrkXsp/+wx9jIXIpgBTa3nrHfVradnura3I7KPtVIaP22opOcUUEI7eyffSKC/iT9a l7Xyo2MjSYDGs8B7POcU7Ib4lA2l7PkibAqVShvBaOcfhCU58JRm/p+2221SeAWYnG0OScJjI2cEe mxpe0+tV/+6dMmPHrvfR7EWB9FqbPo1c/TMBYFlwYo5QBQKEF/WbTBk940waYpR4Gc0NmT5uk+X2w KR8vVGhqnHF8ri/Ra+5/30KYhTxYYulJi+/R9vn+3ySOzXy1QVu8q5wBrNPh6Fqk5rQWAwYHFtWnM A17r13Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEYh-00000002CXv-2OIC; Wed, 31 Jul 2024 19:00:23 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEXk-00000002CAo-07La for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 18:59:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 506FD6257C; Wed, 31 Jul 2024 18:59:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E09AEC4AF10; Wed, 31 Jul 2024 18:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722452363; bh=D1SKn5zDUad8T7fVsAtfQDtAE7+9Q9bJUWeW7NKX3PU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=B0qL0OgwBkTw/11CjRtPe7lABacGq+Nc1+ru4CS7zzz8j2RpYMFmdp6VcUZilzedk AzDInJuMRgAGxbbsvW8Ld2zX7MTfMf9QsrrNn2muf20GGpB1AdI8w2d/peeHtsFONA V00PrRGhQoxhIWvEBlj21QEOThBR1WxcX+CTaMgxCA9dKQPC9vCFTjz0Ota4o9QRPD VRfxQRsbGaYK/955AFfFpnKexiFqIr/gRa6fPnhwSBrwWfLH+AiqPo0POaQIrDORQp MUFpP2GwyOn1O/3dnvsiXOCRUb5Dd0oD9UJqnvHOxeF15BAUyxXfLk5bdnl+/ZAbf6 cnJDqtxLdjmqA== From: Mark Brown Date: Wed, 31 Jul 2024 19:58:38 +0100 Subject: [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers MIME-Version: 1.0 Message-Id: <20240731-kvm-arm64-fgt-doc-v1-2-abb364f8fe57@kernel.org> References: <20240731-kvm-arm64-fgt-doc-v1-0-abb364f8fe57@kernel.org> In-Reply-To: <20240731-kvm-arm64-fgt-doc-v1-0-abb364f8fe57@kernel.org> To: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Fuad Tabba Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=821; i=broonie@kernel.org; h=from:subject:message-id; bh=D1SKn5zDUad8T7fVsAtfQDtAE7+9Q9bJUWeW7NKX3PU=; b=owGbwMvMwMWocq27KDak/QLjabUkhrRVnU1eRZ/vFpwzi/Q2mtfjLsIi7fnm9ifeNw6L50w5+STy gsH/TkZjFgZGLgZZMUWWtc8yVqWHS2yd/2j+K5hBrEwgUxi4OAVgIm+S2P+ns+i9Trj/OzvfYcraR8 uN85U/2F/8lnTF2DJs4vVqlRkrwvgWpIdI1XkK6IX3JT8Ou15noPb5rPOproeZ6tp6craLVtiEm9av Zlu4SuuOHDtj9oOgpdoOTRu9cjnCnxV4hbzOfM/89VHvrPOrGf+n1ti1PVq6plfs27wsk4IFZ41mC6 gc/ZNn9Wbh1LY9y20qA/foxE+yqsjhu8h6u+Jt8VrRLyrih2/7ijv3nDWXrdnTzOysMctQKubaWjbL 2yHmCgcVV2o0Jc9s1U3KOp6ntTbsa7CJgN3NeNer2jc8y669OP/As6TzzIbvFVV8mj4OeafjZWtf3N As9/i1TF6JLSnqbhr/HQbl1fWPAA== X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_115924_376343_1AADECD2 X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. 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 Since the use of _MASK to mean bits where setting the bit causes traps to be generated is a little unusual add a clarifying comment. Signed-off-by: Mark Brown --- arch/arm64/include/asm/kvm_arm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index d347483395b4..1d8745740fb1 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -343,6 +343,10 @@ * FGT register definitions * * RES0 and polarity masks for the FGT registers. + * + * _RES0: Bits which are RES0 + * _MASK: Bits which enable traps when set + * _nMASK: Bits which disable traps when set */ #define __HFGRTR_EL2_RES0 HFGxTR_EL2_RES0 #define __HFGRTR_EL2_MASK GENMASK(49, 0)