[PATCH v2 3/4] KVM: arm64: Fix the identification range for the FF-A smcs

Sebastian Ene posted 4 patches 1 year, 9 months ago
There is a newer version of this series
[PATCH v2 3/4] KVM: arm64: Fix the identification range for the FF-A smcs
Posted by Sebastian Ene 1 year, 9 months ago
The FF-A spec 1.2 reserves the following ranges for identifying FF-A
calls:
0x84000060-0x840000FF: FF-A 32-bit calls
0xC4000060-0xC40000FF: FF-A 64-bit calls.

Use the range identification according to the spec and allow calls that
are currently out of the range(eg. FFA_MSG_SEND_DIRECT_REQ2) to be
identified correctly.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Sebastian Ene <sebastianene@google.com>
---
 arch/arm64/kvm/hyp/include/nvhe/ffa.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/include/nvhe/ffa.h b/arch/arm64/kvm/hyp/include/nvhe/ffa.h
index d9fd5e6c7d3c..146e0aebfa1c 100644
--- a/arch/arm64/kvm/hyp/include/nvhe/ffa.h
+++ b/arch/arm64/kvm/hyp/include/nvhe/ffa.h
@@ -9,7 +9,7 @@
 #include <asm/kvm_host.h>
 
 #define FFA_MIN_FUNC_NUM 0x60
-#define FFA_MAX_FUNC_NUM 0x7F
+#define FFA_MAX_FUNC_NUM 0xFF
 
 int hyp_ffa_init(void *pages);
 bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt, u32 func_id);
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog
Re: [PATCH v2 3/4] KVM: arm64: Fix the identification range for the FF-A smcs
Posted by Sudeep Holla 1 year, 8 months ago
On Wed, May 15, 2024 at 05:22:57PM +0000, Sebastian Ene wrote:
> The FF-A spec 1.2 reserves the following ranges for identifying FF-A
> calls:
> 0x84000060-0x840000FF: FF-A 32-bit calls
> 0xC4000060-0xC40000FF: FF-A 64-bit calls.
>
> Use the range identification according to the spec and allow calls that
> are currently out of the range(eg. FFA_MSG_SEND_DIRECT_REQ2) to be
> identified correctly.
>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

Not sure if this needs to be fixes though. With addition of notifications
in the FF-A driver(since v6.7), host can send FF-A messages beyond 0x7F.
But since the pKVM FF-A proxy support is not yet updated to v1.1, so I
don't think it needs to be tagged as fix. Just thought I will mention it
here anyways.

--
Regards,
Sudeep
Re: [PATCH v2 3/4] KVM: arm64: Fix the identification range for the FF-A smcs
Posted by Sebastian Ene 1 year, 8 months ago
On Wed, Jun 12, 2024 at 03:38:26PM +0100, Sudeep Holla wrote:
> On Wed, May 15, 2024 at 05:22:57PM +0000, Sebastian Ene wrote:
> > The FF-A spec 1.2 reserves the following ranges for identifying FF-A
> > calls:
> > 0x84000060-0x840000FF: FF-A 32-bit calls
> > 0xC4000060-0xC40000FF: FF-A 64-bit calls.
> >
> > Use the range identification according to the spec and allow calls that
> > are currently out of the range(eg. FFA_MSG_SEND_DIRECT_REQ2) to be
> > identified correctly.
> >
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> 
> Not sure if this needs to be fixes though. With addition of notifications
> in the FF-A driver(since v6.7), host can send FF-A messages beyond 0x7F.
> But since the pKVM FF-A proxy support is not yet updated to v1.1, so I
> don't think it needs to be tagged as fix. Just thought I will mention it
> here anyways.

Yes, good point. I will rewrite the title of the commit to remove the
fixes tag.

> 
> --
> Regards,
> Sudeep

Thanks,
Seb