fix(ipi): FFA_NOTIFICATION_INFO_GET returns waiting vCPUs for IPIs
Only report the pending IPIs of waiting vCPUs for
FFA_NOTIFICATION_INFO_GET as these are the only ones that need explicit
cycles from the Normal World.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I48a7f2c9f05e0f91a1627c96a2ab0babf4dcf8fd
diff --git a/src/vm.c b/src/vm.c
index 75392d9..8e4930c 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -931,8 +931,12 @@
vcpu_is_virt_interrupt_pending(interrupts, HF_IPI_INTID) &&
!vcpu_ipi_is_info_get_retrieved(vcpu_locked);
- /* No notifications pending that haven't been retrieved. */
- if (!pending_not_retrieved) {
+ /*
+ * No notifications pending that haven't been retrieved or the vCPU is
+ * not in the waiting state. Only report waiting vCPUs as this is the
+ * only state that needs explicit cycles donated from the NWd.
+ */
+ if (!pending_not_retrieved || vcpu->state != VCPU_STATE_WAITING) {
ret = false;
goto out;
}