From: Sebastian Ene <sebastianene@google.com> To: catalin.marinas@arm.com, james.morse@arm.com, jean-philippe@linaro.org, maz@kernel.org, oliver.upton@linux.dev, qperret@google.com, qwandor@google.com, sudeep.holla@arm.com, suzuki.poulose@arm.com, tabba@google.com, will@kernel.org, yuzenghui@huawei.com, lpieralisi@kernel.org Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Sebastian Ene <sebastianene@google.com> Subject: [PATCH 4/4] KVM: arm64: Use FF-A 1.1 with pKVM Date: Thu, 18 Apr 2024 16:30:26 +0000 [thread overview] Message-ID: <20240418163025.1193763-6-sebastianene@google.com> (raw) In-Reply-To: <20240418163025.1193763-2-sebastianene@google.com> Now that the layout of the structures is compatible with 1.1 it is time to probe the 1.1 version of the FF-A protocol inside the hypervisor. If the TEE doesn't support it, it should return the minimum supported version. Signed-off-by: Sebastian Ene <sebastianene@google.com> --- arch/arm64/kvm/hyp/nvhe/ffa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index d53f50c73acb..8633c8e0b09b 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -455,7 +455,7 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id, memcpy(buf, host_buffers.tx, fraglen); ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; if (!offset || buf->ep_count != 1 || buf->sender_id != HOST_FFA_ID) { ret = FFA_RET_INVALID_PARAMETERS; @@ -534,7 +534,7 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res, fraglen = res->a2; ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; /* * We can trust the SPMD to get this right, but let's at least @@ -789,7 +789,7 @@ int hyp_ffa_init(void *pages) if (kvm_host_psci_config.smccc_version < ARM_SMCCC_VERSION_1_2) return 0; - arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_0, 0, 0, 0, 0, 0, 0, &res); + arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_1, 0, 0, 0, 0, 0, 0, &res); if (res.a0 == FFA_RET_NOT_SUPPORTED) return 0; -- 2.44.0.769.g3c40516874-goog
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Ene <sebastianene@google.com> To: catalin.marinas@arm.com, james.morse@arm.com, jean-philippe@linaro.org, maz@kernel.org, oliver.upton@linux.dev, qperret@google.com, qwandor@google.com, sudeep.holla@arm.com, suzuki.poulose@arm.com, tabba@google.com, will@kernel.org, yuzenghui@huawei.com, lpieralisi@kernel.org Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Sebastian Ene <sebastianene@google.com> Subject: [PATCH 4/4] KVM: arm64: Use FF-A 1.1 with pKVM Date: Thu, 18 Apr 2024 16:30:26 +0000 [thread overview] Message-ID: <20240418163025.1193763-6-sebastianene@google.com> (raw) In-Reply-To: <20240418163025.1193763-2-sebastianene@google.com> Now that the layout of the structures is compatible with 1.1 it is time to probe the 1.1 version of the FF-A protocol inside the hypervisor. If the TEE doesn't support it, it should return the minimum supported version. Signed-off-by: Sebastian Ene <sebastianene@google.com> --- arch/arm64/kvm/hyp/nvhe/ffa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index d53f50c73acb..8633c8e0b09b 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -455,7 +455,7 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id, memcpy(buf, host_buffers.tx, fraglen); ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; if (!offset || buf->ep_count != 1 || buf->sender_id != HOST_FFA_ID) { ret = FFA_RET_INVALID_PARAMETERS; @@ -534,7 +534,7 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res, fraglen = res->a2; ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; /* * We can trust the SPMD to get this right, but let's at least @@ -789,7 +789,7 @@ int hyp_ffa_init(void *pages) if (kvm_host_psci_config.smccc_version < ARM_SMCCC_VERSION_1_2) return 0; - arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_0, 0, 0, 0, 0, 0, 0, &res); + arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_1, 0, 0, 0, 0, 0, 0, &res); if (res.a0 == FFA_RET_NOT_SUPPORTED) return 0; -- 2.44.0.769.g3c40516874-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-04-18 16:31 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-18 16:30 [PATCH 0/4] KVM: arm64: pKVM host proxy FF-A fixes Sebastian Ene 2024-04-18 16:30 ` Sebastian Ene 2024-04-18 16:30 ` [PATCH 1/4] KVM: arm64: Trap FFA_VERSION host call in pKVM Sebastian Ene 2024-04-18 16:30 ` Sebastian Ene 2024-05-03 14:39 ` Will Deacon 2024-05-03 14:39 ` Will Deacon 2024-05-03 15:29 ` Sebastian Ene 2024-05-03 15:29 ` Sebastian Ene 2024-05-03 16:21 ` Will Deacon 2024-05-03 16:21 ` Will Deacon 2024-05-07 9:17 ` Sebastian Ene 2024-05-07 9:17 ` Sebastian Ene 2024-04-18 16:30 ` [PATCH 2/4] KVM: arm64: Add support for FFA_PARTITION_INFO_GET Sebastian Ene 2024-04-18 16:30 ` Sebastian Ene 2024-05-03 15:01 ` Will Deacon 2024-05-03 15:01 ` Will Deacon 2024-05-15 15:40 ` Sebastian Ene 2024-05-15 15:40 ` Sebastian Ene 2024-04-18 16:30 ` [PATCH 3/4] KVM: arm64: Fix the identification range for the FF-A smcs Sebastian Ene 2024-04-18 16:30 ` Sebastian Ene 2024-05-03 15:07 ` Will Deacon 2024-05-03 15:07 ` Will Deacon 2024-04-18 16:30 ` Sebastian Ene [this message] 2024-04-18 16:30 ` [PATCH 4/4] KVM: arm64: Use FF-A 1.1 with pKVM Sebastian Ene
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240418163025.1193763-6-sebastianene@google.com \ --to=sebastianene@google.com \ --cc=catalin.marinas@arm.com \ --cc=james.morse@arm.com \ --cc=jean-philippe@linaro.org \ --cc=kernel-team@android.com \ --cc=kvmarm@lists.linux.dev \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lpieralisi@kernel.org \ --cc=maz@kernel.org \ --cc=oliver.upton@linux.dev \ --cc=qperret@google.com \ --cc=qwandor@google.com \ --cc=sudeep.holla@arm.com \ --cc=suzuki.poulose@arm.com \ --cc=tabba@google.com \ --cc=will@kernel.org \ --cc=yuzenghui@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.