[RFC PATCH v1 36/38] KVM: arm64: CCA: enable DA in realm create parameters

Aneesh Kumar K.V (Arm)
2025-07-28T13:56:11Z

Now that we have all the required steps for DA in-place, enable
DA while creating ralm.

Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
---
arch/arm64/include/asm/rmi_smc.h | 1 +
arch/arm64/kvm/rme.c | 2 ++
2 files changed, 3 insertions(+)

diff --git a/arch/arm64/include/asm/rmi_smc.h b/arch/arm64/include/asm/rmi_smc.h
index ab169b375198..f664954a2a91 100644
--- a/arch/arm64/include/asm/rmi_smc.h
+++ b/arch/arm64/include/asm/rmi_smc.h
@@ -112,6 +112,7 @@ enum rmi_ripas {
#define RMI_REALM_PARAM_FLAG_LPA2 BIT(0)
#define RMI_REALM_PARAM_FLAG_SVE BIT(1)
#define RMI_REALM_PARAM_FLAG_PMU BIT(2)
+#define RMI_REALM_PARAM_FLAG_DA BIT(3)

/*
* Note many of these fields are smaller than u64 but all fields have u64
diff --git a/arch/arm64/kvm/rme.c b/arch/arm64/kvm/rme.c
index 11c8d47e3e9b..394d1534e6c2 100644
--- a/arch/arm64/kvm/rme.c
+++ b/arch/arm64/kvm/rme.c
@@ -695,6 +695,8 @@ static int realm_create_rd(struct kvm *kvm)
if (r)
goto out_undelegate_tables;

+ /* For now default enable DA */
+ params->flags = RMI_REALM_PARAM_FLAG_DA;
params_phys = virt_to_phys(params);

if (rmi_realm_create(rd_phys, params_phys)) {
--
2.43.0