[PATCH v2 04/12] KVM: arm64: Add bit masks for HAFGRTR_EL2

Fuad Tabba
2023-12-06T10:05:50Z

To support HAFGRTR_EL2 supported in nested virt in the following
patch, first add its bitmask definitions based on the 2023-09
Arm Architecture System Registers xml specification [*].

[*] https://developer.arm.com/downloads/-/exploration-tools

Signed-off-by: Fuad Tabba <tabba@google.com>
---
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 b85f46a73e21..7de0a7062625 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -370,6 +370,10 @@
#define __HDFGWTR_EL2_MASK ~__HDFGWTR_EL2_nMASK
#define __HDFGWTR_EL2_nMASK GENMASK(62, 60)

+#define __HAFGRTR_EL2_RES0 (GENMASK(63, 50) | GENMASK(16, 5))
+#define __HAFGRTR_EL2_MASK (GENMASK(49, 17) | GENMASK(4, 0))
+#define __HAFGRTR_EL2_nMASK 0UL
+
/* Similar definitions for HCRX_EL2 */
#define __HCRX_EL2_RES0 (GENMASK(63, 16) | GENMASK(13, 12))
#define __HCRX_EL2_MASK (0)
--
2.43.0.rc2.451.g8631bc7472-goog