Commit Graph

7 Commits

Author SHA1 Message Date
Andrew Walbran
64eaaad40f ANDROID: KVM: arm64: Handle FFA_RXTX_MAP and FFA_RXTX_UNMAP calls from the host
Handle FFA_RXTX_MAP and FFA_RXTX_UNMAP calls from the host by sharing
the host's mailbox memory with the hypervisor and establishing a
separate pair of mailboxes between the hypervisor and the SPMD at EL3.

Co-developed-by: Will Deacon <willdeacon@google.com>
Signed-off-by: Andrew Walbran <qwandor@google.com>
Bug: 171706629
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ib5fa89e9b01aa20f7c1b5b41df79d66e98d07f55
2022-02-17 12:10:35 +00:00
Andrew Walbran
1c0baeb7f0 ANDROID: firmware: arm_ffa: Move comment before the field it is documenting
This is consistent with the other comments in the struct.

Signed-off-by: Andrew Walbran <qwandor@google.com>
Bug: 171706629
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I10e9014a0d505fe5e132fb1cd6105b95a3f5f2bf
2022-02-17 12:10:34 +00:00
Andrew Walbran
905f49d35b ANDROID: firmware: arm_ffa: Move constants to header file
FF-A function IDs and error codes will be needed in the hypervisor too,
so move to them to the header file where they can be shared. Rename the
version constants with an "FFA_" prefix so that they are less likely
to clash with other code in the tree.

Co-developed-by: Will Deacon <willdeacon@google.com>
Signed-off-by: Andrew Walbran <qwandor@google.com>
Bug: 171706629
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I00ed487279fdfb61ea34ae99140c6fac8ee89187
2022-02-17 12:10:34 +00:00
Marc Bonnici
266a727922 UPSTREAM: firmware: arm_ffa: Add support for MEM_LEND
As part of the FF-A spec, an endpoint is allowed to transfer access of,
or lend, a memory region to one or more borrowers.

Extend the existing memory sharing implementation to support
FF-A MEM_LEND functionality and expose this to other kernel drivers.

Note that upon a successful MEM_LEND request the caller must ensure that
the memory region specified is not accessed until a successful
MEM_RECALIM call has been made. On systems with a hypervisor present
this will been enforced, however on systems without a hypervisor the
responsibility falls to the calling kernel driver to prevent access.

Link: https://lore.kernel.org/r/20211015165742.2513065-1-marc.bonnici@arm.com
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 82a8daaecfd9382e9450a05f86be8a274cf69a27)
Change-Id: I45e0376785904580ca6585225b7b63cc49f66bf1
Bug: 168585974
Signed-off-by: Will Deacon <willdeacon@google.com>
2022-02-09 12:22:29 +00:00
Sudeep Holla
cc2195fe53 firmware: arm_ffa: Add support for MEM_* interfaces
Most of the MEM_* APIs share the same parameters, so they can be
generalised. Currently only MEM_SHARE is implemented and the user space
interface for that is not added yet.

Link: https://lore.kernel.org/r/20210521151033.181846-6-sudeep.holla@arm.com
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-05-26 22:38:43 +01:00
Sudeep Holla
d0c0bce831 firmware: arm_ffa: Setup in-kernel users of FFA partitions
Parse the FFA nodes from the device-tree and register all the partitions
whose services will be used in the kernel.

In order to also enable in-kernel users of FFA interface, let us add
simple set of operations for such devices.

The in-kernel users are registered without the character device interface.

Link: https://lore.kernel.org/r/20210521151033.181846-5-sudeep.holla@arm.com
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-05-26 22:38:43 +01:00
Sudeep Holla
e781858488 firmware: arm_ffa: Add initial FFA bus support for device enumeration
The Arm FF for Armv8-A specification has concept of endpoints or
partitions. In the Normal world, a partition could be a VM when
the Virtualization extension is enabled or the kernel itself.

In order to handle multiple partitions, we can create a FFA device for
each such partition on a dedicated FFA bus. Similarly, different drivers
requiring FFA transport can be registered on the same bus. We can match
the device and drivers using UUID. This is mostly for the in-kernel
users with FFA drivers.

Link: https://lore.kernel.org/r/20210521151033.181846-2-sudeep.holla@arm.com
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-05-26 22:36:46 +01:00