fix(ff-a): dispatch other world functions

Move FF-A related functions from other world module to plat ffa module
with different implementations based upon building the Hypervisor, SPMC,
or standalone image.

Change-Id: I85bedf58ddc074d41bb25ae2dcbcdaa407821562
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/inc/hf/arch/ffa_memory_handle.h b/inc/hf/arch/ffa_memory_handle.h
deleted file mode 100644
index 9eba5d4..0000000
--- a/inc/hf/arch/ffa_memory_handle.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2021 The Hafnium Authors.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file or at
- * https://opensource.org/licenses/BSD-3-Clause.
- */
-
-#ifndef FFA_MEMORY_HANDLE_H
-#define FFA_MEMORY_HANDLE_H
-
-#include "hf/ffa.h"
-
-/**
- * Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
- */
-ffa_memory_handle_t ffa_memory_handle_make(uint64_t index);
-
-/**
- * Checks whether given handle was allocated by current world, according to
- * handle encoding rules.
- */
-bool ffa_memory_handle_allocated_by_current_world(ffa_memory_handle_t handle);
-
-#endif
diff --git a/inc/hf/arch/other_world.h b/inc/hf/arch/other_world.h
index bb69779..1d34f56 100644
--- a/inc/hf/arch/other_world.h
+++ b/inc/hf/arch/other_world.h
@@ -11,25 +11,5 @@
 #include "hf/ffa.h"
 #include "hf/vm.h"
 
-struct sve_other_world_context_t {
-	uint8_t vectors[32][HF_SVE_VECTOR_LENGTH / 8];
-
-	/* FFR and predicates are one-eigth of the SVE vector length */
-	uint8_t ffr[HF_SVE_VECTOR_LENGTH / 64];
-
-	uint8_t predicates[16][HF_SVE_VECTOR_LENGTH / 64];
-} __attribute__((aligned(16)));
-
-void arch_other_world_log_init(void);
-void arch_other_world_init(void);
 bool arch_other_world_vm_init(struct vm *other_world_vm, struct mpool *ppool);
 struct ffa_value arch_other_world_call(struct ffa_value args);
-bool arch_other_world_is_direct_request_valid(struct vcpu *current,
-					      ffa_vm_id_t sender_vm_id,
-					      ffa_vm_id_t receiver_vm_id);
-bool arch_other_world_is_direct_response_valid(struct vcpu *current,
-					       ffa_vm_id_t sender_vm_id,
-					       ffa_vm_id_t receiver_vm_id);
-bool arch_other_world_direct_request_forward(ffa_vm_id_t receiver_vm_id,
-					     struct ffa_value args,
-					     struct ffa_value *ret);
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index 19c8e45..e300ade 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -9,6 +9,31 @@
 #pragma once
 
 #include "hf/ffa.h"
+#include "hf/vcpu.h"
 
 /** Returns the SPMC ID. */
 struct ffa_value plat_ffa_spmc_id_get(void);
+
+void plat_ffa_log_init(void);
+void plat_ffa_init(bool tee_enabled);
+bool plat_ffa_is_direct_request_valid(struct vcpu *current,
+				      ffa_vm_id_t sender_vm_id,
+				      ffa_vm_id_t receiver_vm_id);
+bool plat_ffa_is_direct_response_valid(struct vcpu *current,
+				       ffa_vm_id_t sender_vm_id,
+				       ffa_vm_id_t receiver_vm_id);
+bool plat_ffa_direct_request_forward(ffa_vm_id_t receiver_vm_id,
+				     struct ffa_value args,
+				     struct ffa_value *ret);
+
+/**
+ * Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
+ */
+ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index);
+
+/**
+ * Checks whether given handle was allocated by current world, according to
+ * handle encoding rules.
+ */
+bool plat_ffa_memory_handle_allocated_by_current_world(
+	ffa_memory_handle_t handle);
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index 179c8ec..121af9d 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -55,9 +55,6 @@
 /** The virtual interrupt ID used for managed exit. */
 #define HF_MANAGED_EXIT_INTID 4
 
-/** SVE vector size supported. */
-#define HF_SVE_VECTOR_LENGTH 512
-
 /** Type of interrupts */
 enum interrupt_type {
 	INTERRUPT_TYPE_IRQ,