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: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Isaac J. Manjarres 2020-04-14 22:12:52 -07:00 committed by Gerrit - the friendly Code Review server
parent 983f8387ac
commit 01497f5e88
3 changed files with 11 additions and 1 deletions

View File

@ -274,6 +274,7 @@ struct hh_mem_notify_req_payload {
hh_memparcel_handle_t memparcel_handle; hh_memparcel_handle_t memparcel_handle;
u32 flags:8; u32 flags:8;
u32 reserved1:24; u32 reserved1:24;
hh_label_t mem_info_tag;
} __packed; } __packed;
/* End Message ID headers */ /* End Message ID headers */

View File

@ -1206,6 +1206,9 @@ EXPORT_SYMBOL(hh_rm_mem_lend);
* out * out
* @flags: Flags to determine if the notification is for notifying that memory * @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 * 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. * @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 * This parameter should only be non-NULL if other VMs are being
* notified (i.e. it is invalid to specify this parameter when the * notified (i.e. it is invalid to specify this parameter when the
@ -1215,6 +1218,7 @@ EXPORT_SYMBOL(hh_rm_mem_lend);
* returned. * returned.
*/ */
int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags, 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_notify_vmid_desc *vmid_desc)
{ {
struct hh_mem_notify_req_payload *req_payload_hdr; 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 = req_buf;
req_payload_hdr->memparcel_handle = handle; req_payload_hdr->memparcel_handle = handle;
req_payload_hdr->flags = flags; req_payload_hdr->flags = flags;
req_payload_hdr->mem_info_tag = mem_info_tag;
if (flags & HH_RM_MEM_NOTIFY_RECIPIENT) { if (flags & HH_RM_MEM_NOTIFY_RECIPIENT) {
dst_vmid_desc = req_buf + sizeof(*req_payload_hdr); dst_vmid_desc = req_buf + sizeof(*req_payload_hdr);

View File

@ -55,6 +55,7 @@ struct hh_rm_notif_mem_shared_payload {
u16 owner_vmid; u16 owner_vmid;
u16 reserved2; u16 reserved2;
u32 label; u32 label;
hh_label_t mem_info_tag;
/* TODO: How to arrange multiple variable length struct arrays? */ /* TODO: How to arrange multiple variable length struct arrays? */
} __packed; } __packed;
@ -78,6 +79,7 @@ struct hh_rm_notif_mem_released_payload {
u32 mem_handle; u32 mem_handle;
u16 participant_vmid; u16 participant_vmid;
u16 reserved; u16 reserved;
hh_label_t mem_info_tag;
} __packed; } __packed;
struct hh_acl_entry { 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, struct hh_mem_attr_desc *mem_attr_desc,
hh_memparcel_handle_t *handle); hh_memparcel_handle_t *handle);
int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags, 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_notify_vmid_desc *vmid_desc);
#else #else
/* RM client register notifications APIs */ /* RM client register notifications APIs */
@ -342,7 +345,8 @@ 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, static inline int hh_rm_mem_notify(hh_memparcel_handle_t handle, u8 flags,
struct hh_notify_vmid_desc *vmid_desc) hh_label_t mem_info_tag,
struct hh_notify_vmid_desc *vmid_desc)
{ {
return -EINVAL; return -EINVAL;
} }