hf_mailbox_receive should not block if there is a pending interrupt.
This matches the behaviour of WFI, which only traps (and so causes Hafnium
to block the vCPU) if there is not currently a pending interrupt, ignoring
PSTATE.
Bug: 127686530
Change-Id: I06ef4513d3b9f5adf7988f6f77c178cba40b1762
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index ef5e595..7159379 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -134,6 +134,13 @@
* If no message was received, the VM ID will be HF_INVALID_VM_ID.
*
* The mailbox must be cleared before a new message can be received.
+ *
+ * If no message is immediately available, `block` is true, and there are no
+ * enabled and pending interrupts (irrespective of whether interrupts are
+ * enabled globally), then this will block until a message is available or an
+ * enabled interrupt becomes pending. This matches the behaviour of the WFI
+ * instruction on aarch64, except that a message becoming available is also
+ * treated like a wake-up event.
*/
static inline struct hf_mailbox_receive_return hf_mailbox_receive(bool block)
{