Fix state on blocking mailbox_receive.
State was being set to vcpu_state_blocked_interrupt by
api_wait_for_interrupt. It should remain vcpu_state_blocked_mailbox.
Change-Id: I9289f93fdf4c674a701b79b21bb53f29385237b0
diff --git a/src/api.c b/src/api.c
index dac5388..4df0012 100644
--- a/src/api.c
+++ b/src/api.c
@@ -413,7 +413,6 @@
}
sl_lock(¤t->lock);
- current->state = vcpu_state_blocked_mailbox;
/* Push vcpu into waiter list. */
current->mailbox_next = vm->mailbox.recv_waiter;
@@ -421,7 +420,13 @@
sl_unlock(¤t->lock);
/* Switch back to primary vm to block. */
- *next = api_wait_for_interrupt(current);
+ {
+ struct hf_vcpu_run_return run_return = {
+ .code = HF_VCPU_RUN_WAIT_FOR_INTERRUPT,
+ };
+ *next = api_switch_to_primary(current, run_return,
+ vcpu_state_blocked_mailbox);
+ }
out:
sl_unlock(&vm->lock);