Re: [PATCH v4 7/7] firmware: arm_ffa: Add support for MEM_* interfaces
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: 2021-03-18 14:03:30
Also in:
linux-devicetree
On Fri, Feb 12, 2021 at 4:46 PM Sudeep Holla [off-list ref] 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 <redacted> --- drivers/firmware/arm_ffa/driver.c | 184 ++++++++++++++++++++++++++++++ include/linux/arm_ffa.h | 150 ++++++++++++++++++++++++ 2 files changed, 334 insertions(+)
[snip]
quoted hunk ↗ jump to hunk
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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel