Fill in message attributes for messages to primary VM too.
Bug: 132420445
Change-Id: I88d92d021b04234c3027bd2dc41c3965d5751d11
diff --git a/src/api.c b/src/api.c
index 4db97dd..19cbbd1 100644
--- a/src/api.c
+++ b/src/api.c
@@ -903,7 +903,7 @@
* with the help of the primary VM.
*/
static void deliver_msg(struct vm_locked to, struct vm_locked from,
- uint32_t size, struct vcpu *current, struct vcpu **next)
+ struct vcpu *current, struct vcpu **next)
{
struct spci_value primary_ret = {
.func = SPCI_MSG_SEND_32,
@@ -916,7 +916,8 @@
* Only tell the primary VM the size if the message is for it,
* to avoid leaking data about messages for other VMs.
*/
- primary_ret.arg3 = size;
+ primary_ret.arg3 = to.vm->mailbox.recv_size;
+ primary_ret.arg4 = to.vm->mailbox.recv_attributes;
to.vm->mailbox.state = MAILBOX_STATE_READ;
*next = api_switch_to_primary(current, primary_ret,
@@ -1064,8 +1065,7 @@
ret = (struct spci_value){.func = SPCI_SUCCESS_32};
}
- deliver_msg(vm_to_from_lock.vm1, vm_to_from_lock.vm2, size, current,
- next);
+ deliver_msg(vm_to_from_lock.vm1, vm_to_from_lock.vm2, current, next);
out:
vm_unlock(&vm_to_from_lock.vm1);