Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01497f5e authored by Isaac J. Manjarres's avatar Isaac J. Manjarres Committed by Gerrit - the friendly Code Review server
Browse files

haven: Align APIs and structures to account for the mem_info tag



The memory information tag is meant to be used in conjunction with
the memory notification interfaces to associate a label or tag with
a memory parcel. This memory information tag is meant to be used
for distinguishing between different memory resources that can be
transferred between Virtual Machines (VMs).

Change-Id: I6856284430ce5a78461c203904695aed25868706
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 983f8387
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ struct hh_mem_notify_req_payload {
	hh_memparcel_handle_t memparcel_handle;
	u32 flags:8;
	u32 reserved1:24;
	hh_label_t mem_info_tag;
} __packed;

/* End Message ID headers */
+5 −0
Original line number Diff line number Diff line
@@ -1206,6 +1206,9 @@ EXPORT_SYMBOL(hh_rm_mem_lend);
 * out
 * @flags: Flags to determine if the notification is for notifying that memory
 *         has been shared to another VM, or that a VM has released memory
 * @mem_info_tag: A 32-bit value that is attached to the MEM_SHARED/MEM_RELEASED
 *                notifications to aid in distinguishing different resources
 *                from one another.
 * @vmid_desc: A list of VMIDs to notify that memory has been shared with them.
 *             This parameter should only be non-NULL if other VMs are being
 *             notified (i.e. it is invalid to specify this parameter when the
@@ -1215,6 +1218,7 @@ EXPORT_SYMBOL(hh_rm_mem_lend);
 * returned.
 */
int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags,
		     hh_label_t mem_info_tag,
		     struct hh_notify_vmid_desc *vmid_desc)
{
	struct hh_mem_notify_req_payload *req_payload_hdr;
@@ -1246,6 +1250,7 @@ int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags,
	req_payload_hdr = req_buf;
	req_payload_hdr->memparcel_handle = handle;
	req_payload_hdr->flags = flags;
	req_payload_hdr->mem_info_tag = mem_info_tag;

	if (flags & HH_RM_MEM_NOTIFY_RECIPIENT) {
		dst_vmid_desc = req_buf + sizeof(*req_payload_hdr);
+5 −1
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ struct hh_rm_notif_mem_shared_payload {
	u16 owner_vmid;
	u16 reserved2;
	u32 label;
	hh_label_t mem_info_tag;
	/* TODO: How to arrange multiple variable length struct arrays? */
} __packed;

@@ -78,6 +79,7 @@ struct hh_rm_notif_mem_released_payload {
	u32 mem_handle;
	u16 participant_vmid;
	u16 reserved;
	hh_label_t mem_info_tag;
} __packed;

struct hh_acl_entry {
@@ -217,6 +219,7 @@ int hh_rm_mem_lend(u8 mem_type, u8 flags, hh_label_t label,
		   struct hh_mem_attr_desc *mem_attr_desc,
		   hh_memparcel_handle_t *handle);
int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags,
		     hh_label_t mem_info_tag,
		     struct hh_notify_vmid_desc *vmid_desc);
#else
/* RM client register notifications APIs */
@@ -342,6 +345,7 @@ static inline int hh_rm_mem_lend(u8 mem_type, u8 flags, hh_label_t label,
}

static inline int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags,
				   hh_label_t mem_info_tag,
				   struct hh_notify_vmid_desc *vmid_desc)
{
	return -EINVAL;