[PATCH v4 7/7] firmware: arm_ffa: Add support for MEM_* interfaces
Jens Wiklander
jens.wiklander at linaro.org
Thu Mar 18 14:02:35 GMT 2021
On Fri, Feb 12, 2021 at 4:46 PM Sudeep Holla <sudeep.holla at arm.com> wrote:
>
> 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.
>
> Signed-off-by: Sudeep Holla <sudeep.holla at arm.com>
> ---
> drivers/firmware/arm_ffa/driver.c | 184 ++++++++++++++++++++++++++++++
> include/linux/arm_ffa.h | 150 ++++++++++++++++++++++++
> 2 files changed, 334 insertions(+)
>
[snip]
> diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h
> index f0c68f3f1c6a..9d7a5a3eac75 100644
> --- a/include/linux/arm_ffa.h
> +++ b/include/linux/arm_ffa.h
[snip]
> +struct ffa_mem_region {
> + /* The ID of the VM/owner which originally sent the memory region */
> + u16 sender_id;
> +#define FFA_MEM_NORMAL BIT(5)
> +#define FFA_MEM_DEVICE BIT(4)
> +
> +#define FFA_MEM_WRITE_BACK (3 << 2)
> +#define FFA_MEM_NON_CACHEABLE (1 << 2)
> +
> +#define FFA_DEV_nGnRnE (0 << 2)
> +#define FFA_DEV_nGnRE (1 << 2)
> +#define FFA_DEV_nGRE (2 << 2)
> +#define FFA_DEV_GRE (3 << 2)
> +
> +#define FFA_MEM_NON_SHAREABLE (0)
> +#define FFA_MEM_OUTER_SHAREABLE (2)
> +#define FFA_MEM_INNER_SHAREABLE (3)
> + u8 attributes;
> + u8 reserved_0;
> +/*
> + * Clear memory region contents after unmapping it from the sender and
> + * before mapping it for any receiver.
> + */
> +#define FFA_MEM_CLEAR BIT(0)
> +/*
> + * Whether the hypervisor may time slice the memory sharing or retrieval
> + * operation.
> + */
> +#define FFA_TIME_SLICE_ENABLE BIT(1)
> +
> +/*
> + * Whether the hypervisor should clear the memory region before the receiver
> + * relinquishes it or is aborted.
> + */
> +#define FFA_MEM_CLEAR_BEFORE_RELINQUISH BIT(0)
I believe this should be clear before retrieval.
Thanks,
Jens
More information about the linux-arm-kernel
mailing list